Products System
The Products system manages travel packages across multiple markets with localized content and dynamic flight configuration.
Architecture
Section titled “Architecture”The primary entry point is a Tour (SupplierTour), which owns a ProductTemplate 1:1. Tours are created and managed under Suppliers > Tours. Publishing a tour to a market creates a ProductByMarket.
SupplierTour (Entry Point — Suppliers > Tours) │ ├── ProductTemplate (1:1 — Master Content) │ ├── defines trip identity: route, itinerary, duration │ └── source locale content (en_US, es_ES, etc.) │ ├── SupplierTourItinerary[] (hotel/activity/transfer assignments per day) │ └── "Publish to Market" action creates: │ └── ProductByMarket (Market-Specific) │ ├── market assignment (ES, DE, etc.) ├── locale selection (es_ES, ca_ES) ├── flight search configuration │ ├── ProductByMarketTranslation (Translated Content) │ └── localized title, description, itinerary │ └── ProductByMarketFlightConfig (Flight Routes) └── ProductByMarketFlightLeg (Individual Legs)When to Use Each Entity
Section titled “When to Use Each Entity”| Entity | Purpose |
|---|---|
| SupplierTour | Create and manage a trip (wizard creates ProductTemplate + service assignments) |
| ProductTemplate | Master content definition (managed through Tour, not standalone) |
| ProductByMarket | Configure HOW a trip is sold in a specific market |
| ProductByMarketTranslation | Localized content for display |
| ProductByMarketFlightConfig | Departure airport and route configuration |
| ProductByMarketFlightLeg | Individual flight segments |
Key Relationships
Section titled “Key Relationships”SupplierTour owns a ProductTemplate 1:1. The Tour wizard creates both simultaneously. ProductByMarket creates market-specific versions of the template. Each ProductByMarket can have multiple translations (one per locale) and multiple flight configurations (one per departure airport).
Source: backend/app/Models/SupplierTour.php, backend/app/Models/ProductTemplate.php, backend/app/Models/ProductByMarket.php
SKU Formats
Section titled “SKU Formats”| Entity | Format | Example |
|---|---|---|
| ProductTemplate | <ID>-<DAYS> | 138-10 |
| ProductByMarket | <MARKET>-<ID>-<DAYS>-<LANG><VERSION> | ES-138-10-ES1 |
SKUs are auto-generated based on template ID, duration, market, and language.
Test Data Generation
Section titled “Test Data Generation”products:generate
Section titled “products:generate”Generate test product templates with itineraries, market translations, and flight configurations.
# Interactive mode./vendor/bin/sail artisan products:generate
# Non-interactive./vendor/bin/sail artisan products:generate \ --templates=5 --markets=ES --per-market=1Options:
| Option | Default | Description |
|---|---|---|
--templates | interactive | Number of product templates to create |
--markets=* | interactive | Market codes (e.g., ES, UK) |
--per-market | interactive | Products per market per template |
--route-type | multi_city | Flight config type (multi_city or separate) |
--use-ai | off | Use AI for realistic product content |
--translate | off | Use AI translation for non-English locales |
Requires existing suppliers, airports, and markets from seeders (db:seed). Blocked from running in production.
Source: backend/app/Console/Commands/GenerateTestProducts.php
Related
Section titled “Related”- Product Templates - Base product definitions
- Products by Market - Market-specific configuration
- Admin Panel - Filament resource management
- Database Relationships - Entity relationship diagram