Phase 1 · Audit
What the booking platform already does, what it only appears to do, and what genuinely is not there — read from the code rather than from the screens.
Most of this brief is already built. The platform has a real CRM, real email marketing with open and click tracking, real consent handling, Square payments with webhook verification, and two-way calendar sync. Rebuilding any of that would be throwing away working code.
What it does not have is the loyalty layer, the waitlist, staff scheduling, and a second and third payment provider. Those are genuinely absent — not broken, not stubbed, absent.
The audit also turned up one thing that needed fixing before anything else, so I fixed it.
Severity · high · now closed
The platform has had four staff roles since staff accounts were added —
super-admin, manager,
customer-service, read-only. They were
stored on the account and shown in the admin screen. They were enforced in exactly one
file: admin-users.php, which keeps staff management to an owner.
Every other protected endpoint called Auth::require_(), which asks two
questions: is there a session, and did this write carry its form token. Neither is a
question about the role.
So an account created as read-only could do nearly anything. I proved it before changing a line. Signed in as read-only, against a real server:
The admin screen hid those buttons. A hidden button is not a permission; it is a
suggestion that anyone with developer tools or curl can decline.
One permission map now lives in Auth.php, readable in one screen, and every
guarded endpoint asks it. A refusal names the role you are signed in as and the role the
action needs, so staff are not left guessing.
| Action | Owner | Manager | Customer service | Read-only |
|---|---|---|---|---|
| See the studio's screens | yes | yes | yes | yes |
| Create and edit customers | yes | yes | yes | no |
| Delete, purge or bulk-import customers | yes | yes | no | no |
| Send a campaign to the list | yes | yes | no | no |
| Chase a payment, run the backfill | yes | yes | yes | no |
| Attach or correct a payment | yes | no | no | no |
| Change Square, Microsoft or Twilio credentials | yes | no | no | no |
| Add or remove staff | yes | no | no | no |
A session opened with the studio passcode keeps full authority. It is the way back in if an owner is locked out, and it is already what the staff screen treats it as. The narrowing applies to named staff accounts, which is where the problem was.
Pinned by tests/permissions.php, 24 assertions. Removing the
check turns 11 of them red.
Read from the code. built means working and under test. partial means real but incomplete. absent means there is nothing there.
js/ and api/ tree.All three are worth building and they share one piece of groundwork, which is why I would do them together rather than scattered across phases.
1 · Lifetime value
Needs a customer value rollup: total spent, bookings, average value, last visit, computed from the bookings table rather than stored and left to drift. The imported CSV baseline stays separate and labelled, as it is now — a figure from your spreadsheet and a figure this platform earned are different claims.
Honest caveat on "estimated future revenue". With a few bookings per client, any projection is arithmetic dressed as a forecast. I would show observed cadence and spend, and label a projection as an estimate with its basis visible, or leave it out.
2 · Rebooking engine
Falls straight out of the same rollup: median gap between a client's bookings, then an invitation at a proportion of it. Needs a suppression rule so a client who already has a future booking is never invited, and it must obey the existing consent gate.
Worth doing after the rollup exists, not before.
3 · Membership levels
Today customers.type is binary: member or guest. Five tiers needs a real
column plus the rules that move people between them, and a decision from you: are tiers
earned from spend, granted by hand, or both?
Tiers that carry discounts also touch pricing, which is the one area where a mistake costs money on every booking. I would keep the first version to access and priority, and add discounts once the tier data has been right for a month.
The brief's own phasing is sound. I would reorder two things: permissions came first because it was open, and the loyalty layer comes earlier than Phase 7 because your three recommendations depend on it.
Closed today. 24 assertions.
Your three recommendations, built on one shared computation. Tier rules and the earned-versus-granted question need a decision from you first.one working session
Session packages, coupons, add-ons at checkout, gift certificates. Each is a table, an endpoint and a checkout hook. Coupons and add-ons touch pricing, so they want their own test suite before they touch a live total.substantial
Join, position, cancellation detection, timed claim link, and a lock so two people cannot claim one slot. The lock is the hard part and the reason this is its own phase.moderate
Working hours, availability, per-staff calendars, service assignment, and the wider role structure. Builds on the permission work.substantial
Stripe and PayPal server-side, tips, refunds issued from the platform, offline payments. Needs accounts and credentials from you before any of it can be tested.substantial, gated on accounts
Recurring billing is the highest-risk thing in the brief: it charges cards on a schedule with nobody watching. It goes last, after the single-charge path has been right for a while.substantial
Worth doing once the events it would show exist, rather than building a centre that reports three kinds of thing.moderate
Every claim of "built" above means there is a suite behind it that runs against a real PHP server and a real browser. Nothing is counted as working because a screen looks right.
| Area | Suite | Assertions |
|---|---|---|
| Staff permissions | permissions.php | 24 |
| Booking workflow end to end | booking-flow.php | 65 |
| Consent and A2P compliance | consent.php | 173 |
| CRM and imports | customers.php | 165 |
| Reminders and the payment chase | reminders.php | 108 |
| Email composition and sending | email-compose.php | 89 |
| Everything else | 43 further suites | 1,623 |
2,247 assertions in total. Each fix made during this audit was checked by reverting it and confirming the suite goes red — a test that passes either way is decoration.