/** * Push-booking request — when a booking commits locally on a syndicated * owned product, the channel push pipeline calls `pushBooking` for each * `(booking_item, channel)` pair so the upstream knows the inventory is * allocated. Idempotent on `idempotencyKey`. * * See `docs/architecture/channel-push-architecture.md` §4. */ export interface PushBookingRequest { /** * Stable idempotency key generated by the engine. Same key on retries * for the same `(booking_id, booking_item_id, channel_id)` triple — the * adapter is expected to either return the cached upstream reference or * succeed without creating a duplicate booking upstream. */ idempotencyKey: string; /** The Voyant booking id (typeid). */ bookingId: string; /** Optional booking-item id when the link is item-scoped (multi-line). */ bookingItemId?: string; /** External product reference resolved from `channel_product_mappings`. */ externalProductId: string; externalRateId?: string; externalCategoryId?: string; /** Channel id for diagnostics. */ channelId: string; /** * Per-channel commercial parameters from `channel_contracts.policy`. * The plane treats this as opaque; the adapter knows what it expects. */ contractPolicy?: Record; /** Vertical-specific payload — booking shape (party, dates, pax, etc). */ payload: Record; } export interface PushBookingResult { /** Upstream reference for subsequent ops (modify, cancel) on the same booking. */ upstreamRef: string; /** Optional human-readable upstream identifier (e.g. confirmation code). */ externalReference?: string; /** Upstream-reported status. */ externalStatus?: string; /** * Opaque echo of the upstream payload — stored on the * `channel_booking_links` row for diagnostics/drift detection. */ upstreamPayload?: Record; } /** * Push-availability request — fired when an owned product's slot remaining * pax changes. Idempotent on `(slotId, remainingPax)`. See §5. */ export interface PushAvailabilityRequest { channelId: string; externalProductId: string; externalRateId?: string; externalCategoryId?: string; slotId: string; productId: string; optionId?: string; startsAt: Date | string; remainingPax: number; /** "booking" | "cancel" | "manual" | "refresh" — diagnostic origin. */ source: string; } export interface PushAvailabilityResult { /** Upstream-reported status (some channels echo "ok"/"updated"/etc.). */ externalStatus?: string; upstreamPayload?: Record; } /** * Push-content request — fired when an owned product's content (description, * itinerary, media, etc.) changes. Idempotent on the `contentHash`. See §6. */ export interface PushContentRequest { channelId: string; externalProductId: string; productId: string; /** * SHA-256 of canonical-JSON(content). The adapter (and ideally the * upstream) use this to skip no-op pushes. */ contentHash: string; /** Vertical-specific content payload — product-shaped. */ content: unknown; /** Schema version of the `content` payload (mirrors GetContentResult). */ contentSchemaVersion?: string; /** Locale of the content payload (BCP 47). */ locale?: string; } export interface PushContentResult { /** Upstream-reported status. */ externalStatus?: string; upstreamPayload?: Record; /** * The content hash the upstream now considers current. Usually echoes * `request.contentHash`; differs when the upstream coerced the payload * (rare) — caller persists this so the next idempotency check uses * the upstream-side hash. */ acknowledgedHash?: string; }