Extend availability (durations, weekly recurrence, calendar); price offerings in dollars #17
Reference in New Issue
Block a user
Delete Branch "feature/availability-extensions"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements #2 (Availability) — durations, weekly-recurring windows, and a public agenda calendar — and slips in a requested change to price offerings in dollars (plus a
$wpdbformat bugfix found along the way).Availability (#2)
us_availabilitygainsoffering_id(nullable FK),duration_minutes(default 60),recurrence_group(nullable), with indexes.AvailabilitySlot: carries the new fields.AvailabilityRepository:createWeeklySeries()generates N weekly rows sharing arecurrence_group(= the first row's id);findAvailable()filters byoffering_idandduration_minutes.duration_minutes,offering_id,recurrence(single|weekly) +weeks.booking.jsrenders an agenda calendar (slots grouped by day, with duration). The richer booking UX (offering pick, questions, policy acceptance) lands with the booking-flow work (#3).Offering price in dollars
us_offerings.price_cents(INT) →price DECIMAL(10,2);Offeringusesfloat $price. Admin form and REST take dollars.Bugfix (pre-existing, from #10)
The Offering insert/update
$wpdbformat arrays were misaligned with the columns — e.g.billing_mode(a string) mapped to%d, which$wpdbcoerces to0, corrupting the stored value on a real insert. Replaced both with a single, correctly-alignedCOLUMN_FORMATSconstant. (Unit tests missed it because they assert the format arg viaMockery::type('array').)Notes
DateTimeImmutable::modify()because the CIno-debugregexdd\(matches->add(— worth giving that regex word boundaries later.--memory-limit=1Gin the lint script; 128M now crashes analysis as the codebase has grown.Verification
Rebased on current
main(includes the merged Policies #15).composer test(91 tests),composer lint,composer cs, and the no-debug check all pass.Refs #2
🤖 Generated with Claude Code