@updraft-solutions/mcrit-sdk 0.10.0 → 0.11.1
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.
- package/README.md +11 -25
- package/dist/{chunk-IDEPTVFF.cjs → chunk-HHQ7PFX2.cjs} +40 -28
- package/dist/{chunk-ZKXYKICY.js → chunk-VFCUI2TH.js} +40 -28
- package/dist/crew/index.d.cts +1 -1
- package/dist/crew/index.d.ts +1 -1
- package/dist/index.cjs +9 -5
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +25 -21
- package/dist/media/index.d.cts +2 -2
- package/dist/media/index.d.ts +2 -2
- package/dist/money/index.d.cts +5 -5
- package/dist/money/index.d.ts +5 -5
- package/dist/sanitize/index.d.cts +1 -1
- package/dist/sanitize/index.d.ts +1 -1
- package/dist/schemas/index.cjs +6 -2
- package/dist/schemas/index.d.cts +122 -123
- package/dist/schemas/index.d.ts +122 -123
- package/dist/schemas/index.js +9 -5
- package/dist/{training-DRuphnSP.d.cts → training-BNAGw2Te.d.cts} +17671 -17657
- package/dist/{training-DRuphnSP.d.ts → training-BNAGw2Te.d.ts} +17671 -17657
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.d.cts +137 -2
- package/dist/types/index.d.ts +137 -2
- package/dist/types/index.js +1 -1
- package/package.json +3 -2
- package/src/crew/index.ts +1 -1
- package/src/index.ts +18 -0
- package/src/media/index.ts +2 -2
- package/src/money/index.ts +4 -4
- package/src/sanitize/index.ts +1 -1
- package/src/schemas/common.ts +1 -1
- package/src/schemas/equipment.ts +1 -2
- package/src/schemas/form-template.ts +1 -1
- package/src/schemas/models.ts +51 -33
- package/src/schemas/training.ts +2 -2
- package/src/types/compliance.ts +1 -1
- package/src/types/index.ts +1 -0
- package/src/types/models.ts +1 -0
- package/src/types/operating-hours.ts +163 -0
- /package/dist/{chunk-2WJHTRIE.js → chunk-UV5JLKAL.js} +0 -0
- /package/dist/{chunk-DCEOET63.cjs → chunk-YVC6Q3YU.cjs} +0 -0
package/src/schemas/models.ts
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
zContactDTO,
|
|
10
10
|
zNullableBool,
|
|
11
11
|
zNetGross,
|
|
12
|
-
|
|
12
|
+
zMoneyObject,
|
|
13
13
|
} from "./common";
|
|
14
14
|
import { equipmentSchema } from "./equipment";
|
|
15
15
|
import { courseCheckSyllabusSchema } from "./training";
|
|
@@ -75,8 +75,8 @@ export const documentType = z.object({
|
|
|
75
75
|
|
|
76
76
|
export const priceSchema = z.object({
|
|
77
77
|
id: z.number(),
|
|
78
|
-
gross_total:
|
|
79
|
-
net_total:
|
|
78
|
+
gross_total: zMoneyObject,
|
|
79
|
+
net_total: zMoneyObject,
|
|
80
80
|
tax_percentage: z.number(),
|
|
81
81
|
valid_from: z.string(),
|
|
82
82
|
created_at: z.string(),
|
|
@@ -149,6 +149,10 @@ export const courseFeeSchema = feeSchema.extend({
|
|
|
149
149
|
is_initial_payment: z.boolean().optional(),
|
|
150
150
|
});
|
|
151
151
|
|
|
152
|
+
/** Fuel quantity unit as printed in the AFM/POH; per hour when used for `cruise_fuel_flow`. */
|
|
153
|
+
export const fuelUnitSchema = z.enum(["l", "usgal", "kg", "lb"]);
|
|
154
|
+
export type FuelUnit = z.infer<typeof fuelUnitSchema>;
|
|
155
|
+
|
|
152
156
|
export const airplaneSchema = BaseModel.extend({
|
|
153
157
|
type: z.literal("airplane"),
|
|
154
158
|
id: z.number(),
|
|
@@ -189,9 +193,6 @@ export const airplaneSchema = BaseModel.extend({
|
|
|
189
193
|
.optional(),
|
|
190
194
|
is_simulator: z.boolean().optional(),
|
|
191
195
|
category: z.string().nullable().optional(),
|
|
192
|
-
averageFuelConsumption: z.string().nullable().optional(),
|
|
193
|
-
weightUnitString: z.string().optional(),
|
|
194
|
-
fuelUnitString: z.string().optional(),
|
|
195
196
|
isoCountryCodeFromRegistration: z.string().optional(),
|
|
196
197
|
registrationWithoutSpecialChars: z.string().nullable().optional(),
|
|
197
198
|
equipmentCodes: z.array(z.string()).nullable().optional(),
|
|
@@ -221,6 +222,9 @@ export const airplaneSchema = BaseModel.extend({
|
|
|
221
222
|
max_takeoff_mass: z.string().optional(),
|
|
222
223
|
max_speed: z.string().optional(),
|
|
223
224
|
max_range: z.string().optional(),
|
|
225
|
+
// Cruise fuel-flow baseline (~75 % power / ISA; POH authoritative).
|
|
226
|
+
cruise_fuel_flow: z.number().nullable().optional(),
|
|
227
|
+
cruise_fuel_flow_unit: fuelUnitSchema.nullable().optional(),
|
|
224
228
|
equipment: z.array(equipmentSchema).optional(),
|
|
225
229
|
has_pre_paid_package: z.boolean().optional(),
|
|
226
230
|
logging_required_from: z.string().optional(),
|
|
@@ -446,7 +450,7 @@ export const bookingWaypointSchema = z.object({
|
|
|
446
450
|
});
|
|
447
451
|
|
|
448
452
|
/**
|
|
449
|
-
*
|
|
453
|
+
* Activity-log row (ActivityResource) — audit trail entries loaded on
|
|
450
454
|
* booking/invoice/event show payloads (`activities` relation).
|
|
451
455
|
*/
|
|
452
456
|
export const activitySchema = z.object({
|
|
@@ -736,7 +740,7 @@ export const allowedDocumentTypeSchema = z.object({
|
|
|
736
740
|
});
|
|
737
741
|
|
|
738
742
|
// Billing recipient (formerly "Address"; the `addresses` table was renamed
|
|
739
|
-
// to `billing_profiles` — see BillingProfileResource
|
|
743
|
+
// to `billing_profiles` — see BillingProfileResource). A membership/user
|
|
740
744
|
// can own several profiles (e.g. private vs. "Firma"); invoices, flight logs
|
|
741
745
|
// and expense items each point at one via `billing_profile_id`.
|
|
742
746
|
export const billingProfileSchema = z.object({
|
|
@@ -821,8 +825,8 @@ export const flightLogSchema = z.object({
|
|
|
821
825
|
arr_airport: airportSchema.optional(),
|
|
822
826
|
from: z.string().nullable().optional(),
|
|
823
827
|
to: z.string().nullable().optional(),
|
|
824
|
-
costs:
|
|
825
|
-
charge:
|
|
828
|
+
costs: zMoneyObject.nullable().optional(),
|
|
829
|
+
charge: zMoneyObject.nullable().optional(),
|
|
826
830
|
remarks: z.string().nullable().optional(),
|
|
827
831
|
created_at: z.string(),
|
|
828
832
|
updated_at: z.string(),
|
|
@@ -840,7 +844,7 @@ export const invoiceSchema = z.object({
|
|
|
840
844
|
title: z.string(),
|
|
841
845
|
membership_id: z.number(),
|
|
842
846
|
membership: baseMembershipSchema.optional(),
|
|
843
|
-
// InvoiceResource
|
|
847
|
+
// InvoiceResource always emits `billing_profile_id` (non-optional key,
|
|
844
848
|
// nullable FK value). `billingProfile` is a `whenLoaded('billingProfile')`
|
|
845
849
|
// relation, so it stays optional. (Fix round 1: as of the original Task 16
|
|
846
850
|
// commit, InvoiceResource hadn't gained `billing_profile_id` yet — it was
|
|
@@ -856,10 +860,10 @@ export const invoiceSchema = z.object({
|
|
|
856
860
|
due_date: z.string().nullable().optional(),
|
|
857
861
|
status: z.string().nullable().optional(),
|
|
858
862
|
paid_status: z.string().nullable().optional(),
|
|
859
|
-
total:
|
|
860
|
-
subtotal:
|
|
861
|
-
tax_amount:
|
|
862
|
-
discount_amount:
|
|
863
|
+
total: zMoneyObject.nullable().optional(),
|
|
864
|
+
subtotal: zMoneyObject.nullable().optional(),
|
|
865
|
+
tax_amount: zMoneyObject.nullable().optional(),
|
|
866
|
+
discount_amount: zMoneyObject.nullable().optional(),
|
|
863
867
|
paid_at: z.string().nullable().optional(),
|
|
864
868
|
released_at: z.string().nullable().optional(),
|
|
865
869
|
sent: z.number().default(0),
|
|
@@ -892,8 +896,8 @@ export const invoiceSchema = z.object({
|
|
|
892
896
|
issuer_vat_id: z.string().nullable().optional(),
|
|
893
897
|
issuer_register_court: z.string().nullable().optional(),
|
|
894
898
|
issuer_register_number: z.string().nullable().optional(),
|
|
895
|
-
gross_total:
|
|
896
|
-
net_total:
|
|
899
|
+
gross_total: zMoneyObject.nullable().optional(),
|
|
900
|
+
net_total: zMoneyObject.nullable().optional(),
|
|
897
901
|
// InvoiceResource media envelope: only the generated PDF.
|
|
898
902
|
media: z
|
|
899
903
|
.object({
|
|
@@ -945,7 +949,7 @@ export const expenseSchema = z.object({
|
|
|
945
949
|
membership: baseMembershipSchema.optional(),
|
|
946
950
|
title: z.string(),
|
|
947
951
|
description: z.string().nullable().optional(),
|
|
948
|
-
amount:
|
|
952
|
+
amount: zMoneyObject,
|
|
949
953
|
status: z.string().nullable().optional(),
|
|
950
954
|
expense_date: z.string().nullable().optional(),
|
|
951
955
|
invoice_id: z.number().nullable().optional(),
|
|
@@ -960,8 +964,7 @@ export const expenseSchema = z.object({
|
|
|
960
964
|
.optional(),
|
|
961
965
|
});
|
|
962
966
|
|
|
963
|
-
// Company-scoped tag (shared pool across taggable models
|
|
964
|
-
// m-crit-api docs/features/tags.md).
|
|
967
|
+
// Company-scoped tag (shared pool across taggable models).
|
|
965
968
|
export const tagSchema = z.object({
|
|
966
969
|
type: z.literal("tag").optional(),
|
|
967
970
|
id: z.number(),
|
|
@@ -979,7 +982,7 @@ export const courseSchema = z.object({
|
|
|
979
982
|
start_date: z.string().nullable().optional(),
|
|
980
983
|
end_date: z.string().nullable().optional(),
|
|
981
984
|
max_participants: z.number().nullable().optional(),
|
|
982
|
-
price:
|
|
985
|
+
price: zMoneyObject.nullable().optional(),
|
|
983
986
|
instructor_id: z.number().nullable().optional(),
|
|
984
987
|
instructor: userSchema.optional(),
|
|
985
988
|
aircraft_required: z.boolean().default(false),
|
|
@@ -1016,7 +1019,7 @@ export const courseSchema = z.object({
|
|
|
1016
1019
|
|
|
1017
1020
|
/**
|
|
1018
1021
|
* Materialized, admin-only metrics for an enrollment — recomputed server-side
|
|
1019
|
-
* (see
|
|
1022
|
+
* (see the course_enrollment_metrics snapshot). `flags` is an extensible bag of
|
|
1020
1023
|
* computed booleans (e.g. `has_solo`).
|
|
1021
1024
|
*/
|
|
1022
1025
|
export const courseEnrollmentMetricsSchema = z.object({
|
|
@@ -1044,8 +1047,7 @@ export const courseEnrollmentSchema = z.object({
|
|
|
1044
1047
|
comments: z.string().nullable().optional(),
|
|
1045
1048
|
initial_payment_generated: z.boolean().optional(),
|
|
1046
1049
|
initial_payment_removable: z.boolean().optional(),
|
|
1047
|
-
// Element-driven training progress
|
|
1048
|
-
// docs/features/training-tracking.md).
|
|
1050
|
+
// Element-driven training progress.
|
|
1049
1051
|
tracked_training_elements_count: z.number().optional(),
|
|
1050
1052
|
progress_source: z.enum(["training_elements", "milestones"]).optional(),
|
|
1051
1053
|
metrics: courseEnrollmentMetricsSchema.optional(),
|
|
@@ -1151,7 +1153,7 @@ export const landingSchema = z.object({
|
|
|
1151
1153
|
airport: airportSchema.optional(),
|
|
1152
1154
|
landing_fee_id: z.number().nullable().optional(),
|
|
1153
1155
|
landing_time: z.string(),
|
|
1154
|
-
price:
|
|
1156
|
+
price: zMoneyObject.nullable().optional(),
|
|
1155
1157
|
created_at: z.string(),
|
|
1156
1158
|
updated_at: z.string(),
|
|
1157
1159
|
});
|
|
@@ -1209,12 +1211,24 @@ export const settingSchema = z.object({
|
|
|
1209
1211
|
updated_at: z.string(),
|
|
1210
1212
|
});
|
|
1211
1213
|
|
|
1214
|
+
/**
|
|
1215
|
+
* The model a post is *about* (its optional subject). Scope is always the
|
|
1216
|
+
* company; the subject only adds a second listing place (the model's own
|
|
1217
|
+
* page). `label` is display-ready (registration / course name).
|
|
1218
|
+
*/
|
|
1219
|
+
export const postSubjectSchema = z.object({
|
|
1220
|
+
type: z.enum(["airplane", "course"]),
|
|
1221
|
+
id: z.number(),
|
|
1222
|
+
label: z.string(),
|
|
1223
|
+
});
|
|
1224
|
+
|
|
1212
1225
|
export const postSchema = z.object({
|
|
1213
1226
|
type: z.literal("post"),
|
|
1214
1227
|
id: z.number(),
|
|
1215
1228
|
company_id: z.number(),
|
|
1216
1229
|
postable_type: z.string().nullable().optional(),
|
|
1217
1230
|
postable_id: z.number().nullable().optional(),
|
|
1231
|
+
postable: postSubjectSchema.nullable().optional(),
|
|
1218
1232
|
author_id: z.number(),
|
|
1219
1233
|
author: userSchema.optional(),
|
|
1220
1234
|
title: z.string().nullable().optional(),
|
|
@@ -1222,6 +1236,8 @@ export const postSchema = z.object({
|
|
|
1222
1236
|
sticky: z.boolean().default(false),
|
|
1223
1237
|
public: z.boolean().default(false),
|
|
1224
1238
|
comments_disabled: z.boolean().default(false),
|
|
1239
|
+
/** Present when the endpoint counts comments (listings + show). */
|
|
1240
|
+
comments_count: z.number().nullable().optional(),
|
|
1225
1241
|
tags: z.array(tagSchema).optional(),
|
|
1226
1242
|
media: mediaCollection.optional(),
|
|
1227
1243
|
created_at: z.string(),
|
|
@@ -1229,6 +1245,8 @@ export const postSchema = z.object({
|
|
|
1229
1245
|
can: z
|
|
1230
1246
|
.object({
|
|
1231
1247
|
view: zNullableBool,
|
|
1248
|
+
viewComments: zNullableBool,
|
|
1249
|
+
createComments: zNullableBool,
|
|
1232
1250
|
update: zNullableBool,
|
|
1233
1251
|
delete: zNullableBool,
|
|
1234
1252
|
setFlags: zNullableBool,
|
|
@@ -1323,8 +1341,8 @@ export const prePaidPackageSchema = z.object({
|
|
|
1323
1341
|
company: companySchema.optional(),
|
|
1324
1342
|
name: z.string(),
|
|
1325
1343
|
description: z.string().nullable().optional(),
|
|
1326
|
-
balance:
|
|
1327
|
-
initial_amount:
|
|
1344
|
+
balance: zMoneyObject,
|
|
1345
|
+
initial_amount: zMoneyObject,
|
|
1328
1346
|
discount_percentage: z.number().nullable().optional(),
|
|
1329
1347
|
valid_until: z.string().nullable().optional(),
|
|
1330
1348
|
created_at: z.string(),
|
|
@@ -1341,7 +1359,7 @@ export const prePaidPackageSchema = z.object({
|
|
|
1341
1359
|
// A billing line-item (flight charge, landing fee, membership fee, refund,
|
|
1342
1360
|
// …) attached to a flight log / booking / membership via the polymorphic
|
|
1343
1361
|
// (model_type, model_id) pair, and to an invoice once released. NOT a
|
|
1344
|
-
// catalog entry — rebuilt field-by-field against ExpenseItemResource
|
|
1362
|
+
// catalog entry — rebuilt field-by-field against ExpenseItemResource;
|
|
1345
1363
|
// the previous shape (name/category/active) modeled a company catalog row,
|
|
1346
1364
|
// which ExpenseItem has never had.
|
|
1347
1365
|
export const prePaidPackageAssignmentSchema = z.object({
|
|
@@ -1349,7 +1367,7 @@ export const prePaidPackageAssignmentSchema = z.object({
|
|
|
1349
1367
|
flight_log_id: z.number().nullable().optional(),
|
|
1350
1368
|
expense_item_id: z.number().nullable().optional(),
|
|
1351
1369
|
pre_paid_package_id: z.number().nullable().optional(),
|
|
1352
|
-
gross_total:
|
|
1370
|
+
gross_total: zMoneyObject.nullable().optional(),
|
|
1353
1371
|
created_at: z.string().nullable().optional(),
|
|
1354
1372
|
updated_at: z.string().nullable().optional(),
|
|
1355
1373
|
});
|
|
@@ -1384,10 +1402,10 @@ export const expenseItemSchema = z.object({
|
|
|
1384
1402
|
membership_id: z.number(),
|
|
1385
1403
|
billing_profile_id: z.number().nullable(),
|
|
1386
1404
|
|
|
1387
|
-
gross_total_before_vouchers:
|
|
1388
|
-
gross_total:
|
|
1389
|
-
net_total:
|
|
1390
|
-
tax_total:
|
|
1405
|
+
gross_total_before_vouchers: zMoneyObject,
|
|
1406
|
+
gross_total: zMoneyObject,
|
|
1407
|
+
net_total: zMoneyObject,
|
|
1408
|
+
tax_total: zMoneyObject,
|
|
1391
1409
|
// number_format(…, 2) string, not a number.
|
|
1392
1410
|
tax_percentage: z.string(),
|
|
1393
1411
|
billable: z.boolean(),
|
package/src/schemas/training.ts
CHANGED
|
@@ -359,7 +359,7 @@ export type TrainingRecordEntryInput = z.infer<
|
|
|
359
359
|
typeof trainingRecordEntryInputSchema
|
|
360
360
|
>;
|
|
361
361
|
|
|
362
|
-
// Mirrors the generic `SignatureResource`
|
|
362
|
+
// Mirrors the generic `SignatureResource` — the
|
|
363
363
|
// same polymorphic `Signature` model backs both form submissions and
|
|
364
364
|
// training records. Kept self-contained here (not imported from
|
|
365
365
|
// @schemas/FormTemplateSchema) to match this file's own alias root and the
|
|
@@ -504,7 +504,7 @@ export type CreateSyllabusFromTemplateForm = z.infer<
|
|
|
504
504
|
typeof CreateSyllabusFromTemplateFormSchema
|
|
505
505
|
>;
|
|
506
506
|
|
|
507
|
-
// Mirrors `CreateSyllabusFromTemplate::run()`'s return shape
|
|
507
|
+
// Mirrors `CreateSyllabusFromTemplate::run()`'s return shape,
|
|
508
508
|
// as wrapped by `SyllabusController::fromTemplate`.
|
|
509
509
|
export const createSyllabusFromTemplateResultSchema = z.object({
|
|
510
510
|
catalog: z.object({
|
package/src/types/compliance.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface ComplianceRequirement {
|
|
|
7
7
|
logical_group: string;
|
|
8
8
|
is_satisfied: boolean;
|
|
9
9
|
// True when the member has already signed the satisfying submission and
|
|
10
|
-
// only the company's counter-signature is outstanding (e.g. the
|
|
10
|
+
// only the company's counter-signature is outstanding (e.g. the
|
|
11
11
|
// Chartervertrag). The requirement is still unsatisfied, but the member
|
|
12
12
|
// isn't the blocker — consumers refine this into an `awaiting_countersign`
|
|
13
13
|
// display state.
|
package/src/types/index.ts
CHANGED
package/src/types/models.ts
CHANGED
|
@@ -128,6 +128,7 @@ export type AirplaneIssueStatus = z.infer<
|
|
|
128
128
|
export type Event = z.infer<typeof ModelSchemas.eventSchema>;
|
|
129
129
|
export type Ticket = z.infer<typeof ModelSchemas.ticketSchema>;
|
|
130
130
|
export type Post = z.infer<typeof ModelSchemas.postSchema>;
|
|
131
|
+
export type PostSubject = z.infer<typeof ModelSchemas.postSubjectSchema>;
|
|
131
132
|
|
|
132
133
|
/**
|
|
133
134
|
* Full-replacement tag sync entry — `id` marks an existing tag (wins over
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Operating hours — an organization defines several independent groups (its
|
|
3
|
+
* own office hours, a military field it flies from, the tower, an FBO). Each
|
|
4
|
+
* group is self-contained (own IANA timezone + optional airport) and is
|
|
5
|
+
* materialised server-side into merged, half-open UTC windows; status is
|
|
6
|
+
* answered per group as open / partial / closed / unknown.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export type OperatingHourKind =
|
|
10
|
+
| "company" | "airport" | "atc" | "fbo" | "military"
|
|
11
|
+
| "fuel" | "customs" | "handling" | "maintenance" | "other";
|
|
12
|
+
|
|
13
|
+
export type TimeAnchor = "fixed" | "sunrise" | "sunset";
|
|
14
|
+
|
|
15
|
+
export type OperatingStatusValue = "open" | "partial" | "closed" | "unknown";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* One open block. Each bound is a fixed local time, or sunrise/sunset with a
|
|
19
|
+
* signed offset and an optional cap ("SR-30 aber nicht vor 07:00"). An end at
|
|
20
|
+
* or before its start crosses midnight.
|
|
21
|
+
*/
|
|
22
|
+
export type OperatingHourInterval = {
|
|
23
|
+
id?: number;
|
|
24
|
+
sort: number;
|
|
25
|
+
start_kind: TimeAnchor;
|
|
26
|
+
start_time: string | null;
|
|
27
|
+
start_offset_minutes: number | null;
|
|
28
|
+
start_not_before: string | null;
|
|
29
|
+
end_kind: TimeAnchor;
|
|
30
|
+
end_time: string | null;
|
|
31
|
+
end_offset_minutes: number | null;
|
|
32
|
+
end_not_after: string | null;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/** One weekday. ISO: 1 = Monday .. 7 = Sunday. */
|
|
36
|
+
export type OperatingHourDay = {
|
|
37
|
+
id?: number;
|
|
38
|
+
schedule_id?: number;
|
|
39
|
+
day_of_week: number;
|
|
40
|
+
is_closed: boolean;
|
|
41
|
+
is_24_hours: boolean;
|
|
42
|
+
notes: string | null;
|
|
43
|
+
intervals: OperatingHourInterval[];
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/** A hand-entered override for a date range. No recurrence, by design. */
|
|
47
|
+
export type OperatingHourException = {
|
|
48
|
+
id: number;
|
|
49
|
+
schedule_id: number;
|
|
50
|
+
starts_on: string;
|
|
51
|
+
ends_on: string;
|
|
52
|
+
is_closed: boolean;
|
|
53
|
+
is_24_hours: boolean;
|
|
54
|
+
reason: string;
|
|
55
|
+
intervals: OperatingHourInterval[];
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* What the client composes before an exception exists — no id, no owner yet.
|
|
60
|
+
* The read type above is what comes back; keeping the two apart lets the
|
|
61
|
+
* dialog's `createItem` seed a blank without lying about an id.
|
|
62
|
+
*/
|
|
63
|
+
export type OperatingHourExceptionInput = Omit<
|
|
64
|
+
OperatingHourException,
|
|
65
|
+
"id" | "schedule_id"
|
|
66
|
+
>;
|
|
67
|
+
|
|
68
|
+
/** A concrete, merged, half-open UTC window. Derived — read-only. */
|
|
69
|
+
export type OperatingHourWindow = {
|
|
70
|
+
starts_at: string;
|
|
71
|
+
ends_at: string;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* A group. Self-contained: carries its own timezone and airport, resolved
|
|
76
|
+
* from nowhere else. `materialized_from`/`materialized_through` bound the
|
|
77
|
+
* range in which "no window" genuinely means closed rather than unknown.
|
|
78
|
+
*/
|
|
79
|
+
export type OperatingHourSchedule = {
|
|
80
|
+
id: number;
|
|
81
|
+
company_id: number;
|
|
82
|
+
airport_id: number | null;
|
|
83
|
+
airport?: { id: number; ident: string; name: string } | null;
|
|
84
|
+
kind: OperatingHourKind;
|
|
85
|
+
name: string;
|
|
86
|
+
description: string | null;
|
|
87
|
+
timezone: string;
|
|
88
|
+
valid_from: string;
|
|
89
|
+
valid_until: string | null;
|
|
90
|
+
is_active: boolean;
|
|
91
|
+
sort_order: number;
|
|
92
|
+
source: string | null;
|
|
93
|
+
verified_at: string | null;
|
|
94
|
+
materialized_from: string | null;
|
|
95
|
+
materialized_through: string | null;
|
|
96
|
+
days: OperatingHourDay[];
|
|
97
|
+
exceptions: OperatingHourException[];
|
|
98
|
+
created_at?: string;
|
|
99
|
+
updated_at?: string;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
/** The fields a client may send when creating a group. */
|
|
103
|
+
export type OperatingHourScheduleInput = Partial<
|
|
104
|
+
Omit<
|
|
105
|
+
OperatingHourSchedule,
|
|
106
|
+
| "id"
|
|
107
|
+
| "company_id"
|
|
108
|
+
| "airport"
|
|
109
|
+
| "materialized_from"
|
|
110
|
+
| "materialized_through"
|
|
111
|
+
| "days"
|
|
112
|
+
| "exceptions"
|
|
113
|
+
| "created_at"
|
|
114
|
+
| "updated_at"
|
|
115
|
+
>
|
|
116
|
+
>;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* What the saved rules resolve to on ONE named calendar date — used for the
|
|
120
|
+
* solstice hints. Carries its own date and status precisely so the extremes
|
|
121
|
+
* can never be merged into a weekday bucket alongside the current week, and
|
|
122
|
+
* so an `unknown` date is reported as unknown rather than as closed.
|
|
123
|
+
*/
|
|
124
|
+
export type OperatingHourResolvedDate = {
|
|
125
|
+
/** `Y-m-d` in the group's timezone. */
|
|
126
|
+
date: string;
|
|
127
|
+
status: OperatingStatusValue;
|
|
128
|
+
windows: OperatingHourWindow[];
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export type OperatingHourStatusEntry = {
|
|
132
|
+
schedule_id: number;
|
|
133
|
+
kind: OperatingHourKind;
|
|
134
|
+
name: string;
|
|
135
|
+
timezone: string;
|
|
136
|
+
status: OperatingStatusValue;
|
|
137
|
+
windows: OperatingHourWindow[];
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export type OperatingHoursStatusResponse = {
|
|
141
|
+
from: string;
|
|
142
|
+
to: string;
|
|
143
|
+
data: OperatingHourStatusEntry[];
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
export type OperatingHoursNextOpenEntry = {
|
|
147
|
+
schedule_id: number;
|
|
148
|
+
kind: OperatingHourKind;
|
|
149
|
+
name: string;
|
|
150
|
+
next_opening: string | null;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export type OperatingHoursNextOpenResponse = {
|
|
154
|
+
after: string;
|
|
155
|
+
data: OperatingHoursNextOpenEntry[];
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
export type OperatingHoursMeta = {
|
|
159
|
+
kinds: OperatingHourKind[];
|
|
160
|
+
anchors: TimeAnchor[];
|
|
161
|
+
statuses: OperatingStatusValue[];
|
|
162
|
+
max_status_range_days: number;
|
|
163
|
+
};
|
|
File without changes
|
|
File without changes
|