Table of Contents#
Service Catalogue#
AI Services (Groq)#
enhance(string $content) — text enhancement with temperature 0.5; failures are logged and rethrown as a user-safe RuntimeException.
generateAi(AiTripRequest $request) — full itinerary synthesis from destination country, budget tier and interests.
AI review endpoints (AIController::review) feed trip JSON to the LLM for automated feedback.
Quota enforcement: every call routes through AiUsageService; counters live in Redis/cache and surface at GET /me/ai-quota. Rate limiting adds throttle:ai on top. Commerce & Payments#
| Concern | Implementation |
|---|
| Checkout entry | POST /payments/initiate → CheckoutController::initiate with InitiateCheckoutRequest |
| Strategy selection | CheckoutStrategyFactory: subscription, trip_package, trip_fork |
| Pricing | PriceCalculatorService (taxes/discounts, currency via Support/Enums/Currency) |
| Gateway | PaymobGateway implements PaymentGatewayInterface over PaymobClient |
| Webhooks | WebhookService verifies HMAC SHA-512 signature before order state transitions; routes excluded from CSRF (/payments/webhook, /paymob/webhook, /paymob-v1/webhook) |
| Subscriptions | PlanController subscribe/upgrade/cancel; expiry handled by command + tests (SubscriptionExpiryTest) |
| Agency marketplace | assignment approve/decline state machine with InvalidStateTransitionException guard |
Reporting Pipeline#
Default filter is "All Time" per product spec; seeded telemetry provides 60+ paid orders/payments so reports have data out of the box.Weather Service#
OpenMeteoService fetches current conditions per coordinate pair; WeatherController::show is double-protected by Redis response caching and throttle:weather. Abuse and cache behaviour covered by tests/Feature/System/WeatherAbuseTest and WeatherCacheTest.Fixture & Seeding Services#
app/Services/Catalog/Fixtures/* load deterministic datasets from database/seeders/fixtures/*.json — countries, cities, hotels, flights, restaurants, attractions — optionally geocoding through OpenStreetService. Console commands sync:fixtures and sync:cities refresh them without full reseeds.Jobs, Listeners, Mail, Notifications#
Jobs: GenerateReportJob, GeocodeDestinationJob.
Listeners: FulfillOrderListener (PaymentSucceeded → fulfilment + mails), HandlePaymentFailed.
Mail: 10 branded templates incl. PaymentSuccessMail, TripBookedMail, ReviewFlaggedMail, WelcomeMail.
Notifications: database channel mirrors each mail event (AppNotification base).
Console Commands#
| Command | Purpose |
|---|
seed:fresh | orchestrated fresh seed (SeedFresh.php) |
sync:fixtures / sync:cities | refresh fixture-driven catalog data |
expire:stale-orders / expire:stale-subscriptions / expire:password-tokens | scheduled housekeeping |
export:postman | generate Postman collection from routes (ExportPostman.php) |
Modified at 2026-08-25 22:41:45