#!/usr/bin/env php === X.1.2: Gala-Order Happy Path Integration Tests === Database: globalgala_2026_dev Event ID: 1 Mock Order Count: 50 Cleaning up previous test data... Done. ✓ Test 1: Feature flag enables Gala domain reading ✓ Test 2: GalaReadInterface returns Event data ✗ Test 3: GalaReadInterface returns capacity summary → Total: 1420, Available: 376, Expected: 1341 ✗ Test 4: Create 50 mock orders reading Gala pricing → SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-c58a3923-b340-4d3f-bf4d-44635f022fe4-' for key 'unique_active_event_seat' (SQL: insert into `seat_reservations` (`event_id`, `seat_id`, `session_id`, `order_id`, `status`, `hold_token`, `price_snapshot`, `currency`, `include_booking_fee`, `include_tax`, `updated_at`, `created_at`) values (1, c58a3923-b340-4d3f-bf4d-44635f022fe4, X12_TEST_7bbd578e-bf24-4f43-9637-b395910eaba9, 833, booked, 866af60c-d776-47fb-8205-f275d3e7ffc0, 1000, GBP, 1, 1, 2026-05-14 02:41:37, 2026-05-14 02:41:37)) ✗ Test 5: Availability calculated correctly (1341 - 50 = 1291) → Sold: 1044, Available: 376, Expected Available: 1291 ✗ Test 6: Payment status fields captured correctly → Count: 1, StatusPaid: 1, PaymentPaid: 1 ✓ Test 7: Order status separate from Gala status ✗ Test 8: GalaAvailabilityService counts sold seats → Sold: 1044, Expected: 50 === Test Cleanup === Test data cleaned up. === Test Summary === Passed: 3 Failed: 5 Total: 8