Platform Audit - January 2, 2026
Complete technical review for ChatGPT/external audit
Current Stripe key type: UNKNOWN
Required Actions:
- Check Base44 Secrets → STRIPE_SECRET_KEY
- ✅ SAFE if starts with: sk_test_
- 🚨 LIVE if starts with: sk_live_
- Check VITE_STRIPE_PUBLISHABLE_KEY (pk_test_ vs pk_live_)
- Verify Stripe Dashboard shows "Viewing test data"
- Test checkout with card 4242 4242 4242 4242 (must succeed)
DO NOT switch to live keys until:
- • Monthly subscription confirmation modal tested
- • 28-day cancellation tested with Stripe webhooks
- • One-off vs membership billing verified
- • Full regression test passes
Tech Stack
- • Frontend: React 18, TypeScript, Tailwind
- • Backend: Base44 BaaS, Deno Deploy
- • Payments: Stripe Connect
- • Auth: Base44 built-in
User Types
- • Facility Owners (venue management)
- • Clients (riders/trainers)
- • Admins (platform oversight)
1. Monthly Membership Subscriptions
- Flow: User → SubscriptionConfirmationModal (blocks!) → Stripe subscription
- Billing: Recurring monthly charge
- Cancellation: 28-day notice required
- Notice Period: Billing continues, access retained
- After 28 Days: Automatic stop, no further charges
- Stripe Method: Set `cancel_at` timestamp on subscription
2. One-Off Bookings (Pay-Per-Session)
- Flow: User → OneOffBookingFlow → Stripe Checkout (PaymentIntent)
- Billing: Single charge only
- No Subscription: No recurring charges
- Cancellation: Follows facility refund policy
- Stripe Method: One-time PaymentIntent
Critical Distinctions:
| Aspect | Membership | One-Off |
|---|---|---|
| Payment Type | Subscription | PaymentIntent |
| Recurring? | Yes (monthly) | No |
| Booking Billing | Covered (no charge) | Per-booking charge |
| Cancellation | 28-day notice | Facility policy |
Facility
Venue listings with configuration
- • opening_hours - Enforced for all bookings (day + time)
- • min_notice_cancel_minutes (default: 120)
- • min_notice_reschedule_minutes (default: 120)
- • min_notice_extend_minutes (default: 30)
- • timezone - For peak/off-peak calculation
FacilityResource
Bookable spaces (arenas, solariums, etc.)
- • resource_id - REQUIRED for all bookings
- • Can override facility-level cutoff windows
- • Used for availability and conflict detection
MembershipTier
Offering definitions (membership OR one-off)
- • offering_type: "membership" or "one_off"
- • payment_type: "monthly" or "one_off"
- • hours_per_week - Weekly allowance (membership)
- • price_per_booking - One-time price (one-off)
- • duration_minutes - Session length (one-off)
ClientMembership
User's active subscription
- • status: active, cancelling, cancelled
- • stripe_subscription_id - Links to Stripe
- • cancellation_requested_at - Cancel initiation
- • effective_end_date - After 28-day notice
- • subscription_confirmed_at - User accepted terms
Booking
Individual booking records
- • billing_type: "covered_by_subscription" or "pay_per_booking"
- • resource_id - REQUIRED (space being booked)
- • payment_status: paid, pending, not_applicable
- • stripe_payment_intent_id - One-off bookings only
Booking Validation
- ✓ Must be in future
- ✓ Must be within facility opening hours (day + time)
- ✓ Cannot overlap existing bookings on same resource
- ✓ Cannot overlap blocked periods
- ✓ Membership: weekly allowance enforced
- ✓ Membership: time band restrictions enforced
Booking Actions (Cutoff Windows)
- Cancel: min_notice_cancel_minutes before start (default: 2h)
- Reschedule: min_notice_reschedule_minutes before start (default: 2h)
- Extend: min_notice_extend_minutes before end (default: 30min)
- • Space-level settings override facility defaults
- • Enforced server-side with specific error codes
Opening Hours Enforcement (NEW)
- ✓ Extend: validates against closing time
- ✓ Reschedule: validates against opening/closing times
- ✓ Create Booking: validates day + time range
- ✓ Returns specific error messages
- ✓ Checks if facility closed on booking day
28-Day Cancellation Notice
- • SubscriptionConfirmationModal blocks subscription without acceptance
- • Clear messaging about 28-day notice requirement
- • Stripe cancel_at set on cancellation
- • Webhook handles automatic cancellation after notice period
- • Billing continues during notice, stops after 28 days
Opening Hours Enforcement
- • extendBooking validates against closing time
- • rescheduleBooking validates against opening hours
- • Specific error messages returned
- • Checks if facility closed on booking day
My Bookings Tab Intelligence
- • Smart default: shows Confirmed if any exist
- • Falls back to Pending, then Past
- • Remembers URL tab parameter
One-Off Booking Clarity
- • Clear badges throughout UI
- • "ONE-OFF" label vs "MEMBERSHIP"
- • Copy consistent across all pages
- • Payment type clearly distinguished
Cutoff Window UX
- • Buttons disabled if outside window
- • Tooltips show required notice
- • Server validates and returns specific errors
- • User-friendly error messages
Manual Testing Required
Critical flows need end-to-end validation before production:
Priority Test Cases:
- ❌Monthly subscription creation with confirmation modal
- ❌28-day cancellation with Stripe webhook verification
- ❌One-off booking payment (single charge, no subscription)
- ❌Booking actions within/outside cutoff windows
- ❌Opening hours enforcement (extend/reschedule)
- ❌Weekly allowance tracking across week boundaries
Critical (Blocking Launch)
- Stripe payment mode verified (test keys confirmed)
- Test card checkout working (4242... succeeds)
- Zero payments in Stripe Live mode
- Subscription confirmation modal tested
- 28-day cancellation tested with webhooks
- One-off payment flow tested end-to-end
High Priority
- Opening hours enforcement verified
- Cutoff windows tested (cancel/reschedule/extend)
- Error messages user-friendly and specific
- My Bookings tab logic tested
- Copy consistency verified
Overall Readiness Score
(Pending Stripe mode confirmation)
Recommendation:
Platform is structurally ready for launch. Complete Stripe mode verification and critical flow testing, then proceed to production.