@voyant-travel/availability 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,316 @@
1
+ DO $$ BEGIN
2
+ CREATE TYPE "public"."availability_slot_status" AS ENUM('open', 'closed', 'sold_out', 'cancelled');
3
+ EXCEPTION WHEN duplicate_object THEN null;
4
+ END $$;--> statement-breakpoint
5
+ DO $$ BEGIN
6
+ CREATE TYPE "public"."meeting_mode" AS ENUM('meeting_only', 'pickup_only', 'meet_or_pickup');
7
+ EXCEPTION WHEN duplicate_object THEN null;
8
+ END $$;--> statement-breakpoint
9
+ DO $$ BEGIN
10
+ CREATE TYPE "public"."pickup_group_kind" AS ENUM('pickup', 'dropoff', 'meeting');
11
+ EXCEPTION WHEN duplicate_object THEN null;
12
+ END $$;--> statement-breakpoint
13
+ DO $$ BEGIN
14
+ CREATE TYPE "public"."pickup_timing_mode" AS ENUM('fixed_time', 'offset_from_start');
15
+ EXCEPTION WHEN duplicate_object THEN null;
16
+ END $$;--> statement-breakpoint
17
+ CREATE TABLE "allocation_audit_log" (
18
+ "id" text PRIMARY KEY NOT NULL,
19
+ "slot_id" text NOT NULL,
20
+ "action" text NOT NULL,
21
+ "actor_id" text,
22
+ "traveler_id" text,
23
+ "resource_id" text,
24
+ "before" jsonb,
25
+ "after" jsonb,
26
+ "created_at" timestamp with time zone DEFAULT now() NOT NULL
27
+ );
28
+ --> statement-breakpoint
29
+ CREATE TABLE "allocation_resources" (
30
+ "id" text PRIMARY KEY NOT NULL,
31
+ "slot_id" text NOT NULL,
32
+ "kind" text NOT NULL,
33
+ "ref_type" text,
34
+ "ref_id" text,
35
+ "label" text,
36
+ "capacity" integer NOT NULL,
37
+ "flags" jsonb DEFAULT '{}'::jsonb NOT NULL,
38
+ "parent_id" text,
39
+ "sort_order" integer DEFAULT 0 NOT NULL,
40
+ "created_at" timestamp with time zone DEFAULT now() NOT NULL,
41
+ "updated_at" timestamp with time zone DEFAULT now() NOT NULL
42
+ );
43
+ --> statement-breakpoint
44
+ CREATE TABLE "availability_closeouts" (
45
+ "id" text PRIMARY KEY NOT NULL,
46
+ "product_id" text NOT NULL,
47
+ "slot_id" text,
48
+ "date_local" date NOT NULL,
49
+ "reason" text,
50
+ "created_by" text,
51
+ "created_at" timestamp with time zone DEFAULT now() NOT NULL
52
+ );
53
+ --> statement-breakpoint
54
+ CREATE TABLE "availability_rules" (
55
+ "id" text PRIMARY KEY NOT NULL,
56
+ "product_id" text NOT NULL,
57
+ "option_id" text,
58
+ "facility_id" text,
59
+ "timezone" text NOT NULL,
60
+ "recurrence_rule" text NOT NULL,
61
+ "max_capacity" integer NOT NULL,
62
+ "max_pickup_capacity" integer,
63
+ "min_total_pax" integer,
64
+ "cutoff_minutes" integer,
65
+ "early_booking_limit_minutes" integer,
66
+ "active" boolean DEFAULT true NOT NULL,
67
+ "created_at" timestamp with time zone DEFAULT now() NOT NULL,
68
+ "updated_at" timestamp with time zone DEFAULT now() NOT NULL
69
+ );
70
+ --> statement-breakpoint
71
+ CREATE TABLE "availability_slots" (
72
+ "id" text PRIMARY KEY NOT NULL,
73
+ "product_id" text NOT NULL,
74
+ "itinerary_id" text,
75
+ "option_id" text,
76
+ "facility_id" text,
77
+ "availability_rule_id" text,
78
+ "start_time_id" text,
79
+ "date_local" date NOT NULL,
80
+ "starts_at" timestamp with time zone NOT NULL,
81
+ "ends_at" timestamp with time zone,
82
+ "timezone" text NOT NULL,
83
+ "status" "availability_slot_status" DEFAULT 'open' NOT NULL,
84
+ "unlimited" boolean DEFAULT false NOT NULL,
85
+ "initial_pax" integer,
86
+ "remaining_pax" integer,
87
+ "initial_pickups" integer,
88
+ "remaining_pickups" integer,
89
+ "remaining_resources" integer,
90
+ "past_cutoff" boolean DEFAULT false NOT NULL,
91
+ "too_early" boolean DEFAULT false NOT NULL,
92
+ "nights" integer,
93
+ "days" integer,
94
+ "notes" text,
95
+ "created_at" timestamp with time zone DEFAULT now() NOT NULL,
96
+ "updated_at" timestamp with time zone DEFAULT now() NOT NULL
97
+ );
98
+ --> statement-breakpoint
99
+ CREATE TABLE "availability_start_times" (
100
+ "id" text PRIMARY KEY NOT NULL,
101
+ "product_id" text NOT NULL,
102
+ "option_id" text,
103
+ "facility_id" text,
104
+ "label" text,
105
+ "start_time_local" text NOT NULL,
106
+ "duration_minutes" integer,
107
+ "sort_order" integer DEFAULT 0 NOT NULL,
108
+ "active" boolean DEFAULT true NOT NULL,
109
+ "created_at" timestamp with time zone DEFAULT now() NOT NULL,
110
+ "updated_at" timestamp with time zone DEFAULT now() NOT NULL
111
+ );
112
+ --> statement-breakpoint
113
+ CREATE TABLE "product_option_resource_templates" (
114
+ "id" text PRIMARY KEY NOT NULL,
115
+ "product_option_id" text NOT NULL,
116
+ "kind" text NOT NULL,
117
+ "ref_type" text,
118
+ "ref_id" text,
119
+ "capacity" integer NOT NULL,
120
+ "name_pattern" text NOT NULL,
121
+ "layout" text,
122
+ "default_count" integer,
123
+ "flags" jsonb DEFAULT '{}'::jsonb NOT NULL,
124
+ "created_at" timestamp with time zone DEFAULT now() NOT NULL,
125
+ "updated_at" timestamp with time zone DEFAULT now() NOT NULL
126
+ );
127
+ --> statement-breakpoint
128
+ CREATE TABLE "sharing_group_labels" (
129
+ "group_id" text PRIMARY KEY NOT NULL,
130
+ "label" text NOT NULL,
131
+ "created_at" timestamp with time zone DEFAULT now() NOT NULL,
132
+ "updated_at" timestamp with time zone DEFAULT now() NOT NULL
133
+ );
134
+ --> statement-breakpoint
135
+ CREATE TABLE "availability_holds" (
136
+ "id" text PRIMARY KEY NOT NULL,
137
+ "draft_id" text NOT NULL,
138
+ "hold_token" text NOT NULL,
139
+ "product_id" text NOT NULL,
140
+ "slot_id" text NOT NULL,
141
+ "pax_count" integer NOT NULL,
142
+ "expires_at" timestamp with time zone NOT NULL,
143
+ "released_at" timestamp with time zone,
144
+ "created_at" timestamp with time zone DEFAULT now() NOT NULL,
145
+ "updated_at" timestamp with time zone DEFAULT now() NOT NULL
146
+ );
147
+ --> statement-breakpoint
148
+ CREATE TABLE "availability_pickup_points" (
149
+ "id" text PRIMARY KEY NOT NULL,
150
+ "product_id" text NOT NULL,
151
+ "facility_id" text,
152
+ "name" text NOT NULL,
153
+ "description" text,
154
+ "location_text" text,
155
+ "active" boolean DEFAULT true NOT NULL,
156
+ "created_at" timestamp with time zone DEFAULT now() NOT NULL,
157
+ "updated_at" timestamp with time zone DEFAULT now() NOT NULL
158
+ );
159
+ --> statement-breakpoint
160
+ CREATE TABLE "availability_slot_pickups" (
161
+ "id" text PRIMARY KEY NOT NULL,
162
+ "slot_id" text NOT NULL,
163
+ "pickup_point_id" text NOT NULL,
164
+ "initial_capacity" integer,
165
+ "remaining_capacity" integer,
166
+ "created_at" timestamp with time zone DEFAULT now() NOT NULL,
167
+ "updated_at" timestamp with time zone DEFAULT now() NOT NULL
168
+ );
169
+ --> statement-breakpoint
170
+ CREATE TABLE "custom_pickup_areas" (
171
+ "id" text PRIMARY KEY NOT NULL,
172
+ "meeting_config_id" text NOT NULL,
173
+ "name" text NOT NULL,
174
+ "description" text,
175
+ "geographic_text" text,
176
+ "active" boolean DEFAULT true NOT NULL,
177
+ "created_at" timestamp with time zone DEFAULT now() NOT NULL,
178
+ "updated_at" timestamp with time zone DEFAULT now() NOT NULL
179
+ );
180
+ --> statement-breakpoint
181
+ CREATE TABLE "location_pickup_times" (
182
+ "id" text PRIMARY KEY NOT NULL,
183
+ "pickup_location_id" text NOT NULL,
184
+ "slot_id" text,
185
+ "start_time_id" text,
186
+ "timing_mode" "pickup_timing_mode" DEFAULT 'fixed_time' NOT NULL,
187
+ "local_time" text,
188
+ "offset_minutes" integer,
189
+ "instructions" text,
190
+ "initial_capacity" integer,
191
+ "remaining_capacity" integer,
192
+ "active" boolean DEFAULT true NOT NULL,
193
+ "created_at" timestamp with time zone DEFAULT now() NOT NULL,
194
+ "updated_at" timestamp with time zone DEFAULT now() NOT NULL
195
+ );
196
+ --> statement-breakpoint
197
+ CREATE TABLE "pickup_groups" (
198
+ "id" text PRIMARY KEY NOT NULL,
199
+ "meeting_config_id" text NOT NULL,
200
+ "kind" "pickup_group_kind" NOT NULL,
201
+ "name" text NOT NULL,
202
+ "description" text,
203
+ "active" boolean DEFAULT true NOT NULL,
204
+ "sort_order" integer DEFAULT 0 NOT NULL,
205
+ "created_at" timestamp with time zone DEFAULT now() NOT NULL,
206
+ "updated_at" timestamp with time zone DEFAULT now() NOT NULL
207
+ );
208
+ --> statement-breakpoint
209
+ CREATE TABLE "pickup_locations" (
210
+ "id" text PRIMARY KEY NOT NULL,
211
+ "group_id" text NOT NULL,
212
+ "facility_id" text,
213
+ "name" text NOT NULL,
214
+ "description" text,
215
+ "location_text" text,
216
+ "lead_time_minutes" integer,
217
+ "active" boolean DEFAULT true NOT NULL,
218
+ "sort_order" integer DEFAULT 0 NOT NULL,
219
+ "created_at" timestamp with time zone DEFAULT now() NOT NULL,
220
+ "updated_at" timestamp with time zone DEFAULT now() NOT NULL
221
+ );
222
+ --> statement-breakpoint
223
+ CREATE TABLE "product_meeting_configs" (
224
+ "id" text PRIMARY KEY NOT NULL,
225
+ "product_id" text NOT NULL,
226
+ "option_id" text,
227
+ "facility_id" text,
228
+ "mode" "meeting_mode" DEFAULT 'meeting_only' NOT NULL,
229
+ "allow_custom_pickup" boolean DEFAULT false NOT NULL,
230
+ "allow_custom_dropoff" boolean DEFAULT false NOT NULL,
231
+ "requires_pickup_selection" boolean DEFAULT false NOT NULL,
232
+ "requires_dropoff_selection" boolean DEFAULT false NOT NULL,
233
+ "use_pickup_allotment" boolean DEFAULT false NOT NULL,
234
+ "meeting_instructions" text,
235
+ "pickup_instructions" text,
236
+ "dropoff_instructions" text,
237
+ "active" boolean DEFAULT true NOT NULL,
238
+ "created_at" timestamp with time zone DEFAULT now() NOT NULL,
239
+ "updated_at" timestamp with time zone DEFAULT now() NOT NULL
240
+ );
241
+ --> statement-breakpoint
242
+ ALTER TABLE "allocation_audit_log" ADD CONSTRAINT "allocation_audit_log_slot_id_availability_slots_id_fk" FOREIGN KEY ("slot_id") REFERENCES "public"."availability_slots"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
243
+ ALTER TABLE "allocation_resources" ADD CONSTRAINT "allocation_resources_slot_id_availability_slots_id_fk" FOREIGN KEY ("slot_id") REFERENCES "public"."availability_slots"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
244
+ ALTER TABLE "availability_closeouts" ADD CONSTRAINT "availability_closeouts_slot_id_availability_slots_id_fk" FOREIGN KEY ("slot_id") REFERENCES "public"."availability_slots"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
245
+ ALTER TABLE "availability_slots" ADD CONSTRAINT "availability_slots_availability_rule_id_availability_rules_id_fk" FOREIGN KEY ("availability_rule_id") REFERENCES "public"."availability_rules"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
246
+ ALTER TABLE "availability_slots" ADD CONSTRAINT "availability_slots_start_time_id_availability_start_times_id_fk" FOREIGN KEY ("start_time_id") REFERENCES "public"."availability_start_times"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
247
+ ALTER TABLE "availability_holds" ADD CONSTRAINT "availability_holds_slot_id_availability_slots_id_fk" FOREIGN KEY ("slot_id") REFERENCES "public"."availability_slots"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
248
+ ALTER TABLE "availability_slot_pickups" ADD CONSTRAINT "availability_slot_pickups_slot_id_availability_slots_id_fk" FOREIGN KEY ("slot_id") REFERENCES "public"."availability_slots"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
249
+ ALTER TABLE "availability_slot_pickups" ADD CONSTRAINT "availability_slot_pickups_pickup_point_id_availability_pickup_points_id_fk" FOREIGN KEY ("pickup_point_id") REFERENCES "public"."availability_pickup_points"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
250
+ ALTER TABLE "custom_pickup_areas" ADD CONSTRAINT "custom_pickup_areas_meeting_config_id_product_meeting_configs_id_fk" FOREIGN KEY ("meeting_config_id") REFERENCES "public"."product_meeting_configs"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
251
+ ALTER TABLE "location_pickup_times" ADD CONSTRAINT "location_pickup_times_pickup_location_id_pickup_locations_id_fk" FOREIGN KEY ("pickup_location_id") REFERENCES "public"."pickup_locations"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
252
+ ALTER TABLE "location_pickup_times" ADD CONSTRAINT "location_pickup_times_slot_id_availability_slots_id_fk" FOREIGN KEY ("slot_id") REFERENCES "public"."availability_slots"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
253
+ ALTER TABLE "location_pickup_times" ADD CONSTRAINT "location_pickup_times_start_time_id_availability_start_times_id_fk" FOREIGN KEY ("start_time_id") REFERENCES "public"."availability_start_times"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
254
+ ALTER TABLE "pickup_groups" ADD CONSTRAINT "pickup_groups_meeting_config_id_product_meeting_configs_id_fk" FOREIGN KEY ("meeting_config_id") REFERENCES "public"."product_meeting_configs"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
255
+ ALTER TABLE "pickup_locations" ADD CONSTRAINT "pickup_locations_group_id_pickup_groups_id_fk" FOREIGN KEY ("group_id") REFERENCES "public"."pickup_groups"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
256
+ CREATE INDEX "idx_allocation_audit_slot_created" ON "allocation_audit_log" USING btree ("slot_id","created_at");--> statement-breakpoint
257
+ CREATE INDEX "idx_allocation_audit_traveler" ON "allocation_audit_log" USING btree ("traveler_id");--> statement-breakpoint
258
+ CREATE INDEX "idx_allocation_resources_slot_kind" ON "allocation_resources" USING btree ("slot_id","kind");--> statement-breakpoint
259
+ CREATE INDEX "idx_allocation_resources_parent" ON "allocation_resources" USING btree ("parent_id");--> statement-breakpoint
260
+ CREATE INDEX "idx_allocation_resources_kind_sort" ON "allocation_resources" USING btree ("kind","sort_order","created_at");--> statement-breakpoint
261
+ CREATE INDEX "idx_availability_closeouts_product_created" ON "availability_closeouts" USING btree ("product_id","created_at");--> statement-breakpoint
262
+ CREATE INDEX "idx_availability_closeouts_slot_created" ON "availability_closeouts" USING btree ("slot_id","created_at");--> statement-breakpoint
263
+ CREATE INDEX "idx_availability_closeouts_date_created" ON "availability_closeouts" USING btree ("date_local","created_at");--> statement-breakpoint
264
+ CREATE INDEX "idx_availability_rules_updated" ON "availability_rules" USING btree ("updated_at");--> statement-breakpoint
265
+ CREATE INDEX "idx_availability_rules_product_updated" ON "availability_rules" USING btree ("product_id","updated_at");--> statement-breakpoint
266
+ CREATE INDEX "idx_availability_rules_option_updated" ON "availability_rules" USING btree ("option_id","updated_at");--> statement-breakpoint
267
+ CREATE INDEX "idx_availability_rules_facility_updated" ON "availability_rules" USING btree ("facility_id","updated_at");--> statement-breakpoint
268
+ CREATE INDEX "idx_availability_rules_active_updated" ON "availability_rules" USING btree ("active","updated_at");--> statement-breakpoint
269
+ CREATE INDEX "idx_availability_slots_product_starts_at" ON "availability_slots" USING btree ("product_id","starts_at");--> statement-breakpoint
270
+ CREATE INDEX "idx_availability_slots_itinerary_starts_at" ON "availability_slots" USING btree ("itinerary_id","starts_at");--> statement-breakpoint
271
+ CREATE INDEX "idx_availability_slots_option_starts_at" ON "availability_slots" USING btree ("option_id","starts_at");--> statement-breakpoint
272
+ CREATE INDEX "idx_availability_slots_facility_starts_at" ON "availability_slots" USING btree ("facility_id","starts_at");--> statement-breakpoint
273
+ CREATE INDEX "idx_availability_slots_rule_starts_at" ON "availability_slots" USING btree ("availability_rule_id","starts_at");--> statement-breakpoint
274
+ CREATE INDEX "idx_availability_slots_start_time_starts_at" ON "availability_slots" USING btree ("start_time_id","starts_at");--> statement-breakpoint
275
+ CREATE INDEX "idx_availability_slots_date_starts_at" ON "availability_slots" USING btree ("date_local","starts_at");--> statement-breakpoint
276
+ CREATE INDEX "idx_availability_slots_status_starts_at" ON "availability_slots" USING btree ("status","starts_at");--> statement-breakpoint
277
+ CREATE INDEX "idx_availability_slots_starts_at" ON "availability_slots" USING btree ("starts_at");--> statement-breakpoint
278
+ CREATE INDEX "idx_availability_start_times_product_sort_created" ON "availability_start_times" USING btree ("product_id","sort_order","created_at");--> statement-breakpoint
279
+ CREATE INDEX "idx_availability_start_times_option_sort_created" ON "availability_start_times" USING btree ("option_id","sort_order","created_at");--> statement-breakpoint
280
+ CREATE INDEX "idx_availability_start_times_facility_sort_created" ON "availability_start_times" USING btree ("facility_id","sort_order","created_at");--> statement-breakpoint
281
+ CREATE INDEX "idx_availability_start_times_active_sort_created" ON "availability_start_times" USING btree ("active","sort_order","created_at");--> statement-breakpoint
282
+ CREATE UNIQUE INDEX "idx_product_option_resource_templates_option_kind" ON "product_option_resource_templates" USING btree ("product_option_id","kind",coalesce("ref_id", ''));--> statement-breakpoint
283
+ CREATE INDEX "idx_product_option_resource_templates_kind" ON "product_option_resource_templates" USING btree ("kind","created_at");--> statement-breakpoint
284
+ CREATE INDEX "idx_availability_holds_slot" ON "availability_holds" USING btree ("slot_id");--> statement-breakpoint
285
+ CREATE INDEX "idx_availability_holds_draft" ON "availability_holds" USING btree ("draft_id");--> statement-breakpoint
286
+ CREATE INDEX "idx_availability_holds_token" ON "availability_holds" USING btree ("hold_token");--> statement-breakpoint
287
+ CREATE INDEX "idx_availability_holds_expires" ON "availability_holds" USING btree ("expires_at");--> statement-breakpoint
288
+ CREATE INDEX "idx_availability_pickup_points_created" ON "availability_pickup_points" USING btree ("created_at");--> statement-breakpoint
289
+ CREATE INDEX "idx_availability_pickup_points_product_created" ON "availability_pickup_points" USING btree ("product_id","created_at");--> statement-breakpoint
290
+ CREATE INDEX "idx_availability_pickup_points_facility_created" ON "availability_pickup_points" USING btree ("facility_id","created_at");--> statement-breakpoint
291
+ CREATE INDEX "idx_availability_pickup_points_active_created" ON "availability_pickup_points" USING btree ("active","created_at");--> statement-breakpoint
292
+ CREATE INDEX "idx_availability_slot_pickups_created" ON "availability_slot_pickups" USING btree ("created_at");--> statement-breakpoint
293
+ CREATE INDEX "idx_availability_slot_pickups_slot_created" ON "availability_slot_pickups" USING btree ("slot_id","created_at");--> statement-breakpoint
294
+ CREATE INDEX "idx_availability_slot_pickups_pickup_point_created" ON "availability_slot_pickups" USING btree ("pickup_point_id","created_at");--> statement-breakpoint
295
+ CREATE INDEX "idx_custom_pickup_areas_created" ON "custom_pickup_areas" USING btree ("created_at");--> statement-breakpoint
296
+ CREATE INDEX "idx_custom_pickup_areas_meeting_config_created" ON "custom_pickup_areas" USING btree ("meeting_config_id","created_at");--> statement-breakpoint
297
+ CREATE INDEX "idx_custom_pickup_areas_active_created" ON "custom_pickup_areas" USING btree ("active","created_at");--> statement-breakpoint
298
+ CREATE INDEX "idx_location_pickup_times_created" ON "location_pickup_times" USING btree ("created_at");--> statement-breakpoint
299
+ CREATE INDEX "idx_location_pickup_times_pickup_location_created" ON "location_pickup_times" USING btree ("pickup_location_id","created_at");--> statement-breakpoint
300
+ CREATE INDEX "idx_location_pickup_times_slot_created" ON "location_pickup_times" USING btree ("slot_id","created_at");--> statement-breakpoint
301
+ CREATE INDEX "idx_location_pickup_times_start_time_created" ON "location_pickup_times" USING btree ("start_time_id","created_at");--> statement-breakpoint
302
+ CREATE INDEX "idx_location_pickup_times_active_created" ON "location_pickup_times" USING btree ("active","created_at");--> statement-breakpoint
303
+ CREATE INDEX "idx_pickup_groups_sort_created" ON "pickup_groups" USING btree ("sort_order","created_at");--> statement-breakpoint
304
+ CREATE INDEX "idx_pickup_groups_meeting_config_sort_created" ON "pickup_groups" USING btree ("meeting_config_id","sort_order","created_at");--> statement-breakpoint
305
+ CREATE INDEX "idx_pickup_groups_kind_sort_created" ON "pickup_groups" USING btree ("kind","sort_order","created_at");--> statement-breakpoint
306
+ CREATE INDEX "idx_pickup_groups_active_sort_created" ON "pickup_groups" USING btree ("active","sort_order","created_at");--> statement-breakpoint
307
+ CREATE INDEX "idx_pickup_locations_sort_created" ON "pickup_locations" USING btree ("sort_order","created_at");--> statement-breakpoint
308
+ CREATE INDEX "idx_pickup_locations_group_sort_created" ON "pickup_locations" USING btree ("group_id","sort_order","created_at");--> statement-breakpoint
309
+ CREATE INDEX "idx_pickup_locations_facility_sort_created" ON "pickup_locations" USING btree ("facility_id","sort_order","created_at");--> statement-breakpoint
310
+ CREATE INDEX "idx_pickup_locations_active_sort_created" ON "pickup_locations" USING btree ("active","sort_order","created_at");--> statement-breakpoint
311
+ CREATE INDEX "idx_product_meeting_configs_updated" ON "product_meeting_configs" USING btree ("updated_at");--> statement-breakpoint
312
+ CREATE INDEX "idx_product_meeting_configs_product_updated" ON "product_meeting_configs" USING btree ("product_id","updated_at");--> statement-breakpoint
313
+ CREATE INDEX "idx_product_meeting_configs_option_updated" ON "product_meeting_configs" USING btree ("option_id","updated_at");--> statement-breakpoint
314
+ CREATE INDEX "idx_product_meeting_configs_facility_updated" ON "product_meeting_configs" USING btree ("facility_id","updated_at");--> statement-breakpoint
315
+ CREATE INDEX "idx_product_meeting_configs_mode_updated" ON "product_meeting_configs" USING btree ("mode","updated_at");--> statement-breakpoint
316
+ CREATE INDEX "idx_product_meeting_configs_active_updated" ON "product_meeting_configs" USING btree ("active","updated_at");
@@ -0,0 +1,13 @@
1
+ {
2
+ "version": "7",
3
+ "dialect": "postgresql",
4
+ "entries": [
5
+ {
6
+ "idx": 0,
7
+ "version": "7",
8
+ "when": 1781954969333,
9
+ "tag": "0000_availability_baseline",
10
+ "breakpoints": true
11
+ }
12
+ ]
13
+ }
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@voyant-travel/availability",
3
+ "version": "0.0.0",
4
+ "description": "Availability domain schema — bookable slots, rules, start times, holds, pickups and capacity. The foundational owner consumed by bookings, operations and accommodations.",
5
+ "license": "Apache-2.0",
6
+ "type": "module",
7
+ "exports": {
8
+ ".": "./src/index.ts",
9
+ "./schema": "./src/schema.ts"
10
+ },
11
+ "voyant": {
12
+ "schema": "./schema",
13
+ "requiresSchemas": [
14
+ "@voyant-travel/db"
15
+ ]
16
+ },
17
+ "scripts": {
18
+ "typecheck": "tsc --noEmit",
19
+ "lint": "biome check src/",
20
+ "test": "vitest run --passWithNoTests",
21
+ "build": "tsc -p tsconfig.json",
22
+ "clean": "rm -rf dist tsconfig.tsbuildinfo",
23
+ "prepack": "pnpm run build",
24
+ "db:generate": "drizzle-kit generate --config=drizzle.migrations.config.ts --name=availability_baseline && node ../../scripts/d2/guard-create-type.mjs ./migrations && node ../../scripts/d2/ensure-extensions.mjs ./migrations"
25
+ },
26
+ "dependencies": {
27
+ "@voyant-travel/db": "workspace:^",
28
+ "drizzle-orm": "^0.45.2"
29
+ },
30
+ "devDependencies": {
31
+ "@voyant-travel/voyant-typescript-config": "workspace:^",
32
+ "drizzle-kit": "^0.31.10",
33
+ "typescript": "^6.0.2",
34
+ "vitest": "^4.1.2"
35
+ },
36
+ "files": [
37
+ "dist",
38
+ "migrations/*.sql",
39
+ "migrations/meta/_journal.json"
40
+ ],
41
+ "publishConfig": {
42
+ "access": "public",
43
+ "main": "./dist/index.js",
44
+ "types": "./dist/index.d.ts",
45
+ "exports": {
46
+ ".": {
47
+ "types": "./dist/index.d.ts",
48
+ "import": "./dist/index.js",
49
+ "default": "./dist/index.js"
50
+ },
51
+ "./schema": {
52
+ "types": "./dist/schema.d.ts",
53
+ "import": "./dist/schema.js",
54
+ "default": "./dist/schema.js"
55
+ }
56
+ }
57
+ },
58
+ "repository": {
59
+ "type": "git",
60
+ "url": "https://github.com/voyant-travel/voyant.git",
61
+ "directory": "packages/availability"
62
+ }
63
+ }