• Mahmoud Aglan's avatar
    feat(billing): add a command that puts unbilled players back on the cycle · 190c0ccf
    Mahmoud Aglan authored
    enrollments is the only table GenerateRenewalInvoices bills from, so a player
    whose enrolment row was destroyed is not "skipped" — that command never sees
    them, every counter in its summary reads clean, and they train unbilled
    indefinitely. GuardsEnrolmentDeletion refuses the delete that causes it and
    GenerateRenewalInvoices names the players already affected. Neither puts
    anybody back.
    
    The rebuild is from evidence, never inference: audit_logs holds the created and
    updated entries for the destroyed enrolment, and those name the group and
    programme the player was actually in. Where that programme survives the player
    goes straight back into it. Where it was deleted — the usual case, since
    deleting the programme is what destroyed the enrolment — the command refuses to
    pick a replacement by name similarity and demands an explicit --map old:new. A
    player put in the wrong programme is billed the wrong price, and a wrong
    invoice is worse than a missing one because it looks right.
    
    next_billing_date is set to the cycle after the player's last invoice, capped
    at the current one, so the renewal run raises the months they actually owe,
    each dated the 1st of the cycle it buys — never a month nobody ever billed
    them for. Dry run by default; this exists to be pointed at production.
    Co-Authored-By: 's avatarClaude Opus 5 (1M context) <noreply@anthropic.com>
    190c0ccf
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...