Commit Graph

31 Commits

Author SHA1 Message Date
Nyan Lin Paing da9cd9bbe0 add sms sending feat 2026-08-23 20:44:52 +07:00
Nyan Lin Paing 41c9454334 modify booking response data 2026-08-23 14:51:10 +07:00
Nyan Lin Paing fa908cdcaf add notes/remark and refactor round-trip
PHP Tests / php-tests (push) Has been cancelled
2026-08-22 21:43:41 +07:00
Nyan Lin Paing 894352b43f fix ci/cd testing failure
PHP Tests / php-tests (push) Successful in 4m42s
2026-08-20 20:49:28 +07:00
Nyan Lin Paing 1aeb57f130 Update .env.example
PHP Tests / php-tests (push) Failing after 4m0s
2026-08-20 20:23:48 +07:00
Nyan Lin Paing 6be47aa35a Update tests.yml
PHP Tests / php-tests (push) Failing after 4m18s
2026-08-20 00:27:47 +07:00
Nyan Lin Paing 79f7f50706 Update tests.yml
PHP Tests / php-tests (push) Failing after 2m51s
2026-08-20 00:20:08 +07:00
Nyan Lin Paing 54b35ee087 Update tests.yml
PHP Tests / php-tests (push) Has been cancelled
2026-08-20 00:08:33 +07:00
Nyan Lin Paing dfffdd343b fix ci/cd test pipeline
PHP Tests / php-tests (push) Has been cancelled
2026-08-20 00:01:28 +07:00
Nyan Lin Paing a9124ccb8d Update BookingInfolist.php
PHP Tests / php-tests (push) Failing after 3m21s
2026-08-19 23:06:45 +07:00
Nyan Lin Paing 5c215b4647 add admin noti email feat
PHP Tests / php-tests (push) Failing after 3m20s
2026-08-19 21:43:00 +07:00
Nyan Lin Paing 532f2ddf99 fix kbz payment success payload
PHP Tests / php-tests (push) Failing after 3m6s
2026-08-18 11:54:34 +07:00
Nyan Lin Paing c3a6f6cc6e composer update
PHP Tests / php-tests (push) Failing after 4m12s
2026-08-17 23:24:31 +07:00
Nyan Lin Paing 2fdfc0040c fix composer.json
PHP Tests / php-tests (push) Failing after 6m39s
2026-08-17 22:30:26 +07:00
Nyan Lin Paing 8d74ac74cd fix dashboard and apis
PHP Tests / php-tests (push) Failing after 9m1s
2026-08-16 23:50:39 +07:00
Nyan Lin Paing 60413bdebf Phase 7 dashboard widgets, Gitea CI, and branded landing page (T7.1)
- BookingsTodayWidget, RecentBookingsTableWidget (Booking module) and
  RevenueChartWidget, PaymentFailureRateWidget (Payment module) dashboard
  widgets, auto-registered via each plugin's existing discoverWidgets().
- .gitea/workflows/tests.yml: Postgres-backed Pest run on push/PR.
- Landing page (resources/views/welcome.blade.php) now shows the Famous
  Linnyone4 EV logo with a single admin login link, and the Filament admin
  panel uses the same logo as its brand logo.
2026-08-10 00:15:19 +07:00
Nyan Lin Paing d528cf16ec Merge branch 'feature/phase6-security-ops-hardening'
Phase 6 hardening (rate limiting, audit logging, JSON error envelope,
agent-ability audit, log viewer), Access group admin surfaces (Staff/
Customer/Role management, env-backed App Settings), booking soft deletes
with delete/restore actions, and a refund-flow crash fix for soft-deleted
bookings.
2026-08-09 23:23:50 +07:00
Nyan Lin Paing fd3a195453 Add Access group admin surfaces, booking soft deletes, refund crash fix
Access group (Filament):
- StaffResource: manage users with an admin-tier role, gated by manage_staff
- CustomerResource: read-only view of role-less users, gated by view_customers
- RoleResource: edit permissions per role (fixed role set), gated by manage_roles
- ManageAppSettings: tabbed General/Booking settings page that reads/writes
  real .env keys via new EnvFileWriter (no parallel DB settings table, so
  BookingService/config('booking.*') stay unchanged)
- Moved Access above Catalog in the nav group order
- New permissions: manage_staff, manage_roles, view_customers, manage_settings

Booking soft deletes:
- bookings.deleted_at + SoftDeletes on the Booking model
- BookingPolicy::delete (manage_bookings, cancelled/expired only) and
  ::restore (manage_bookings)
- DeleteBookingTableAction/RestoreBookingTableAction + TrashedFilter on
  BookingsTable, using authorize() so the policy is enforced at call time,
  not just cosmetically hidden

Refund crash fix:
- ProcessRefundAction passed a nullable $payment->booking into
  RefundBookingAction's non-nullable Booking param — a soft-deleted
  booking's payment reaching the refund picker was an uncaught TypeError.
  Excluded such payments from the picker and added a defensive guard.
- Same unguarded $event->payment->booking / $event->refund->payment->booking
  pattern fixed in the MarkBookingPaid/MarkBookingRefunded queued listeners.

289 tests passing.
2026-08-09 23:21:11 +07:00
Nyan Lin Paing 46f9b8d5a3 Phase 6: security & ops hardening (T6.1-T6.5)
- T6.1: named rate limiters (api-read/api-write/api-auth/api-webhooks),
  applied per module route group with tighter limits on booking/payment
  writes and the KBZ webhook than read-only catalog/routing endpoints.
- T6.2: install spatie/laravel-activitylog; LogsActivity on Booking/
  Payment/Refund status transitions and catalog/pricing admin CRUD
  (EvCompany, Destination, DepartureTimeSlot, EvRoute, RoutePricing).
  New IdentityPlugin with a read-only AuditLogResource gated by
  view_audit_log.
- T6.3: JSON error envelope for api/* in bootstrap/app.php (401/403/404/
  405/429/500 fallback), plus PaymentGatewayException (422 declined /
  502 unavailable).
- T6.4: feature tests proving the FastAPI agent token gets 403 on
  refund/cancel-not-owned and 405 (no write handler) on catalog/routing
  writes.
- T6.5: install gboquizosanchez/filament-log-viewer with a custom
  Filament admin theme (required for its views' Tailwind classes to
  compile), LOG_CHANNEL/FILAMENT_LOG_VIEWER_DRIVER=daily, registered
  under Operations in the sidebar.

252 tests passing.
2026-08-09 20:59:00 +07:00
Nyan Lin Paing e2e7902307 Merge branch 'feature/payment-module-phase5' 2026-08-09 16:25:26 +07:00
Nyan Lin Paing d19a14a45e Complete Payment module: initiate/webhook/confirm/refund actions, Filament resources (T5.8-T5.13)
- InitiatePaymentAction + POST /api/v1/payments/{booking}/initiate
- Generic KBZ webhook (POST /api/v1/webhooks/{method}/{encryptBookingId?}),
  signature verification per KBZ's real callback spec, PaymentGatewayInterface::handleWebhook()
- ConfirmPaymentAction: idempotent confirmation, PaymentCompleted/PaymentFailed events,
  MarkBookingPaid listener
- RefundBookingAction + POST /api/v1/bookings/{booking}/refund: partial refunds validated
  against remaining balance, RefundProcessed event, MarkBookingRefunded listener
- CancelBookingAction now refunds confirmed bookings instead of rejecting; BookingPolicy::cancel
  requires process_refunds for confirmed bookings
- PaymentPlugin + PaymentResource/RefundResource Filament admin UI (read-only payments,
  refund list + Process action)
- Booking detail page now shows related payments
- Fix CACHE_STORE mismatch (database -> redis) so tagged route caching works
- CLAUDE.md: never run migrate:fresh/migrate:refresh/db:wipe on dev without being asked
2026-08-09 16:20:21 +07:00
Nyan Lin Paing 4737838021 Add Payment module: contracts, payments/refunds tables, KBZ gateway, factory, orchestrator (T5.1-T5.7)
- T5.1 PaymentGatewayInterface, DTOs, PaymentMethod/PaymentStatus/RefundStatus enums
- T5.2 payments/refunds tables, models, factories
- T5.3-T5.5 KbzMiniAppGateway: initiate()/verify()/refund(), ported KBZ signing scheme,
  wired refund_amount through for partial refunds, mTLS options for refund
- T5.6 PaymentGatewayFactory resolving gateways by PaymentMethod
- T5.7 PaymentService orchestrator delegating to the resolved gateway
2026-08-08 22:42:16 +07:00
Nyan Lin Paing e0bcc5f81a Merge branch 'feature/booking-module-phase4' 2026-08-08 21:47:11 +07:00
Nyan Lin Paing 5b68f4fa38 Add Booking module: model, create/read/cancel API, Filament resource (T4.1-T4.7)
- Booking model with booking_vehicle_options line items (supports mixing
  vehicle options like front_seat + back_seat in one booking), price
  snapshot, status machine, and driver/car assignment fields
- BookingService: front-seat max, disabled-option toggles, duplicate-option
  and whole-vehicle-exclusivity guards
- CreateBookingAction, CancelBookingAction, AssignDriverAction
- BookingRefGenerator: sequential EVB-AAAAA1-style refs via row lock
- POST/GET/cancel booking API endpoints (Sanctum, ownership + admin policy)
- BookingPlugin + Filament BookingResource: list, detail view, Cancel and
  Assign Driver actions (shared between table and detail page)
- domain.md updated for multi-vehicle-option bookings (§2) and driver/
  vehicle assignment (§5a)
2026-08-08 21:43:15 +07:00
Nyan Lin Paing 4da9ecfe7d Add Routing module: EvRoute, pricing, time slots, read API, caching (T3.1-T3.7)
Implements Phase 3 in full: EvRoute model with company/destination relations
and a from/to-must-differ guard; the ev_route_time_slots pivot; RoutePricing
with a per-route is_blocked flag (every route auto-manages exactly one price
row per vehicle option via a fixed-row Filament repeater on both create and
edit); PricingService::quote() with a shared VehicleOption enum; RoutingPlugin
with the EvRouteResource admin UI (activation gated on non-blocked options
being priced); the /api/v1/routes read API (list/show/pricing/time-slots,
AI-agent-friendly nested shape); and Redis-tag-based response caching
invalidated via EvRoute/RoutePricing observers.
2026-08-06 23:49:42 +07:00
Nyan Lin Paing 7872105f2f Add Departure Time Slot and Catalog read API (T2.4, T2.5)
Adds the shared DepartureTimeSlot catalog entity with its Filament
resource, and public GET /api/v1/companies + /api/v1/destinations
endpoints (auth:sanctum + throttled) for the mini app/mobile/agent
clients to consume.
2026-08-06 21:18:52 +07:00
Nyan Lin Paing bf5d2c676a Add Destination resource (T2.2)
Migration/model/factory for destinations (name, mm_name, region,
description fields, geo coordinates, is_active, popular) plus its
Filament resource.
2026-08-05 22:45:56 +07:00
Nyan Lin Paing 6039d25c6d Add CatalogPlugin scaffold and EvCompany resource (T2.0, T2.1)
Registers CatalogPlugin with the admin panel so catalog Filament
resources auto-discover, and adds the EvCompany model/migration/
factory plus its Filament resource (auto-generated slug on create).
2026-08-05 22:43:34 +07:00
Nyan Lin Paing 17dd5acd23 Add Phase 1 Identity & Access module (roles, tokens, panel auth, policies)
Implements T1.1-T1.4: Spatie role/permission seeding, Sanctum token
issuance for customer channels and the FastAPI agent (with an
ability-exact-match middleware to tell them apart), Filament admin
panel access restricted to admin-tier roles with the navigation group
order, and skeleton BookingPolicy/RoutePolicy gated on the seeded
permissions ahead of their models landing in later phases.
2026-08-05 00:27:41 +07:00
Nyan Lin Paing cfa5aed15c add necessary package and setup 2026-08-04 22:23:54 +07:00
Nyan Lin Paing 09c5603ff8 project initialize 2026-08-04 21:40:49 +07:00