StartingCreditsAmount > 0 has Available credit rows in billing.SessionCreditCustomer the moment the purchase response returns.PlanCreditConfiguration / PlanCreditTrialConfiguration) and attaches it to the subscription DTO. Fpt.Standard/Services/FunnelService.cs:383-461SessionCreditService.CreateSubscriptionCreditConfiguration inline (wrapped non-fatal โ a credit failure never fails the payment). Fpt.PlatformBilling/Services/BillingService.cs:2074, 2278SubscriptionCreditConfiguration row (NextCreditProcessDate = FirstBillingDate)BuildStartingCredits() โ inserts one SessionCreditCustomer row per starting credit, Status=Available, expiry = now + ExpiredDays โ THIS IS THE ANSWERBuildCredits()) and advances the process date. Fpt.Services/Services/SessionCreditService.cs:143-169AllSubscriptionCredit where NextCreditProcessDate <= today) โ that's the only batch in this system, and it never gates the first booking.GrantCreditAmount > 0 gate skips starting-credits-only plans. Both create paths guard the entire credit block with CreditConfiguration != null && GrantCreditAmount > 0. A plan configured with starting credits but NO recurring grant (exactly the shape of a widget intro pack: "5 sessions, no renewal") gets zero credits written โ silent, non-fatal, invisible until the buyer can't book. Dev has 2 such configs today (1 in each config table, of 87+29); rare, but it's precisely the plan type the Booking Widget sells. Fix candidate (1-line, when #30016 starts): widen the gate to GrantCreditAmount > 0 || StartingCreditsAmount > 0 at BillingService.cs:2074 and :2278.KioskService) only demands credits when the class has IsSessionRulesActive = 1. Widget plan 205 (Trial 25) has no credit config; whether its buyer can book depends entirely on the selected classes' session-rules flag. Design implication for the builder: the SELL step should warn when a selected class enforces session rules but a selected plan grants no day-1 credits (this is the ClassStructureMembership coherence-warning gap we already parked, now with a concrete rule).| Scenario | Auto-book outcome |
|---|---|
| Class WITHOUT session rules | Book immediately โ no credit needed |
| Class WITH rules + plan has StartingCredits > 0 AND GrantCreditAmount > 0 | Book immediately โ credits written in the same request |
| Class WITH rules + plan has StartingCredits > 0 but GrantCreditAmount = 0 | FAILS today (landmine 1) โ 1-line gate fix required |
| Class WITH rules + plan has no credit config | Fails by design โ builder coherence warning should prevent this configuration |
| Future start date (challenge) | Starting credits still issue at purchase (BuildStartingCredits is unconditional inside the block); only the recurring grant waits for FirstBillingDate |
Bottom line: auto-book = purchase โ immediately call the existing booking path with the class instance the user tapped. No queues, no retries, no "we'll confirm your spot" fallback needed. Ship it with the gate fix + the builder warning.
SessionCreditCustomer / SubscriptionCreditConfiguration โ consistent with the trace.PlanCreditConfiguration 87 rows (68 starting+grant, 13 grant-only, 1 starting-only โ ) ยท PlanCreditTrialConfiguration 29 rows (26 starting+grant, 1 grant-only, 1 starting-only โ ).SourceId=1 (System), SubscriptionId = subscription RowId, note "Initial subscription credit generated today (โฆ)".