Allow members to sign up for an Angebot (petition)

Open
#59 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
15/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
php

Research direction

Start with the Petition entity (openPositions, filledPositions) and PetitionCanEditVoter with the PETITION_CAN_UPDATE and PETITION_READ attributes. Settle the open decisions first: the migration of legacy counts, who may see the signup names, and the sequencing after #57. Done means a PetitionSignup entity with migration, signup and withdraw endpoints guarded by status, dueDate and free slots, and tests for the concurrent last slot.

Written by the indexing model from the issue text.

Description

Backend enhancement Frontend

Goal

Let members sign up for an Angebot (Petition) themselves ("Ich übernehme") instead of the creator maintaining filledPositions by hand. Planned as a future option, not part of the current redesign.

Current state

  • Petition only stores counters: openPositions and filledPositions (integers). It does not record who took a slot.
  • Only the creator can edit a petition (PetitionCanEditVoter → PETITION_CAN_UPDATE on put), so other members cannot change filledPositions.
  • Points for a completed Angebot are sent manually as a normal transaction.

What needs to be done

Backend

  • New entity PetitionSignup (petition, user, createdAt, unique on petition+user) plus a Doctrine migration.
  • Endpoints for the current user: sign up (POST) and withdraw (DELETE). Both are only allowed while the petition status is open, dueDate has not passed and there are free slots.
  • Derive filledPositions from the signup count, or keep it in sync inside the same transaction. Lock the row (or use a DB constraint) so two members cannot take the last slot at the same time.
  • Expose the signups in PETITION_READ. Decide whether all members see the names, or only the creator and admins.
  • The creator can remove a signup. Optional: when a petition is closed, the creator triggers the point transfer to all signed-up members in one action.
  • Tests: signup/withdraw rules, full petition, closed or past-due petition, concurrent last slot, voter permissions.

Frontend

  • "Ich übernehme" / "Austragen" button on the Angebot detail page, a slot progress indicator and the list of participants.
  • A "Meine" tab that also shows Angebote the member signed up for.

Impact

  • Data/migration: a new table. Existing filledPositions values have no names attached, so they either stay as legacy counts or get reset. This needs a decision.
  • API compatibility: if filledPositions becomes read-only (derived), the creator's current put that edits it changes behaviour, and the old frontend must not rely on it.
  • Permissions: this is the first write action members can do on another user's petition, so it needs its own voter attribute and tests.
  • Privacy: showing who signed up exposes participation to other members. It is acceptable inside the club, but should be a conscious decision.
  • Depends on #57: implement it after the Symfony 7.4 / API Platform upgrade so it is written in the new API Platform syntax.
Dominant language
PHP
Stars
1
Forks
0
Avg merge
7h 58m
Merged PRs (30d)
3

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from RunningJoke/allipunkte

All issues in RunningJoke/allipunkte

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.