@updraft-solutions/mcrit-sdk 0.14.12 → 0.14.13

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.
@@ -140,8 +140,11 @@ import {
140
140
  fboActivityCauserSchema,
141
141
  fboActivityChangesSchema,
142
142
  fboActivitySchema,
143
+ fboCompanyGrantInputSchema,
144
+ fboCompanyGrantSchema,
143
145
  fboCompanyMemberSchema,
144
146
  fboCompanyProfileSchema,
147
+ fboCompanySchema,
145
148
  fboDecisionAxisSchema,
146
149
  fboDecisionInputSchema,
147
150
  fboDecisionSchema,
@@ -153,9 +156,13 @@ import {
153
156
  fboFlightSchema,
154
157
  fboFlightStatusSchema,
155
158
  fboFlightTypeSchema,
159
+ fboGrantAbilityOptionSchema,
160
+ fboGrantAbilitySchema,
161
+ fboGrantCompanyRefSchema,
156
162
  fboGroundServicesSchema,
157
163
  fboLandingsSummarySchema,
158
164
  fboMaterialiseResultSchema,
165
+ fboMetaSchema,
159
166
  fboNextDutySchema,
160
167
  fboOccupationSchema,
161
168
  fboOperationsSchema,
@@ -230,7 +237,7 @@ import {
230
237
  zMoneyObject,
231
238
  zNetGross,
232
239
  zNullableBool
233
- } from "../chunk-QCA4OD7R.js";
240
+ } from "../chunk-LL3XK7X2.js";
234
241
  export {
235
242
  ALLOWED_GEOMETRY_TYPES,
236
243
  ALLOWED_NEWSLETTER_VARIABLES,
@@ -373,8 +380,11 @@ export {
373
380
  fboActivityCauserSchema,
374
381
  fboActivityChangesSchema,
375
382
  fboActivitySchema,
383
+ fboCompanyGrantInputSchema,
384
+ fboCompanyGrantSchema,
376
385
  fboCompanyMemberSchema,
377
386
  fboCompanyProfileSchema,
387
+ fboCompanySchema,
378
388
  fboDecisionAxisSchema,
379
389
  fboDecisionInputSchema,
380
390
  fboDecisionSchema,
@@ -386,9 +396,13 @@ export {
386
396
  fboFlightSchema,
387
397
  fboFlightStatusSchema,
388
398
  fboFlightTypeSchema,
399
+ fboGrantAbilityOptionSchema,
400
+ fboGrantAbilitySchema,
401
+ fboGrantCompanyRefSchema,
389
402
  fboGroundServicesSchema,
390
403
  fboLandingsSummarySchema,
391
404
  fboMaterialiseResultSchema,
405
+ fboMetaSchema,
392
406
  fboNextDutySchema,
393
407
  fboOccupationSchema,
394
408
  fboOperationsSchema,
@@ -1,6 +1,575 @@
1
- export { A as Activity, a as Address, b as AiSuggestedMilestone, c as AiSuggestion, d as AiSuggestionStatus, e as AircraftBlock, f as AircraftBlockReason, g as AircraftPosition, h as AircraftRating, i as Airplane, b0 as AirplaneIssue, b1 as AirplaneIssueSeverity, b2 as AirplaneIssueStatus, j as AirplanePermission, k as AirplaneShareInvite, l as Airport, m as Alert, n as AllowedDocumentType, o as ApiResponse, p as ApproachType, q as Avail, B as BackgroundTask, r as BackgroundTaskStatus, s as BaseMembership, b3 as BaseModel, t as Booking, C as Comment, u as Company, v as ComplianceData, w as ComplianceGroup, x as ComplianceGroupSource, y as ComplianceRequirement, z as ComplianceRequirementGroup, D as ComplianceResponse, E as ComplianceSummary, F as Course, b4 as CourseCheckSyllabus, G as CourseDescriptionSuggestionPayload, H as CourseEnrollment, b5 as CourseEnrollmentMetrics, I as CourseFee, J as CreateAirplaneIssueInput, K as CreateCommentInput, L as CreatePostInput, M as DataWrappedResponse, N as DeferAirplaneIssueInput, O as DiscardedRow, P as Document, Q as DocumentComplianceStatus, R as DocumentRequirement, S as DocumentRequirementGroup, T as DocumentRequirementGroupAssignment, U as DocumentShare, V as DocumentType, W as Event, X as Expense, Y as ExpenseItem, Z as ExtendedAirplane, _ as Fee, $ as FeeCategoryOptions, a0 as FlightLog, a1 as GroupedPermissions, a2 as Invoice, a3 as Landing, a4 as LandingFee, a5 as LandingFeeImportResult, a6 as LandingFeeInvoiceApplyPayload, a7 as LandingFeeInvoiceApplyResult, a8 as LandingFeeInvoicePreview, a9 as LandingFeeInvoicePreviewRow, aa as LandingFeeTemplateParams, ab as LogbookFlightLogPayload, ac as LogbookStageResult, ad as LogbookSuggestion, ae as LogbookSuggestionMeta, af as MaintenanceEvent, ag as MaintenanceEventEstimation, ah as MaintenanceStatus, b6 as Media, ai as MediaCollection, aj as Membership, ak as MembershipSignup, al as OperatingHourDay, am as OperatingHourException, an as OperatingHourExceptionInput, ao as OperatingHourInterval, ap as OperatingHourKind, aq as OperatingHourResolvedDate, ar as OperatingHourSchedule, as as OperatingHourScheduleInput, at as OperatingHourStatusEntry, au as OperatingHourWindow, av as OperatingHoursMeta, aw as OperatingHoursNextOpenEntry, ax as OperatingHoursNextOpenResponse, ay as OperatingHoursStatusResponse, az as OperatingStatusValue, aA as PaginatedResponse, aB as PermissionItem, aC as Post, aD as PostSubject, aE as PrePaidPackage, aF as Price, aG as Qualification, aH as RecurringFlight, aI as ResolveAirplaneIssueInput, aJ as Resource, aK as Role, aL as RoleDetail, aM as RoleListItem, aN as Runway, aO as ScheduledFlight, aP as Setting, aQ as SpecialFlight, aR as Tag, b7 as TagSyncEntry, aS as Ticket, aT as TimeAnchor, aU as ToggleFavoriteResponse, aV as UpdateAirplaneIssueInput, aW as UpdateCommentInput, aX as UpdatePostInput, aY as User, aZ as UserAircraftRating, a_ as UserQualification, a$ as Waypoint } from '../operating-hours-BLJOADcx.cjs';
2
1
  import { z } from 'zod';
3
- import { bh as fboAcceptanceAxisSchema, bi as fboAcceptanceStatusSchema, bl as fboActivitySchema, bj as fboActivityCauserSchema, bk as fboActivityChangesSchema, bm as fboCompanyMemberSchema, bn as fboCompanyProfileSchema, bq as fboDecisionSchema, bo as fboDecisionAxisSchema, bp as fboDecisionInputSchema, bs as fboDutySchema, br as fboDutyAffectedSchema, bt as fboDutySeriesResponseSchema, bw as fboFlightSchema, bv as fboFlightDocumentSchema, bx as fboFlightStatusSchema, by as fboFlightTypeSchema, bz as fboGroundServicesSchema, bA as fboLandingsSummarySchema, bB as fboMaterialiseResultSchema, bC as fboNextDutySchema, bD as fboOccupationSchema, bE as fboOperationsSchema, bF as fboPersonSchema, bG as fboPobSchema, bH as fboRecurrenceSchema, bI as fboRecurrenceTypeSchema, bJ as fboRecurringFlightSchema, bK as fboRoleSchema, bM as fboStatisticsSchema, bN as fboSystemRoleSchema, bO as fboTrafficRowSchema, bQ as fboTrafficSourceSchema, bR as fboVisibilitySchema, bS as fboWeeklyLandingSchema } from '../fbo-7EyTUlqN.cjs';
2
+ import { aE as activitySchema, aF as addressSchema, aG as aircraftPositionSchema, aH as aircraftRatingSchema, aM as airplaneSchema, aL as airplanePermissionSchema, aN as airplaneShareInviteSchema, aO as airportSchema, aP as alertSchema, aQ as allowedDocumentTypeSchema, aR as approachTypeSchema, aS as availSchema, aT as baseMembershipSchema, aV as bookingSchema, aX as commentSchema, aZ as companySchema, b3 as courseSchema, b1 as courseEnrollmentSchema, b2 as courseFeeSchema, aJ as airplaneIssueSeverityEnum, b9 as documentSchema, b5 as documentComplianceStatus, b6 as documentRequirement, b7 as documentRequirementGroup, b8 as documentRequirementGroupAssignment, ba as documentShareSchema, bb as documentType, bd as eventSchema, bf as expenseSchema, be as expenseItemSchema, bg as extendedAirplaneSchema, b$ as feeSchema, b_ as feeCategoryOptionsSchema, c0 as flightLogSchema, c8 as invoiceSchema, ca as landingSchema, c9 as landingFeeSchema, cc as maintenanceEventSchema, cb as maintenanceEventEstimationSchema, cd as maintenanceStatusSchema, ce as mediaCollection, ch as membershipSchema, ci as membershipSignupSchema, ck as postSchema, cl as postSubjectSchema, cn as prePaidPackageSchema, co as priceSchema, cp as qualificationSchema, cq as recurringFlightSchema, cr as roleSchema, cs as runwaySchema, ct as scheduledFlightSchema, cu as settingSchema, cv as specialFlightSchema, cC as tagSchema, cD as ticketSchema, cN as userSchema, cL as userAircraftRatingSchema, cM as userQualificationSchema, cO as waypointSchema, aI as airplaneIssueSchema, aK as airplaneIssueStatusEnum, B as BaseModel$1, a$ as courseCheckSyllabusSchema, b0 as courseEnrollmentMetricsSchema, cf as mediaSchema, n as FormSubmission, bh as fboAcceptanceAxisSchema, bi as fboAcceptanceStatusSchema, bl as fboActivitySchema, bj as fboActivityCauserSchema, bk as fboActivityChangesSchema, bq as fboCompanySchema, bn as fboCompanyGrantSchema, bm as fboCompanyGrantInputSchema, bo as fboCompanyMemberSchema, bp as fboCompanyProfileSchema, bt as fboDecisionSchema, br as fboDecisionAxisSchema, bs as fboDecisionInputSchema, bv as fboDutySchema, bu as fboDutyAffectedSchema, bw as fboDutySeriesResponseSchema, bz as fboFlightSchema, by as fboFlightDocumentSchema, bA as fboFlightStatusSchema, bB as fboFlightTypeSchema, bD as fboGrantAbilitySchema, bC as fboGrantAbilityOptionSchema, bE as fboGrantCompanyRefSchema, bF as fboGroundServicesSchema, bG as fboLandingsSummarySchema, bH as fboMaterialiseResultSchema, bI as fboMetaSchema, bJ as fboNextDutySchema, bK as fboOccupationSchema, bL as fboOperationsSchema, bM as fboPersonSchema, bN as fboPobSchema, bO as fboRecurrenceSchema, bP as fboRecurrenceTypeSchema, bQ as fboRecurringFlightSchema, bR as fboRoleSchema, bT as fboStatisticsSchema, bU as fboSystemRoleSchema, bV as fboTrafficRowSchema, bX as fboTrafficSourceSchema, bY as fboVisibilitySchema, bZ as fboWeeklyLandingSchema } from '../fbo-sWpm3mI6.cjs';
3
+
4
+ type BaseModel = z.infer<typeof BaseModel$1>;
5
+ type User = z.infer<typeof userSchema>;
6
+ type Company = z.infer<typeof companySchema>;
7
+ type Media = z.infer<typeof mediaSchema>;
8
+ type MediaCollection = z.infer<typeof mediaCollection>;
9
+ type BaseMembership = z.infer<typeof baseMembershipSchema>;
10
+ type Membership = z.infer<typeof membershipSchema>;
11
+ type Airplane = z.infer<typeof airplaneSchema>;
12
+ type ExtendedAirplane = z.infer<typeof extendedAirplaneSchema>;
13
+ type AirplanePermission = z.infer<typeof airplanePermissionSchema>;
14
+ type AirplaneShareInvite = z.infer<typeof airplaneShareInviteSchema>;
15
+ type LandingFee = z.infer<typeof landingFeeSchema>;
16
+ type AircraftRating = z.infer<typeof aircraftRatingSchema>;
17
+ type UserAircraftRating = z.infer<typeof userAircraftRatingSchema>;
18
+ type UserQualification = z.infer<typeof userQualificationSchema>;
19
+ type Airport = z.infer<typeof airportSchema>;
20
+ type RecurringFlight = z.infer<typeof recurringFlightSchema>;
21
+ type Fee = z.infer<typeof feeSchema>;
22
+ type CourseFee = z.infer<typeof courseFeeSchema>;
23
+ type FeeCategoryOptions = z.infer<typeof feeCategoryOptionsSchema>;
24
+ type Tag = z.infer<typeof tagSchema>;
25
+ type CourseCheckSyllabus = z.infer<typeof courseCheckSyllabusSchema>;
26
+ type Price = z.infer<typeof priceSchema>;
27
+ type MaintenanceEvent = z.infer<typeof maintenanceEventSchema>;
28
+ type MaintenanceStatus = z.infer<typeof maintenanceStatusSchema>;
29
+ type MaintenanceEventEstimation = z.infer<typeof maintenanceEventEstimationSchema>;
30
+ type Activity = z.infer<typeof activitySchema>;
31
+ type MembershipSignup = z.infer<typeof membershipSignupSchema>;
32
+ type AircraftPosition = z.infer<typeof aircraftPositionSchema>;
33
+ type Avail = z.infer<typeof availSchema>;
34
+ type Alert = z.infer<typeof alertSchema>;
35
+ type Booking = z.infer<typeof bookingSchema>;
36
+ type Document = z.infer<typeof documentSchema>;
37
+ type DocumentType = z.infer<typeof documentType>;
38
+ type DocumentRequirement = z.infer<typeof documentRequirement>;
39
+ type DocumentRequirementGroup = z.infer<typeof documentRequirementGroup>;
40
+ type DocumentRequirementGroupAssignment = z.infer<typeof documentRequirementGroupAssignment>;
41
+ type DocumentComplianceStatus = z.infer<typeof documentComplianceStatus>;
42
+ type DocumentShare = z.infer<typeof documentShareSchema>;
43
+ type AllowedDocumentType = z.infer<typeof allowedDocumentTypeSchema>;
44
+ type FlightLog = z.infer<typeof flightLogSchema>;
45
+ type ScheduledFlight = z.infer<typeof scheduledFlightSchema>;
46
+ type Landing = z.infer<typeof landingSchema>;
47
+ type ApproachType = z.infer<typeof approachTypeSchema>;
48
+ type Waypoint = z.infer<typeof waypointSchema>;
49
+ type Invoice = z.infer<typeof invoiceSchema>;
50
+ type Expense = z.infer<typeof expenseSchema>;
51
+ type ExpenseItem = z.infer<typeof expenseItemSchema>;
52
+ type SpecialFlight = z.infer<typeof specialFlightSchema>;
53
+ type PrePaidPackage = z.infer<typeof prePaidPackageSchema>;
54
+ type Qualification = z.infer<typeof qualificationSchema>;
55
+ type Course = z.infer<typeof courseSchema>;
56
+ type CourseEnrollment = z.infer<typeof courseEnrollmentSchema>;
57
+ type CourseEnrollmentMetrics = z.infer<typeof courseEnrollmentMetricsSchema>;
58
+ type AirplaneIssue = z.infer<typeof airplaneIssueSchema>;
59
+ type AirplaneIssueSeverity = z.infer<typeof airplaneIssueSeverityEnum>;
60
+ type AirplaneIssueStatus = z.infer<typeof airplaneIssueStatusEnum>;
61
+ type Event = z.infer<typeof eventSchema>;
62
+ type Ticket = z.infer<typeof ticketSchema>;
63
+ type Post = z.infer<typeof postSchema>;
64
+ type PostSubject = z.infer<typeof postSubjectSchema>;
65
+ /**
66
+ * Full-replacement tag sync entry — `id` marks an existing tag (wins over
67
+ * name matching), fresh tags carry only name (+ optional color) and are
68
+ * created server-side on save.
69
+ */
70
+ interface TagSyncEntry {
71
+ id?: number | null;
72
+ name: string;
73
+ color?: string | null;
74
+ }
75
+ interface CreatePostInput {
76
+ title?: string | null;
77
+ content: string;
78
+ sticky?: boolean;
79
+ public?: boolean;
80
+ comments_disabled?: boolean;
81
+ tags?: TagSyncEntry[];
82
+ /** Action flag, not persisted: notify company members on publish. */
83
+ notify?: boolean;
84
+ }
85
+ interface UpdatePostInput {
86
+ title?: string | null;
87
+ content: string;
88
+ sticky?: boolean;
89
+ public?: boolean;
90
+ comments_disabled?: boolean;
91
+ tags?: TagSyncEntry[];
92
+ }
93
+ interface CreateAirplaneIssueInput {
94
+ title?: string | null;
95
+ body: string;
96
+ severity?: AirplaneIssueSeverity;
97
+ ata_chapter?: string | null;
98
+ }
99
+ interface UpdateAirplaneIssueInput {
100
+ title?: string | null;
101
+ body?: string;
102
+ severity?: AirplaneIssueSeverity;
103
+ ata_chapter?: string | null;
104
+ }
105
+ interface ResolveAirplaneIssueInput {
106
+ resolution_notes?: string | null;
107
+ }
108
+ interface DeferAirplaneIssueInput {
109
+ deferred_until?: string | null;
110
+ deferral_notes?: string | null;
111
+ }
112
+ type Comment = z.infer<typeof commentSchema>;
113
+ interface CreateCommentInput {
114
+ body: string;
115
+ parent_id?: number;
116
+ title?: string;
117
+ }
118
+ interface UpdateCommentInput {
119
+ body?: string;
120
+ title?: string;
121
+ }
122
+ type Address = z.infer<typeof addressSchema>;
123
+ type Runway = z.infer<typeof runwaySchema>;
124
+ type Role = z.infer<typeof roleSchema>;
125
+ type Setting = z.infer<typeof settingSchema>;
126
+
127
+ /**
128
+ * Generic response wrapper for data with optional metadata
129
+ * @template T - The data type
130
+ * @template M - The metadata type (optional)
131
+ */
132
+ interface DataWrappedResponse<T, M = undefined> {
133
+ data: T;
134
+ meta?: M;
135
+ }
136
+ type ApiResponse<T> = DataWrappedResponse<T>;
137
+ interface PaginatedResponse<T = unknown> {
138
+ data: T[];
139
+ meta: {
140
+ current_page: number;
141
+ from: number;
142
+ last_page: number;
143
+ per_page: number;
144
+ to: number;
145
+ total: number;
146
+ };
147
+ links?: {
148
+ first?: string | null;
149
+ last?: string | null;
150
+ prev?: string | null;
151
+ next?: string | null;
152
+ };
153
+ }
154
+ interface Resource {
155
+ id: number;
156
+ type: string;
157
+ }
158
+ interface ToggleFavoriteResponse {
159
+ id: number;
160
+ hasFavorited: boolean;
161
+ }
162
+
163
+ interface ComplianceRequirement {
164
+ requirement_id: number;
165
+ form_template_id: number;
166
+ form_template_name: string;
167
+ logical_group: string;
168
+ is_satisfied: boolean;
169
+ awaiting_countersignature?: boolean;
170
+ submission: FormSubmission | null;
171
+ }
172
+ interface ComplianceRequirementGroup {
173
+ group_name: string;
174
+ group_operator: "AND" | "OR";
175
+ group_satisfied: boolean;
176
+ requirements: ComplianceRequirement[];
177
+ }
178
+ type ComplianceGroupSource = {
179
+ type: "direct";
180
+ } | {
181
+ type: "role";
182
+ role: string;
183
+ } | {
184
+ type: "airplane";
185
+ airplane_id: number;
186
+ registration: string;
187
+ };
188
+ interface ComplianceGroup {
189
+ group_id: number;
190
+ group_name: string;
191
+ overall_satisfied: boolean;
192
+ requirement_groups: ComplianceRequirementGroup[];
193
+ sources?: ComplianceGroupSource[];
194
+ }
195
+ interface ComplianceSummary {
196
+ total_groups: number;
197
+ satisfied_groups: number;
198
+ failed_groups: number;
199
+ }
200
+ interface ComplianceData {
201
+ overall_satisfied: boolean;
202
+ requirement_groups: ComplianceGroup[];
203
+ summary: ComplianceSummary;
204
+ }
205
+ interface ComplianceResponse {
206
+ data: ComplianceData;
207
+ meta: {
208
+ model_id: string;
209
+ model_type: string;
210
+ target_model_id: string;
211
+ target_model_type: string;
212
+ };
213
+ }
214
+
215
+ type AircraftBlockReason = "general" | "ferry" | "weather" | "private" | "aog" | "other";
216
+ interface AircraftBlock {
217
+ type: "aircraftBlock";
218
+ id: number;
219
+ airplane_id: number;
220
+ company_id: number;
221
+ starts_at: string;
222
+ ends_at: string;
223
+ reason: AircraftBlockReason;
224
+ note: string | null;
225
+ is_maintenance: boolean;
226
+ maintenance_event_id: number | null;
227
+ created_at: string;
228
+ updated_at: string;
229
+ can?: Record<string, boolean | null>;
230
+ }
231
+
232
+ type BackgroundTaskStatus = "queued" | "processing" | "completed" | "failed" | "canceled";
233
+ interface BackgroundTask<TResult = unknown> {
234
+ type: "background_task";
235
+ /** Store key — mirrors `uuid` (the API has no client-facing integer id). */
236
+ id: string;
237
+ uuid: string;
238
+ task_type: string;
239
+ status: BackgroundTaskStatus;
240
+ progress: number | null;
241
+ progress_label: string | null;
242
+ company_id: number | null;
243
+ user_id: number | null;
244
+ result: TResult | null;
245
+ error: string | null;
246
+ started_at: string | null;
247
+ finished_at: string | null;
248
+ created_at: string | null;
249
+ }
250
+
251
+ type AiSuggestionStatus = "pending" | "ready" | "applied" | "dismissed" | "failed";
252
+ interface AiSuggestion<TPayload = unknown> {
253
+ type: "ai_suggestion";
254
+ id: number;
255
+ subject_type: string;
256
+ subject_id: number;
257
+ company_id: number | null;
258
+ suggestion_type: string;
259
+ locale: string;
260
+ payload: TPayload;
261
+ meta?: unknown;
262
+ status: AiSuggestionStatus;
263
+ requested_by: number | null;
264
+ applied_at: string | null;
265
+ dismissed_at: string | null;
266
+ created_at: string;
267
+ }
268
+ interface AiSuggestedMilestone {
269
+ name: string;
270
+ description?: string | null;
271
+ kind: "progress" | "prerequisite" | "solo" | "cross_country";
272
+ is_prerequisite: boolean;
273
+ sort_order: number;
274
+ }
275
+ interface CourseDescriptionSuggestionPayload {
276
+ title: string;
277
+ subtitle: string;
278
+ summary: string;
279
+ html: string;
280
+ milestones: AiSuggestedMilestone[];
281
+ }
282
+ interface LogbookFlightLogPayload {
283
+ etdZ: string | null;
284
+ etaZ: string | null;
285
+ departure_airport_id: number | null;
286
+ destination_airport_id: number | null;
287
+ departure_airport_icao: string | null;
288
+ destination_airport_icao: string | null;
289
+ full_stop_landings: number;
290
+ touch_and_gos: number;
291
+ low_approaches: number;
292
+ crew_assignments: {
293
+ membership_id: number;
294
+ role: string;
295
+ }[];
296
+ membership_id: number | null;
297
+ billing_profile_id?: number | null;
298
+ }
299
+ interface LogbookSuggestionMeta {
300
+ flags?: string[];
301
+ match?: {
302
+ confidence: string;
303
+ reasoning: string;
304
+ };
305
+ extraction?: {
306
+ valid: boolean | null;
307
+ discrepancy_minutes: number | null;
308
+ };
309
+ crew_text?: string | null;
310
+ }
311
+ type LogbookSuggestion = AiSuggestion<LogbookFlightLogPayload> & {
312
+ meta?: LogbookSuggestionMeta;
313
+ };
314
+ interface DiscardedRow {
315
+ reason: string;
316
+ flight: Record<string, unknown>;
317
+ }
318
+ interface LogbookStageResult {
319
+ booking_id: number;
320
+ suggestion_ids: number[];
321
+ staged: number;
322
+ routed: Record<string, number> | number[];
323
+ discarded: DiscardedRow[];
324
+ }
325
+
326
+ interface RoleListItem {
327
+ id: number;
328
+ name: string;
329
+ description: string | null;
330
+ is_system: boolean;
331
+ has_duties: boolean;
332
+ company_id: number | null;
333
+ permissions_count: number;
334
+ }
335
+ interface PermissionItem {
336
+ id: number;
337
+ name: string;
338
+ description: string | null;
339
+ group: string;
340
+ }
341
+ interface RoleDetail extends Omit<RoleListItem, "permissions_count"> {
342
+ permissions: PermissionItem[];
343
+ }
344
+ interface GroupedPermissions {
345
+ [group: string]: PermissionItem[];
346
+ }
347
+
348
+ interface LandingFeeTemplateParams {
349
+ landing_type: "FULLSTOP" | "TOUCHANDGO" | "LOWAPPROACH";
350
+ net_gross: "net" | "gross";
351
+ valid_from: string;
352
+ tax_percentage?: number;
353
+ approach_type_id?: number;
354
+ }
355
+ interface LandingFeeImportResult {
356
+ created: number;
357
+ updated: number;
358
+ unchanged: number;
359
+ prices_added: number;
360
+ skipped: number;
361
+ issues: string[];
362
+ preview: Array<[
363
+ string,
364
+ string,
365
+ string,
366
+ string,
367
+ string,
368
+ "new" | "update" | "unchanged"
369
+ ]>;
370
+ meta: {
371
+ landing_type: string;
372
+ approach_type_id: number;
373
+ net_gross: string;
374
+ tax_percentage: number;
375
+ valid_from: string;
376
+ };
377
+ }
378
+ interface LandingFeeInvoicePreviewRow {
379
+ registration: string;
380
+ airplane_id: number | null;
381
+ fee_type: string;
382
+ landing_type: string | null;
383
+ unit_price: number;
384
+ price_basis: "net" | "gross";
385
+ vat_rate: number | null;
386
+ net_total: number | null;
387
+ gross_total: number | null;
388
+ current_price: number | null;
389
+ current_net_total: number | null;
390
+ current_gross_total: number | null;
391
+ date: string | null;
392
+ start_time: string | null;
393
+ landing_time: string | null;
394
+ status: "new" | "changed" | "unchanged" | "unmatched-aircraft" | "unmapped-fee-type" | "airport-unknown";
395
+ }
396
+ interface LandingFeeInvoicePreview {
397
+ rejected: boolean;
398
+ message: string | null;
399
+ company_id: number;
400
+ airport: {
401
+ id: number;
402
+ ident: string;
403
+ name: string;
404
+ } | null;
405
+ invoice: {
406
+ number: string | null;
407
+ date: string | null;
408
+ currency: string | null;
409
+ issuing_airport_name: string | null;
410
+ suggested_airport_icao_ident: string | null;
411
+ };
412
+ landing_fee_rows: LandingFeeInvoicePreviewRow[];
413
+ other_fees: Array<Record<string, unknown>>;
414
+ warnings: Array<{
415
+ type: string;
416
+ message: string;
417
+ }>;
418
+ }
419
+ interface LandingFeeInvoiceApplyPayload {
420
+ airport_id: number;
421
+ valid_from: string;
422
+ tax_percentage: number;
423
+ approach_type_id: number;
424
+ rows: Array<{
425
+ airplane_id: number;
426
+ landing_type: string;
427
+ unit_price: number;
428
+ price_basis: "net" | "gross";
429
+ vat_rate: number | null;
430
+ }>;
431
+ }
432
+ interface LandingFeeInvoiceApplyResult {
433
+ created: number;
434
+ updated: number;
435
+ unchanged: number;
436
+ prices_added: number;
437
+ issues: string[];
438
+ }
439
+
440
+ /**
441
+ * Operating hours — an organization defines several independent groups (its
442
+ * own office hours, a military field it flies from, the tower, an FBO). Each
443
+ * group is self-contained (own IANA timezone + optional airport) and is
444
+ * materialised server-side into merged, half-open UTC windows; status is
445
+ * answered per group as open / partial / closed / unknown.
446
+ */
447
+ type OperatingHourKind = "company" | "airport" | "atc" | "fbo" | "military" | "fuel" | "customs" | "handling" | "maintenance" | "other";
448
+ type TimeAnchor = "fixed" | "sunrise" | "sunset";
449
+ type OperatingStatusValue = "open" | "partial" | "closed" | "unknown";
450
+ /**
451
+ * One open block. Each bound is a fixed local time, or sunrise/sunset with a
452
+ * signed offset and an optional cap ("SR-30 aber nicht vor 07:00"). An end at
453
+ * or before its start crosses midnight.
454
+ */
455
+ type OperatingHourInterval = {
456
+ id?: number;
457
+ sort: number;
458
+ start_kind: TimeAnchor;
459
+ start_time: string | null;
460
+ start_offset_minutes: number | null;
461
+ start_not_before: string | null;
462
+ end_kind: TimeAnchor;
463
+ end_time: string | null;
464
+ end_offset_minutes: number | null;
465
+ end_not_after: string | null;
466
+ };
467
+ /** One weekday. ISO: 1 = Monday .. 7 = Sunday. */
468
+ type OperatingHourDay = {
469
+ id?: number;
470
+ schedule_id?: number;
471
+ day_of_week: number;
472
+ is_closed: boolean;
473
+ is_24_hours: boolean;
474
+ notes: string | null;
475
+ intervals: OperatingHourInterval[];
476
+ };
477
+ /** A hand-entered override for a date range. No recurrence, by design. */
478
+ type OperatingHourException = {
479
+ id: number;
480
+ schedule_id: number;
481
+ starts_on: string;
482
+ ends_on: string;
483
+ is_closed: boolean;
484
+ is_24_hours: boolean;
485
+ reason: string;
486
+ intervals: OperatingHourInterval[];
487
+ };
488
+ /**
489
+ * What the client composes before an exception exists — no id, no owner yet.
490
+ * The read type above is what comes back; keeping the two apart lets the
491
+ * dialog's `createItem` seed a blank without lying about an id.
492
+ */
493
+ type OperatingHourExceptionInput = Omit<OperatingHourException, "id" | "schedule_id">;
494
+ /** A concrete, merged, half-open UTC window. Derived — read-only. */
495
+ type OperatingHourWindow = {
496
+ starts_at: string;
497
+ ends_at: string;
498
+ };
499
+ /**
500
+ * A group. Self-contained: carries its own timezone and airport, resolved
501
+ * from nowhere else. `materialized_from`/`materialized_through` bound the
502
+ * range in which "no window" genuinely means closed rather than unknown.
503
+ */
504
+ type OperatingHourSchedule = {
505
+ id: number;
506
+ company_id: number;
507
+ airport_id: number | null;
508
+ airport?: {
509
+ id: number;
510
+ ident: string;
511
+ name: string;
512
+ } | null;
513
+ kind: OperatingHourKind;
514
+ name: string;
515
+ description: string | null;
516
+ timezone: string;
517
+ valid_from: string;
518
+ valid_until: string | null;
519
+ is_active: boolean;
520
+ sort_order: number;
521
+ source: string | null;
522
+ verified_at: string | null;
523
+ materialized_from: string | null;
524
+ materialized_through: string | null;
525
+ days: OperatingHourDay[];
526
+ exceptions: OperatingHourException[];
527
+ created_at?: string;
528
+ updated_at?: string;
529
+ };
530
+ /** The fields a client may send when creating a group. */
531
+ type OperatingHourScheduleInput = Partial<Omit<OperatingHourSchedule, "id" | "company_id" | "airport" | "materialized_from" | "materialized_through" | "days" | "exceptions" | "created_at" | "updated_at">>;
532
+ /**
533
+ * What the saved rules resolve to on ONE named calendar date — used for the
534
+ * solstice hints. Carries its own date and status precisely so the extremes
535
+ * can never be merged into a weekday bucket alongside the current week, and
536
+ * so an `unknown` date is reported as unknown rather than as closed.
537
+ */
538
+ type OperatingHourResolvedDate = {
539
+ /** `Y-m-d` in the group's timezone. */
540
+ date: string;
541
+ status: OperatingStatusValue;
542
+ windows: OperatingHourWindow[];
543
+ };
544
+ type OperatingHourStatusEntry = {
545
+ schedule_id: number;
546
+ kind: OperatingHourKind;
547
+ name: string;
548
+ timezone: string;
549
+ status: OperatingStatusValue;
550
+ windows: OperatingHourWindow[];
551
+ };
552
+ type OperatingHoursStatusResponse = {
553
+ from: string;
554
+ to: string;
555
+ data: OperatingHourStatusEntry[];
556
+ };
557
+ type OperatingHoursNextOpenEntry = {
558
+ schedule_id: number;
559
+ kind: OperatingHourKind;
560
+ name: string;
561
+ next_opening: string | null;
562
+ };
563
+ type OperatingHoursNextOpenResponse = {
564
+ after: string;
565
+ data: OperatingHoursNextOpenEntry[];
566
+ };
567
+ type OperatingHoursMeta = {
568
+ kinds: OperatingHourKind[];
569
+ anchors: TimeAnchor[];
570
+ statuses: OperatingStatusValue[];
571
+ max_status_range_days: number;
572
+ };
4
573
 
5
574
  type FboAcceptanceAxis = z.infer<typeof fboAcceptanceAxisSchema>;
6
575
  type FboAcceptanceStatus = z.infer<typeof fboAcceptanceStatusSchema>;
@@ -37,5 +606,12 @@ type FboActivityChanges = z.infer<typeof fboActivityChangesSchema>;
37
606
  type FboActivity = z.infer<typeof fboActivitySchema>;
38
607
  type FboRecurringFlight = z.infer<typeof fboRecurringFlightSchema>;
39
608
  type FboMaterialiseResult = z.infer<typeof fboMaterialiseResultSchema>;
609
+ type FboGrantAbility = z.infer<typeof fboGrantAbilitySchema>;
610
+ type FboGrantAbilityOption = z.infer<typeof fboGrantAbilityOptionSchema>;
611
+ type FboGrantCompanyRef = z.infer<typeof fboGrantCompanyRefSchema>;
612
+ type FboCompanyGrant = z.infer<typeof fboCompanyGrantSchema>;
613
+ type FboCompanyGrantInput = z.infer<typeof fboCompanyGrantInputSchema>;
614
+ type FboMeta = z.infer<typeof fboMetaSchema>;
615
+ type FboCompany = z.infer<typeof fboCompanySchema>;
40
616
 
41
- export type { FboAcceptanceAxis, FboAcceptanceStatus, FboActivity, FboActivityCauser, FboActivityChanges, FboCompanyMember, FboCompanyProfile, FboDecision, FboDecisionAxis, FboDecisionInput, FboDuty, FboDutyAffected, FboDutySeriesResponse, FboFlight, FboFlightDocument, FboFlightStatus, FboFlightType, FboGroundServices, FboLandingsSummary, FboMaterialiseResult, FboNextDuty, FboOccupation, FboOperations, FboPerson, FboPob, FboRecurrence, FboRecurrenceType, FboRecurringFlight, FboRole, FboStatistics, FboSystemRole, FboTrafficRow, FboTrafficSource, FboVisibility, FboWeeklyLanding };
617
+ export type { Activity, Address, AiSuggestedMilestone, AiSuggestion, AiSuggestionStatus, AircraftBlock, AircraftBlockReason, AircraftPosition, AircraftRating, Airplane, AirplaneIssue, AirplaneIssueSeverity, AirplaneIssueStatus, AirplanePermission, AirplaneShareInvite, Airport, Alert, AllowedDocumentType, ApiResponse, ApproachType, Avail, BackgroundTask, BackgroundTaskStatus, BaseMembership, BaseModel, Booking, Comment, Company, ComplianceData, ComplianceGroup, ComplianceGroupSource, ComplianceRequirement, ComplianceRequirementGroup, ComplianceResponse, ComplianceSummary, Course, CourseCheckSyllabus, CourseDescriptionSuggestionPayload, CourseEnrollment, CourseEnrollmentMetrics, CourseFee, CreateAirplaneIssueInput, CreateCommentInput, CreatePostInput, DataWrappedResponse, DeferAirplaneIssueInput, DiscardedRow, Document, DocumentComplianceStatus, DocumentRequirement, DocumentRequirementGroup, DocumentRequirementGroupAssignment, DocumentShare, DocumentType, Event, Expense, ExpenseItem, ExtendedAirplane, FboAcceptanceAxis, FboAcceptanceStatus, FboActivity, FboActivityCauser, FboActivityChanges, FboCompany, FboCompanyGrant, FboCompanyGrantInput, FboCompanyMember, FboCompanyProfile, FboDecision, FboDecisionAxis, FboDecisionInput, FboDuty, FboDutyAffected, FboDutySeriesResponse, FboFlight, FboFlightDocument, FboFlightStatus, FboFlightType, FboGrantAbility, FboGrantAbilityOption, FboGrantCompanyRef, FboGroundServices, FboLandingsSummary, FboMaterialiseResult, FboMeta, FboNextDuty, FboOccupation, FboOperations, FboPerson, FboPob, FboRecurrence, FboRecurrenceType, FboRecurringFlight, FboRole, FboStatistics, FboSystemRole, FboTrafficRow, FboTrafficSource, FboVisibility, FboWeeklyLanding, Fee, FeeCategoryOptions, FlightLog, GroupedPermissions, Invoice, Landing, LandingFee, LandingFeeImportResult, LandingFeeInvoiceApplyPayload, LandingFeeInvoiceApplyResult, LandingFeeInvoicePreview, LandingFeeInvoicePreviewRow, LandingFeeTemplateParams, LogbookFlightLogPayload, LogbookStageResult, LogbookSuggestion, LogbookSuggestionMeta, MaintenanceEvent, MaintenanceEventEstimation, MaintenanceStatus, Media, MediaCollection, Membership, MembershipSignup, OperatingHourDay, OperatingHourException, OperatingHourExceptionInput, OperatingHourInterval, OperatingHourKind, OperatingHourResolvedDate, OperatingHourSchedule, OperatingHourScheduleInput, OperatingHourStatusEntry, OperatingHourWindow, OperatingHoursMeta, OperatingHoursNextOpenEntry, OperatingHoursNextOpenResponse, OperatingHoursStatusResponse, OperatingStatusValue, PaginatedResponse, PermissionItem, Post, PostSubject, PrePaidPackage, Price, Qualification, RecurringFlight, ResolveAirplaneIssueInput, Resource, Role, RoleDetail, RoleListItem, Runway, ScheduledFlight, Setting, SpecialFlight, Tag, TagSyncEntry, Ticket, TimeAnchor, ToggleFavoriteResponse, UpdateAirplaneIssueInput, UpdateCommentInput, UpdatePostInput, User, UserAircraftRating, UserQualification, Waypoint };