• Mahmoud Aglan's avatar
    feat(pricing): scope a discount to members or to non-members, and let a... · cc9d0d65
    Mahmoud Aglan authored
    feat(pricing): scope a discount to members or to non-members, and let a branch-targeted one save at all
    
    Membership tier decided only which base price was read; it was invisible to
    every rule. A club wanting '10% off, members only' had no way to say it.
    The nearest rule type, membership_duration, is tenure in months, which is a
    different question and happily matches a non-member who has been around a
    while. New membership_type rule type, with the CHECK constraint widened to
    admit it — no existing row changes value, and the new one is unreachable
    until a rule is authored with it.
    
    The tier the rule matches is the same one that chose the base price, so a
    discount and the price it discounts cannot disagree about who this is. An
    unset tier reads as non_member, matching step 1, so a 'members only' rule
    cannot quietly reach someone nobody ever classified.
    
    And the bug the test for it found: NO branch-targeted discount could be
    saved. pricing_rule_branches.academy_id is NOT NULL and the pivot has no
    model, so no BelongsToAcademy hook filled it and a bare sync() died on a
    not-null violation — every rule authored in the wizard with a branch
    ticked. Stamped by hand, the way ProgramForm already does for
    program_products.
    Co-Authored-By: 's avatarClaude Opus 5 (1M context) <noreply@anthropic.com>
    cc9d0d65
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...