2 Commits

Author SHA1 Message Date
e75a233b36 ci: green test suite + GitHub Actions
Phase 0.10 — minimal CI. Stands the test suite up so the four feature
files written during Phase 0 actually run.

Test infrastructure:
  - phpunit.xml configured to use a separate aau_test MySQL database
    (NOT sqlite). The Phase 0.4b coupons.store_id-nullable migration
    uses raw ALTER TABLE MODIFY which sqlite cannot execute.
  - .env.testing checked in with localhost MySQL config and a fresh
    APP_KEY (NOT shared with production .env).
  - Local devs: create aau_test once, then
    `php artisan migrate --env=testing` and `php artisan test`.

GitHub Actions (.github/workflows/ci.yml):
  - PHP 8.1 + composer cache + MySQL 8.0 service container
  - Runs the same migrate/test commands as local.
  - Triggers on push to main / staging / claude and PRs against
    main / staging.

Test fixes that came out of bringing the suite up to green:
  - Three test files used Spatie role guard 'api' but User::$guard_name
    is 'web' — flipped to 'web'.
  - PricingServiceTest::makeProduct now creates the required Service
    + Variant FKs (products.service_id and variant_id are NOT NULL).
  - PricingServiceTest setUp seeds AppSetting.pick_to_delivery_gap.
  - OrderAuthorizationTest fixtures populate payment_status /
    payment_type (orders.payment_status is NOT NULL); use canonical
    enum values (Pending / Paid / Active / Monthly).
  - The expired-subscription test creates a Subscription parent before
    the StoreSubscription (subscription_id FK).
  - tests/Feature/ExampleTest now asserts the 302 redirect from the
    root path instead of an unrealistic 200.

Test result: 28 passed, 0 failed.

Phase 0 progress: 10/10. Phase 0.5 (Maya secret rotation) is the only
remaining item and is blocked on you rotating the live keys in the
Maya dashboard before I scrub them from the seeder + .env.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 12:42:58 +08:00
d5d3ae7762 Initial commit 2026-03-25 22:53:45 +08:00