• Mahmoud Aglan's avatar
    feat(registration): register a whole family in one visit, priced as a family · 50f3a2bd
    Mahmoud Aglan authored
    The reception wizard took exactly one child. That was not merely inconvenient:
    the sibling discount is priced off how many children a family has, and a child
    registered alone always looked like a family of one. The first child could
    never qualify, and by the time the second was entered the first one's invoice
    was frozen — invoices are immutable — so it could not be put right afterwards
    either. The only way to get the discount was to know to register the younger
    child first, which is not a system, it is folklore.
    
    Step 1 is a roster now. The `participant_*` properties stay as the draft form
    for the child being typed, so every existing rule, the NID decoder and the
    membership-id sibling warning are untouched; `players[]` is the committed list
    and the only thing confirm() reads. Each child picks their own programme on
    step 4, because siblings are rarely the same age.
    
    resolveSiblingPosition() counts the children already on the books AND the ones
    being registered alongside — that one change is what makes the discount fire
    for a family arriving together.
    
    The money is written the way the rest of the system writes it: one participant,
    one enrolment and one invoice per child, which is also how the renewal cron
    finds them next month. What is new is that the desk takes a single sum and it
    is allocated across those invoices in roster order, so an underpayment leaves a
    visible balance on the last child rather than a shortfall smeared over all of
    them. The platform fee and a super-admin override are split by value with the
    rounding remainder on the last child, so the invoices always add back up to
    exactly what was quoted. Cart lines carry a player index — a kit is issued to
    a person — and removing a child takes their lines with them and renumbers the
    rest, or the items would silently reattach to whoever slid into that slot.
    
    SiblingRegistrationTest pins the parts that can lose money: two children get
    two invoices summing to the quoted total, one payment lands on them in full,
    and a part payment settles the first child and leaves one visible balance.
    Co-Authored-By: 's avatarClaude Opus 5 (1M context) <noreply@anthropic.com>
    50f3a2bd
Name
Last commit
Last update
Screenshots Loading commit data...
app Loading commit data...
bootstrap Loading commit data...
config Loading commit data...
database Loading commit data...
docker Loading commit data...
docs Loading commit data...
docs-site Loading commit data...
flutter_shell Loading commit data...
gap-filling-plans Loading commit data...
lang Loading commit data...
marketing-site Loading commit data...
plans Loading commit data...
public Loading commit data...
reference/oc-sport Loading commit data...
resources Loading commit data...
routes Loading commit data...
scripts Loading commit data...
storage Loading commit data...
tests Loading commit data...
.dockerignore Loading commit data...
.editorconfig Loading commit data...
.env.example Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.npmrc Loading commit data...
Beanding Guide.txt Loading commit data...
CLAUDE.md Loading commit data...
Dockerfile Loading commit data...
README.md Loading commit data...
artisan Loading commit data...
captain-definition Loading commit data...
composer.json Loading commit data...
composer.lock Loading commit data...
deploy.sh Loading commit data...
elcaptain-sportsonly-db.md Loading commit data...
one-click-app.yml Loading commit data...
package-lock.json Loading commit data...
package.json Loading commit data...
phpunit.xml Loading commit data...
system info.txt Loading commit data...
vite.config.js Loading commit data...
نادى الشيخ زايد كشف بيانات اللاعبين (2).html Loading commit data...