import { z } from '@substrat-run/contracts'; /** * engine-booking's schemas — what it ACCEPTS and what it ANSWERS (#707/#865). * * The published projections were seven hand-written `export interface`s in * `index.ts`, and the operation inputs were a mix of exported schemas and inline * TypeScript types on each handler. Both moved here because `defineOperations` * declares an operation's `input` and `output` as schemas, and a TypeScript * interface cannot be one — the alternative was a zod schema beside each * interface saying the same thing twice, which is the two-descriptions defect * this engine already deleted once (see `reservationState` below). * * They live in their own file rather than in `operations.ts` for the reason * `entities.ts` does: `index.ts` needs them too, and a declaration file that * imports the implementation is the cycle the old `OPERATIONS` note described. * Nothing here imports `index.ts`, so the direction stays acyclic. * * Row versus published, the distinction `entities.ts` draws: a `ResourceRow` has * `active` as 0/1 and `created_at` in snake_case because SQLite has no boolean * and the column is what it is. `Resource` publishes `active: boolean` and * `createdAt`. The registry describes what is STORED; this describes what is * ANSWERED, and `toResource`/`toReservation` in `index.ts` are the one crossing. */ /** Parse to a canonical ISO instant, or refuse. */ export declare function toInstant(value: string): string; export declare const instantIn: z.ZodPipe>; /** * The reservation's states — **taken from the entity registry, not restated**. * * Moved here from `index.ts` unchanged. Reading the column's own schema keeps * storage and domain unable to disagree (#844). */ export declare const reservationState: z.ZodEnum<{ cancelled: "cancelled"; completed: "completed"; confirmed: "confirmed"; expired: "expired"; held: "held"; in_service: "in_service"; no_show: "no_show"; }>; export type ReservationState = z.infer; export declare const resource: z.ZodObject<{ id: z.ZodString; kind: z.ZodString; name: z.ZodString; capacity: z.ZodNumber; active: z.ZodBoolean; createdAt: z.ZodString; }, z.core.$strip>; export type Resource = z.infer; export declare const participant: z.ZodObject<{ id: z.ZodString; partyRef: z.ZodString; share: z.ZodNullable; currency: z.core.$ZodBranded; }, z.core.$strip>>; joinedAt: z.ZodString; leftAt: z.ZodNullable; }, z.core.$strip>; export type Participant = z.infer; export declare const reservation: z.ZodObject<{ id: z.ZodString; resourceId: z.ZodString; startsAt: z.ZodString; endsAt: z.ZodString; state: z.ZodEnum<{ cancelled: "cancelled"; completed: "completed"; confirmed: "confirmed"; expired: "expired"; held: "held"; in_service: "in_service"; no_show: "no_show"; }>; effectiveState: z.ZodEnum<{ cancelled: "cancelled"; completed: "completed"; confirmed: "confirmed"; expired: "expired"; held: "held"; in_service: "in_service"; no_show: "no_show"; }>; quantity: z.ZodNumber; expiresAt: z.ZodNullable; fillTarget: z.ZodNullable; note: z.ZodNullable; createdBy: z.ZodString; createdAt: z.ZodString; }, z.core.$strip>; export type Reservation = z.infer; export declare const freeInterval: z.ZodObject<{ startsAt: z.ZodString; endsAt: z.ZodString; available: z.ZodNumber; }, z.core.$strip>; export type FreeInterval = z.infer; /** * The instant an IN-SCOPE call judges expiry against — never on the wire (#961). * * `nowOr` prefers it over `ctx.now()`, which is exactly why no operation input * below carries it: a caller who could send `now` would confirm an expired hold * by back-dating it, or sweep someone's live hold by post-dating it — R6's ban on * ambient clocks re-opened through the input schema. The host parses each * declared input before the handler runs and a wire `now` is stripped with the * other undeclared keys, so an operation always judges against the operation's * own instant. * * A vertical composing the engine by call may still pass it, which is what keeps * lazy expiry testable and replayable at a chosen moment; so may a test, though * a `manualClock` on the host is the shape that exercises the wire path too. */ export declare const atInstant: z.ZodObject<{ now: z.ZodOptional; }, z.core.$strip>; /** Every reservation-scoped operation opens with this, and most add nothing. */ export declare const reservationIdIn: z.ZodObject<{ reservationId: z.ZodString; }, z.core.$strip>; export declare const createResourceInput: z.ZodObject<{ kind: z.ZodString; name: z.ZodString; capacity: z.ZodOptional; }, z.core.$strip>; export type CreateResourceInput = z.infer; export declare const setResourceActiveInput: z.ZodObject<{ resourceId: z.ZodString; active: z.ZodBoolean; }, z.core.$strip>; export type SetResourceActiveInput = z.infer; export declare const listResourcesInput: z.ZodObject<{ kind: z.ZodOptional; }, z.core.$strip>; export declare const holdReservationInput: z.ZodObject<{ resourceId: z.ZodString; startsAt: z.ZodPipe>; endsAt: z.ZodPipe>; expiresAt: z.ZodPipe>; quantity: z.ZodOptional; fillTarget: z.ZodOptional; note: z.ZodOptional; }, z.core.$strip>; /** What `holdReservation(ctx, …)` takes in scope: the wire input plus `now`. */ export declare const holdReservationCall: z.ZodObject<{ now: z.ZodOptional; resourceId: z.ZodString; startsAt: z.ZodPipe>; endsAt: z.ZodPipe>; expiresAt: z.ZodPipe>; quantity: z.ZodOptional; fillTarget: z.ZodOptional; note: z.ZodOptional; }, z.core.$strip>; export type HoldReservationInput = z.infer; export declare const joinReservationInput: z.ZodObject<{ reservationId: z.ZodString; partyRef: z.core.$ZodBranded; share: z.ZodOptional; currency: z.core.$ZodBranded; }, z.core.$strip>>; }, z.core.$strip>; /** What `joinReservation(ctx, …)` takes in scope: the wire input plus `now`. */ export declare const joinReservationCall: z.ZodObject<{ now: z.ZodOptional; reservationId: z.ZodString; partyRef: z.core.$ZodBranded; share: z.ZodOptional; currency: z.core.$ZodBranded; }, z.core.$strip>>; }, z.core.$strip>; export type JoinReservationInput = z.infer; export declare const leaveReservationInput: z.ZodObject<{ reservationId: z.ZodString; participantId: z.ZodString; }, z.core.$strip>; export declare const cancelReservationInput: z.ZodObject<{ reservationId: z.ZodString; reason: z.ZodOptional; }, z.core.$strip>; export declare const moveReservationInput: z.ZodObject<{ reservationId: z.ZodString; resourceId: z.ZodOptional; startsAt: z.ZodOptional>>; endsAt: z.ZodOptional>>; }, z.core.$strip>; /** What `moveReservation(ctx, …)` takes in scope: the wire input plus `now`. */ export declare const moveReservationCall: z.ZodObject<{ now: z.ZodOptional; reservationId: z.ZodString; resourceId: z.ZodOptional; startsAt: z.ZodOptional>>; endsAt: z.ZodOptional>>; }, z.core.$strip>; export type MoveReservationInput = z.infer; export declare const openReservationInput: z.ZodObject<{ reservationId: z.ZodString; fillTarget: z.ZodNullable; }, z.core.$strip>; /** * @deprecated Identical to `reservationIdIn` since `now` left the wire (#961); * kept so a caller that named it keeps compiling. */ export declare const reservationAtInput: z.ZodObject<{ reservationId: z.ZodString; }, z.core.$strip>; export declare const listReservationsInput: z.ZodObject<{ resourceId: z.ZodOptional; from: z.ZodOptional; to: z.ZodOptional; }, z.core.$strip>; export declare const availabilityInput: z.ZodObject<{ resourceId: z.ZodString; from: z.ZodString; to: z.ZodString; }, z.core.$strip>; //# sourceMappingURL=schemas.d.ts.map