• 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
..
Activities Loading commit data...
Admin Loading commit data...
Assignments Loading commit data...
Attendance Loading commit data...
Audit Loading commit data...
Auth Loading commit data...
Branches Loading commit data...
CashSessions Loading commit data...
Components Loading commit data...
Concerns Loading commit data...
Dashboard Loading commit data...
Documents Loading commit data...
Enrollments Loading commit data...
Evaluations Loading commit data...
Events Loading commit data...
Facilities Loading commit data...
Financial Loading commit data...
Groups Loading commit data...
Guardian Loading commit data...
HR Loading commit data...
Inventory Loading commit data...
Invoices Loading commit data...
Messaging Loading commit data...
Notifications Loading commit data...
POS Loading commit data...
Parent Loading commit data...
Participants Loading commit data...
People Loading commit data...
Portal Loading commit data...
Pricing Loading commit data...
Profile Loading commit data...
Programs Loading commit data...
Public Loading commit data...
Receptionist Loading commit data...
Reports Loading commit data...
Requests Loading commit data...
Roles Loading commit data...
Schedule Loading commit data...
Settings Loading commit data...
Trainer Loading commit data...
Training Loading commit data...
Users Loading commit data...
Wallets Loading commit data...
Website Loading commit data...
WhatsApp Loading commit data...
Wizards Loading commit data...
BranchSwitcher.php Loading commit data...
Dashboard.php Loading commit data...
GlobalSearch.php Loading commit data...