Ashby Bowl main website integration ================================= The booking system now reads: - kitchen opening/closing rules from the main website database - confirmed future party bookings from the main website database Default database assumptions ---------------------------- The two databases are on the same MySQL host. By default the integration uses: - the booking system's existing DB host/user/password - main website database name: ashbybowlwebsite If the booking DB user cannot read the main website DB, define these constants in booking-system config.php (or equivalent environment variables): MAIN_SITE_DB_HOST / ASHBY_MAIN_DB_HOST MAIN_SITE_DB_NAME / ASHBY_MAIN_DB_NAME MAIN_SITE_DB_USER / ASHBY_MAIN_DB_USER MAIN_SITE_DB_PASS / ASHBY_MAIN_DB_PASS A dedicated read-only user for the main website DB is recommended. It needs SELECT access to opening_times, school_holidays and party_bookings. Booking database migration -------------------------- Manage Events / Event Settings attempt the small schema upgrade automatically. If ALTER/CREATE permissions are not available, run: database/add-main-site-integration.sql Party allocation rule --------------------- A confirmed main-site party reserves the FIRST HOUR of its party time slot. Pair preference is strictly: 1) Lane 1 + Lane 2 2) Lane 11 + Lane 12 No other lanes are selected automatically. If neither pair is free, the lane calendar shows a warning requiring staff attention. Party title format: Party: Child Name - X People Changes to child name, people, date/time, and cancellation are pulled from the main website. Sync is keyed by party_bookings.id so rerunning it does not create duplicate lane reservations. Optional cron ------------- The calendar and public availability endpoints already pull party changes before they display/sell lanes. For an additional background poll while nobody is using the booking system, run scripts/sync-main-site.php from cron (for example once a minute) using the PHP CLI path appropriate to the VPS. Party lane allocation --------------------- Manage Lanes now stores the primary and backup party lane pairs in the booking database. The defaults remain Lane 1 + Lane 2, then Lane 11 + Lane 12 when those lane names exist. If neither configured pair is free, Admin/Controller can allocate any two free lanes from Manage Lanes. If automatic schema creation is not permitted, run database/add-party-lane-allocation.sql.