Core Concepts
Charter models the complete brokerage lifecycle from initial guest inquiry to confirmed embarkation without adding a single custom SQL table.
Brokerage & Booking Architecture
Section titled “Brokerage & Booking Architecture”flowchart TD
A["Fleet Source (entry: charteryachts OR page: scaffolded templates)"] --> B["FleetSearchService + YachtSubjectResolver"]
B --> C["AvailabilityEngine [check_in, check_out) + CharterWriteLock"]
B --> D["PricingEngine (Date Range > Monthly > Pro-Rata + Discounts + VAT + APA + Extras)"]
C --> E["BookingWorkflowService (Inquiry -> Option Hold -> Confirmed -> Milestones)"]
D --> E
E --> F["QuoteProposalRenderer (HMAC-SHA256 Branded / Unbranded /_charter/proposal/{token})"]
E --> G["ExpireCharterHoldsTask (*/15 * * * *) + CharterNotifier (WireMail)"]
1. Dual-Source Fleet (entry, page, or none)
Section titled “1. Dual-Source Fleet (entry, page, or none)”Configure fleet_source in Charter Settings -> Fleet Source Bridge:
entry(default): Manage yachts directly insideCharter’scharter-yachtsEntriescollection.page: Keep yachts as native ProcessWirePageobjects and attachCharter’s 5 composable@fieldset:charter-*embedded fields (specs,cabins,amenities,rates,operations) usingphp vendor/bin/wire charter:scaffold:page.YachtSubjectResolver&CharterYachtResource(charter_yacht): Transparently normalizeentry:<uuid>andpage:<id>references across search, pricing, rates matrix, inquiries, and bookings.
2. Pricing Precedence & Fail-Closed FX
Section titled “2. Pricing Precedence & Fail-Closed FX”PricingEngine::calculate() evaluates exact Money minor-unit math in strict precedence order:
- Date Range rate (exact yearless window match in
RecurringRateCalendar) - Monthly rate (yearless month match)
- Pro-Rata daily/hourly math (using
pro_rata_divisor:7nights or6days) - Discounts (stackable vs. non-stackable competition capped at
max_discount_percent) - VAT override chain -> APA (
0%automatically forBareboat) -> Extras (WithBookingvs.AtBase) - Fail-Closed FX (
CurrencyConverter): Converts viaCurrencywithapplySpread: trueand throwsWireExceptionif an FX rate is missing rather than silently returning1.0.
3. Half-Open Availability & Multi-Dialect Locks
Section titled “3. Half-Open Availability & Multi-Dialect Locks”AvailabilityEngine checks [check_in, check_out) intervals so a yacht disembarking at 09:00 and embarking at 17:00 on the same Saturday never falsely conflicts. Every booking save acquires a DB-name-scoped advisory lock via CharterWriteLock (GET_LOCK on MySQL/MariaDB, pg_advisory_xact_lock on PostgreSQL, serialized transaction on SQLite).
4. Redacted HMAC Proposals (QuoteProposalRenderer)
Section titled “4. Redacted HMAC Proposals (QuoteProposalRenderer)”Share links (/_charter/proposal/{token}) are signed with HKDF-SHA256 derived from $config->userAuthSalt (Charter:proposal-signing-v1). Private operational fields (internal_notes, commission_percent, owner_name, owner_contact, captain_*, private_notes) are never rendered, and unbranded proposals (branded: false) strip agency branding and client details for broker-to-broker forwarding.