• 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
..
AccountSettlementTest.php Loading commit data...
AdminScreensSmokeTest.php Loading commit data...
BranchIsolationTest.php Loading commit data...
BranchLockRedirectTest.php Loading commit data...
BranchScopedComponentDataTest.php Loading commit data...
BranchScopedScreensTest.php Loading commit data...
BranchTerminologyTest.php Loading commit data...
BranchValidationRulesTest.php Loading commit data...
BundleObligationTest.php Loading commit data...
BundledProductPaymentTest.php Loading commit data...
CheckInScanTest.php Loading commit data...
DashboardQueriesRespectBranchTest.php Loading commit data...
DiscountAndBranchScreensRenderTest.php Loading commit data...
ErrorPageDisclosureTest.php Loading commit data...
ExpenseReceiptTest.php Loading commit data...
FinancialTopProgramsQueryTest.php Loading commit data...
GenerateRenewalInvoicesTest.php Loading commit data...
GroupRosterAndPosRenderTest.php Loading commit data...
MobileApiRemovedTest.php Loading commit data...
PaymentLedgerTest.php Loading commit data...
PaymentProofTest.php Loading commit data...
PortalAccessibilityTest.php Loading commit data...
PortalBrandContrastTest.php Loading commit data...
PortalSmokeTest.php Loading commit data...
PricingSurvivesBranchScopeTest.php Loading commit data...
ProgramScheduleTest.php Loading commit data...
SelfRegistrationTest.php Loading commit data...
ServiceRequestEffectTest.php Loading commit data...
SessionProrationTest.php Loading commit data...
SettlementScreensRenderTest.php Loading commit data...
SubscriptionCycleFigureTest.php Loading commit data...
TemporaryUploadMetadataOrderTest.php Loading commit data...
UploadLimitsTest.php Loading commit data...