@updraft-solutions/mcrit-sdk 0.1.0 → 0.3.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.
- package/dist/{chunk-AN55SAGU.js → chunk-4A2CDUAO.js} +147 -26
- package/dist/{chunk-XKZQ5W7E.cjs → chunk-S632QB2N.cjs} +148 -27
- package/dist/index.cjs +12 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +11 -1
- package/dist/{models-CY3MmvCg.d.cts → models-DOcMz5Pd.d.cts} +3555 -1495
- package/dist/{models-CY3MmvCg.d.ts → models-DOcMz5Pd.d.ts} +3555 -1495
- package/dist/schemas/index.cjs +12 -2
- package/dist/schemas/index.d.cts +1 -1
- package/dist/schemas/index.d.ts +1 -1
- package/dist/schemas/index.js +11 -1
- package/dist/types/index.d.cts +7 -2
- package/dist/types/index.d.ts +7 -2
- package/package.json +9 -8
- package/src/index.ts +1 -0
- package/src/schemas/common.ts +3 -0
- package/src/schemas/models.ts +175 -31
- package/src/types/models.ts +15 -0
package/dist/schemas/index.cjs
CHANGED
|
@@ -76,12 +76,12 @@
|
|
|
76
76
|
|
|
77
77
|
|
|
78
78
|
|
|
79
|
-
var _chunkXKZQ5W7Ecjs = require('../chunk-XKZQ5W7E.cjs');
|
|
80
79
|
|
|
81
80
|
|
|
82
81
|
|
|
83
82
|
|
|
84
83
|
|
|
84
|
+
var _chunkS632QB2Ncjs = require('../chunk-S632QB2N.cjs');
|
|
85
85
|
|
|
86
86
|
|
|
87
87
|
|
|
@@ -155,4 +155,14 @@ var _chunkXKZQ5W7Ecjs = require('../chunk-XKZQ5W7E.cjs');
|
|
|
155
155
|
|
|
156
156
|
|
|
157
157
|
|
|
158
|
-
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
exports.BaseModel = _chunkS632QB2Ncjs.BaseModel; exports.FaqSchema = _chunkS632QB2Ncjs.FaqSchema; exports.FaqStatus = _chunkS632QB2Ncjs.FaqStatus; exports.FeeCategoryOptionsSchema = _chunkS632QB2Ncjs.FeeCategoryOptionsSchema; exports.FeeSchema = _chunkS632QB2Ncjs.FeeSchema; exports.ReviewFaqSchema = _chunkS632QB2Ncjs.ReviewFaqSchema; exports.SAFETY_REPORT_STATUS_COLORS = _chunkS632QB2Ncjs.SAFETY_REPORT_STATUS_COLORS; exports.SAFETY_REPORT_STATUS_LABELS = _chunkS632QB2Ncjs.SAFETY_REPORT_STATUS_LABELS; exports.SafetyReportCategoryFormSchema = _chunkS632QB2Ncjs.SafetyReportCategoryFormSchema; exports.SafetyReportCategorySchema = _chunkS632QB2Ncjs.SafetyReportCategorySchema; exports.SafetyReportFilterSchema = _chunkS632QB2Ncjs.SafetyReportFilterSchema; exports.SafetyReportFormSchema = _chunkS632QB2Ncjs.SafetyReportFormSchema; exports.SafetyReportListResponseSchema = _chunkS632QB2Ncjs.SafetyReportListResponseSchema; exports.SafetyReportMediaSchema = _chunkS632QB2Ncjs.SafetyReportMediaSchema; exports.SafetyReportSchema = _chunkS632QB2Ncjs.SafetyReportSchema; exports.SafetyReportStatusEnum = _chunkS632QB2Ncjs.SafetyReportStatusEnum; exports.SafetyReportSubmissionResponseSchema = _chunkS632QB2Ncjs.SafetyReportSubmissionResponseSchema; exports.SafetyReportUpdateSchema = _chunkS632QB2Ncjs.SafetyReportUpdateSchema; exports.SubmitFaqQuestionSchema = _chunkS632QB2Ncjs.SubmitFaqQuestionSchema; exports.addressSchema = _chunkS632QB2Ncjs.addressSchema; exports.aircraftRatingSchema = _chunkS632QB2Ncjs.aircraftRatingSchema; exports.airplaneIssueSchema = _chunkS632QB2Ncjs.airplaneIssueSchema; exports.airplaneIssueSeverityEnum = _chunkS632QB2Ncjs.airplaneIssueSeverityEnum; exports.airplaneIssueStatusEnum = _chunkS632QB2Ncjs.airplaneIssueStatusEnum; exports.airplanePermissionSchema = _chunkS632QB2Ncjs.airplanePermissionSchema; exports.airplaneSchema = _chunkS632QB2Ncjs.airplaneSchema; exports.airplaneShareInviteSchema = _chunkS632QB2Ncjs.airplaneShareInviteSchema; exports.airportSchema = _chunkS632QB2Ncjs.airportSchema; exports.alertSchema = _chunkS632QB2Ncjs.alertSchema; exports.allowedDocumentTypeSchema = _chunkS632QB2Ncjs.allowedDocumentTypeSchema; exports.approachTypeSchema = _chunkS632QB2Ncjs.approachTypeSchema; exports.availSchema = _chunkS632QB2Ncjs.availSchema; exports.baseMembershipSchema = _chunkS632QB2Ncjs.baseMembershipSchema; exports.bookingSchema = _chunkS632QB2Ncjs.bookingSchema; exports.commentSchema = _chunkS632QB2Ncjs.commentSchema; exports.companySchema = _chunkS632QB2Ncjs.companySchema; exports.contactAttributeSchema = _chunkS632QB2Ncjs.contactAttributeSchema; exports.courseEnrollmentMetricsSchema = _chunkS632QB2Ncjs.courseEnrollmentMetricsSchema; exports.courseEnrollmentSchema = _chunkS632QB2Ncjs.courseEnrollmentSchema; exports.courseFeeSchema = _chunkS632QB2Ncjs.courseFeeSchema; exports.courseSchema = _chunkS632QB2Ncjs.courseSchema; exports.documentComplianceStatus = _chunkS632QB2Ncjs.documentComplianceStatus; exports.documentRequirement = _chunkS632QB2Ncjs.documentRequirement; exports.documentRequirementGroup = _chunkS632QB2Ncjs.documentRequirementGroup; exports.documentRequirementGroupAssignment = _chunkS632QB2Ncjs.documentRequirementGroupAssignment; exports.documentSchema = _chunkS632QB2Ncjs.documentSchema; exports.documentShareSchema = _chunkS632QB2Ncjs.documentShareSchema; exports.documentType = _chunkS632QB2Ncjs.documentType; exports.eventSchema = _chunkS632QB2Ncjs.eventSchema; exports.expenseItemSchema = _chunkS632QB2Ncjs.expenseItemSchema; exports.expenseSchema = _chunkS632QB2Ncjs.expenseSchema; exports.extendedAirplaneSchema = _chunkS632QB2Ncjs.extendedAirplaneSchema; exports.feeSchema = _chunkS632QB2Ncjs.feeSchema; exports.flightLogSchema = _chunkS632QB2Ncjs.flightLogSchema; exports.invoiceSchema = _chunkS632QB2Ncjs.invoiceSchema; exports.landingFeeSchema = _chunkS632QB2Ncjs.landingFeeSchema; exports.landingSchema = _chunkS632QB2Ncjs.landingSchema; exports.maintenanceEventEstimationSchema = _chunkS632QB2Ncjs.maintenanceEventEstimationSchema; exports.maintenanceEventSchema = _chunkS632QB2Ncjs.maintenanceEventSchema; exports.maintenanceStatusSchema = _chunkS632QB2Ncjs.maintenanceStatusSchema; exports.mediaCollection = _chunkS632QB2Ncjs.mediaCollection; exports.mediaSchema = _chunkS632QB2Ncjs.mediaSchema; exports.membershipSchema = _chunkS632QB2Ncjs.membershipSchema; exports.postSchema = _chunkS632QB2Ncjs.postSchema; exports.prePaidPackageSchema = _chunkS632QB2Ncjs.prePaidPackageSchema; exports.priceSchema = _chunkS632QB2Ncjs.priceSchema; exports.qualificationSchema = _chunkS632QB2Ncjs.qualificationSchema; exports.recurringFlightSchema = _chunkS632QB2Ncjs.recurringFlightSchema; exports.roleSchema = _chunkS632QB2Ncjs.roleSchema; exports.runwaySchema = _chunkS632QB2Ncjs.runwaySchema; exports.scheduledFlightSchema = _chunkS632QB2Ncjs.scheduledFlightSchema; exports.settingSchema = _chunkS632QB2Ncjs.settingSchema; exports.specialFlightSchema = _chunkS632QB2Ncjs.specialFlightSchema; exports.ticketSchema = _chunkS632QB2Ncjs.ticketSchema; exports.userAircraftRatingSchema = _chunkS632QB2Ncjs.userAircraftRatingSchema; exports.userQualificationSchema = _chunkS632QB2Ncjs.userQualificationSchema; exports.userSchema = _chunkS632QB2Ncjs.userSchema; exports.waypointSchema = _chunkS632QB2Ncjs.waypointSchema; exports.zContactDTO = _chunkS632QB2Ncjs.zContactDTO; exports.zNetGross = _chunkS632QB2Ncjs.zNetGross; exports.zNullableBool = _chunkS632QB2Ncjs.zNullableBool; exports.zPhpMoneyObject = _chunkS632QB2Ncjs.zPhpMoneyObject;
|
package/dist/schemas/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BaseModel, a as addressSchema, b as aircraftRatingSchema, c as
|
|
1
|
+
export { B as BaseModel, a as addressSchema, b as aircraftRatingSchema, c as airplaneIssueSchema, d as airplaneIssueSeverityEnum, e as airplaneIssueStatusEnum, f as airplanePermissionSchema, g as airplaneSchema, h as airplaneShareInviteSchema, i as airportSchema, j as alertSchema, k as allowedDocumentTypeSchema, l as approachTypeSchema, m as availSchema, n as baseMembershipSchema, o as bookingSchema, p as commentSchema, q as companySchema, r as contactAttributeSchema, s as courseEnrollmentMetricsSchema, t as courseEnrollmentSchema, u as courseFeeSchema, v as courseSchema, w as documentComplianceStatus, x as documentRequirement, y as documentRequirementGroup, z as documentRequirementGroupAssignment, A as documentSchema, C as documentShareSchema, D as documentType, E as eventSchema, F as expenseItemSchema, G as expenseSchema, H as extendedAirplaneSchema, I as feeSchema, J as flightLogSchema, K as invoiceSchema, L as landingFeeSchema, M as landingSchema, N as maintenanceEventEstimationSchema, O as maintenanceEventSchema, P as maintenanceStatusSchema, Q as mediaCollection, R as mediaSchema, S as membershipSchema, T as postSchema, U as prePaidPackageSchema, V as priceSchema, W as qualificationSchema, X as recurringFlightSchema, Y as roleSchema, Z as runwaySchema, _ as scheduledFlightSchema, $ as settingSchema, a0 as specialFlightSchema, a1 as ticketSchema, a2 as userAircraftRatingSchema, a3 as userQualificationSchema, a4 as userSchema, a5 as waypointSchema, a6 as zContactDTO, a7 as zNetGross, a8 as zNullableBool, a9 as zPhpMoneyObject } from '../models-DOcMz5Pd.cjs';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
declare enum FaqStatus {
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BaseModel, a as addressSchema, b as aircraftRatingSchema, c as
|
|
1
|
+
export { B as BaseModel, a as addressSchema, b as aircraftRatingSchema, c as airplaneIssueSchema, d as airplaneIssueSeverityEnum, e as airplaneIssueStatusEnum, f as airplanePermissionSchema, g as airplaneSchema, h as airplaneShareInviteSchema, i as airportSchema, j as alertSchema, k as allowedDocumentTypeSchema, l as approachTypeSchema, m as availSchema, n as baseMembershipSchema, o as bookingSchema, p as commentSchema, q as companySchema, r as contactAttributeSchema, s as courseEnrollmentMetricsSchema, t as courseEnrollmentSchema, u as courseFeeSchema, v as courseSchema, w as documentComplianceStatus, x as documentRequirement, y as documentRequirementGroup, z as documentRequirementGroupAssignment, A as documentSchema, C as documentShareSchema, D as documentType, E as eventSchema, F as expenseItemSchema, G as expenseSchema, H as extendedAirplaneSchema, I as feeSchema, J as flightLogSchema, K as invoiceSchema, L as landingFeeSchema, M as landingSchema, N as maintenanceEventEstimationSchema, O as maintenanceEventSchema, P as maintenanceStatusSchema, Q as mediaCollection, R as mediaSchema, S as membershipSchema, T as postSchema, U as prePaidPackageSchema, V as priceSchema, W as qualificationSchema, X as recurringFlightSchema, Y as roleSchema, Z as runwaySchema, _ as scheduledFlightSchema, $ as settingSchema, a0 as specialFlightSchema, a1 as ticketSchema, a2 as userAircraftRatingSchema, a3 as userQualificationSchema, a4 as userSchema, a5 as waypointSchema, a6 as zContactDTO, a7 as zNetGross, a8 as zNullableBool, a9 as zPhpMoneyObject } from '../models-DOcMz5Pd.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
declare enum FaqStatus {
|
package/dist/schemas/index.js
CHANGED
|
@@ -20,8 +20,12 @@ import {
|
|
|
20
20
|
SubmitFaqQuestionSchema,
|
|
21
21
|
addressSchema,
|
|
22
22
|
aircraftRatingSchema,
|
|
23
|
+
airplaneIssueSchema,
|
|
24
|
+
airplaneIssueSeverityEnum,
|
|
25
|
+
airplaneIssueStatusEnum,
|
|
23
26
|
airplanePermissionSchema,
|
|
24
27
|
airplaneSchema,
|
|
28
|
+
airplaneShareInviteSchema,
|
|
25
29
|
airportSchema,
|
|
26
30
|
alertSchema,
|
|
27
31
|
allowedDocumentTypeSchema,
|
|
@@ -32,6 +36,7 @@ import {
|
|
|
32
36
|
commentSchema,
|
|
33
37
|
companySchema,
|
|
34
38
|
contactAttributeSchema,
|
|
39
|
+
courseEnrollmentMetricsSchema,
|
|
35
40
|
courseEnrollmentSchema,
|
|
36
41
|
courseFeeSchema,
|
|
37
42
|
courseSchema,
|
|
@@ -76,7 +81,7 @@ import {
|
|
|
76
81
|
zNetGross,
|
|
77
82
|
zNullableBool,
|
|
78
83
|
zPhpMoneyObject
|
|
79
|
-
} from "../chunk-
|
|
84
|
+
} from "../chunk-4A2CDUAO.js";
|
|
80
85
|
export {
|
|
81
86
|
BaseModel,
|
|
82
87
|
FaqSchema,
|
|
@@ -99,8 +104,12 @@ export {
|
|
|
99
104
|
SubmitFaqQuestionSchema,
|
|
100
105
|
addressSchema,
|
|
101
106
|
aircraftRatingSchema,
|
|
107
|
+
airplaneIssueSchema,
|
|
108
|
+
airplaneIssueSeverityEnum,
|
|
109
|
+
airplaneIssueStatusEnum,
|
|
102
110
|
airplanePermissionSchema,
|
|
103
111
|
airplaneSchema,
|
|
112
|
+
airplaneShareInviteSchema,
|
|
104
113
|
airportSchema,
|
|
105
114
|
alertSchema,
|
|
106
115
|
allowedDocumentTypeSchema,
|
|
@@ -111,6 +120,7 @@ export {
|
|
|
111
120
|
commentSchema,
|
|
112
121
|
companySchema,
|
|
113
122
|
contactAttributeSchema,
|
|
123
|
+
courseEnrollmentMetricsSchema,
|
|
114
124
|
courseEnrollmentSchema,
|
|
115
125
|
courseFeeSchema,
|
|
116
126
|
courseSchema,
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { a as addressSchema, b as aircraftRatingSchema,
|
|
2
|
+
import { a as addressSchema, b as aircraftRatingSchema, g as airplaneSchema, f as airplanePermissionSchema, h as airplaneShareInviteSchema, i as airportSchema, j as alertSchema, k as allowedDocumentTypeSchema, l as approachTypeSchema, m as availSchema, n as baseMembershipSchema, o as bookingSchema, p as commentSchema, q as companySchema, v as courseSchema, t as courseEnrollmentSchema, u as courseFeeSchema, A as documentSchema, w as documentComplianceStatus, x as documentRequirement, y as documentRequirementGroup, z as documentRequirementGroupAssignment, C as documentShareSchema, D as documentType, E as eventSchema, G as expenseSchema, F as expenseItemSchema, H as extendedAirplaneSchema, J as flightLogSchema, K as invoiceSchema, M as landingSchema, L as landingFeeSchema, O as maintenanceEventSchema, N as maintenanceEventEstimationSchema, P as maintenanceStatusSchema, Q as mediaCollection, S as membershipSchema, T as postSchema, U as prePaidPackageSchema, V as priceSchema, W as qualificationSchema, X as recurringFlightSchema, Y as roleSchema, Z as runwaySchema, _ as scheduledFlightSchema, $ as settingSchema, a0 as specialFlightSchema, a1 as ticketSchema, a4 as userSchema, a2 as userAircraftRatingSchema, a3 as userQualificationSchema, a5 as waypointSchema, c as airplaneIssueSchema, d as airplaneIssueSeverityEnum, e as airplaneIssueStatusEnum, B as BaseModel$1, s as courseEnrollmentMetricsSchema, I as feeSchema, R as mediaSchema } from '../models-DOcMz5Pd.cjs';
|
|
3
3
|
|
|
4
4
|
type BaseModel = z.infer<typeof BaseModel$1>;
|
|
5
5
|
type User = z.infer<typeof userSchema>;
|
|
@@ -11,6 +11,7 @@ type Membership = z.infer<typeof membershipSchema>;
|
|
|
11
11
|
type Airplane = z.infer<typeof airplaneSchema>;
|
|
12
12
|
type ExtendedAirplane = z.infer<typeof extendedAirplaneSchema>;
|
|
13
13
|
type AirplanePermission = z.infer<typeof airplanePermissionSchema>;
|
|
14
|
+
type AirplaneShareInvite = z.infer<typeof airplaneShareInviteSchema>;
|
|
14
15
|
type LandingFee = z.infer<typeof landingFeeSchema>;
|
|
15
16
|
type AircraftRating = z.infer<typeof aircraftRatingSchema>;
|
|
16
17
|
type UserAircraftRating = z.infer<typeof userAircraftRatingSchema>;
|
|
@@ -47,6 +48,10 @@ type PrePaidPackage = z.infer<typeof prePaidPackageSchema>;
|
|
|
47
48
|
type Qualification = z.infer<typeof qualificationSchema>;
|
|
48
49
|
type Course = z.infer<typeof courseSchema>;
|
|
49
50
|
type CourseEnrollment = z.infer<typeof courseEnrollmentSchema>;
|
|
51
|
+
type CourseEnrollmentMetrics = z.infer<typeof courseEnrollmentMetricsSchema>;
|
|
52
|
+
type AirplaneIssue = z.infer<typeof airplaneIssueSchema>;
|
|
53
|
+
type AirplaneIssueSeverity = z.infer<typeof airplaneIssueSeverityEnum>;
|
|
54
|
+
type AirplaneIssueStatus = z.infer<typeof airplaneIssueStatusEnum>;
|
|
50
55
|
type Event = z.infer<typeof eventSchema>;
|
|
51
56
|
type Ticket = z.infer<typeof ticketSchema>;
|
|
52
57
|
type Post = z.infer<typeof postSchema>;
|
|
@@ -140,4 +145,4 @@ interface ComplianceResponse {
|
|
|
140
145
|
};
|
|
141
146
|
}
|
|
142
147
|
|
|
143
|
-
export type { Address, AircraftRating, Airplane, AirplanePermission, Airport, Alert, AllowedDocumentType, ApproachType, Avail, BaseMembership, BaseModel, Booking, Comment, Company, ComplianceData, ComplianceGroup, ComplianceRequirement, ComplianceRequirementGroup, ComplianceResponse, ComplianceSummary, Course, CourseEnrollment, CourseFee, CreateCommentInput, DataWrappedResponse, Document, DocumentComplianceStatus, DocumentRequirement, DocumentRequirementGroup, DocumentRequirementGroupAssignment, DocumentShare, DocumentType, Event, Expense, ExpenseItem, ExtendedAirplane, Fee, FlightLog, Invoice, Landing, LandingFee, MaintenanceEvent, MaintenanceEventEstimation, MaintenanceStatus, Media, MediaCollection, Membership, PaginatedResponse, Post, PrePaidPackage, Price, Qualification, RecurringFlight, Resource, Role, Runway, ScheduledFlight, Setting, SpecialFlight, Ticket, ToggleFavoriteResponse, UpdateCommentInput, User, UserAircraftRating, UserQualification, Waypoint };
|
|
148
|
+
export type { Address, AircraftRating, Airplane, AirplaneIssue, AirplaneIssueSeverity, AirplaneIssueStatus, AirplanePermission, AirplaneShareInvite, Airport, Alert, AllowedDocumentType, ApproachType, Avail, BaseMembership, BaseModel, Booking, Comment, Company, ComplianceData, ComplianceGroup, ComplianceRequirement, ComplianceRequirementGroup, ComplianceResponse, ComplianceSummary, Course, CourseEnrollment, CourseEnrollmentMetrics, CourseFee, CreateCommentInput, DataWrappedResponse, Document, DocumentComplianceStatus, DocumentRequirement, DocumentRequirementGroup, DocumentRequirementGroupAssignment, DocumentShare, DocumentType, Event, Expense, ExpenseItem, ExtendedAirplane, Fee, FlightLog, Invoice, Landing, LandingFee, MaintenanceEvent, MaintenanceEventEstimation, MaintenanceStatus, Media, MediaCollection, Membership, PaginatedResponse, Post, PrePaidPackage, Price, Qualification, RecurringFlight, Resource, Role, Runway, ScheduledFlight, Setting, SpecialFlight, Ticket, ToggleFavoriteResponse, UpdateCommentInput, User, UserAircraftRating, UserQualification, Waypoint };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { a as addressSchema, b as aircraftRatingSchema,
|
|
2
|
+
import { a as addressSchema, b as aircraftRatingSchema, g as airplaneSchema, f as airplanePermissionSchema, h as airplaneShareInviteSchema, i as airportSchema, j as alertSchema, k as allowedDocumentTypeSchema, l as approachTypeSchema, m as availSchema, n as baseMembershipSchema, o as bookingSchema, p as commentSchema, q as companySchema, v as courseSchema, t as courseEnrollmentSchema, u as courseFeeSchema, A as documentSchema, w as documentComplianceStatus, x as documentRequirement, y as documentRequirementGroup, z as documentRequirementGroupAssignment, C as documentShareSchema, D as documentType, E as eventSchema, G as expenseSchema, F as expenseItemSchema, H as extendedAirplaneSchema, J as flightLogSchema, K as invoiceSchema, M as landingSchema, L as landingFeeSchema, O as maintenanceEventSchema, N as maintenanceEventEstimationSchema, P as maintenanceStatusSchema, Q as mediaCollection, S as membershipSchema, T as postSchema, U as prePaidPackageSchema, V as priceSchema, W as qualificationSchema, X as recurringFlightSchema, Y as roleSchema, Z as runwaySchema, _ as scheduledFlightSchema, $ as settingSchema, a0 as specialFlightSchema, a1 as ticketSchema, a4 as userSchema, a2 as userAircraftRatingSchema, a3 as userQualificationSchema, a5 as waypointSchema, c as airplaneIssueSchema, d as airplaneIssueSeverityEnum, e as airplaneIssueStatusEnum, B as BaseModel$1, s as courseEnrollmentMetricsSchema, I as feeSchema, R as mediaSchema } from '../models-DOcMz5Pd.js';
|
|
3
3
|
|
|
4
4
|
type BaseModel = z.infer<typeof BaseModel$1>;
|
|
5
5
|
type User = z.infer<typeof userSchema>;
|
|
@@ -11,6 +11,7 @@ type Membership = z.infer<typeof membershipSchema>;
|
|
|
11
11
|
type Airplane = z.infer<typeof airplaneSchema>;
|
|
12
12
|
type ExtendedAirplane = z.infer<typeof extendedAirplaneSchema>;
|
|
13
13
|
type AirplanePermission = z.infer<typeof airplanePermissionSchema>;
|
|
14
|
+
type AirplaneShareInvite = z.infer<typeof airplaneShareInviteSchema>;
|
|
14
15
|
type LandingFee = z.infer<typeof landingFeeSchema>;
|
|
15
16
|
type AircraftRating = z.infer<typeof aircraftRatingSchema>;
|
|
16
17
|
type UserAircraftRating = z.infer<typeof userAircraftRatingSchema>;
|
|
@@ -47,6 +48,10 @@ type PrePaidPackage = z.infer<typeof prePaidPackageSchema>;
|
|
|
47
48
|
type Qualification = z.infer<typeof qualificationSchema>;
|
|
48
49
|
type Course = z.infer<typeof courseSchema>;
|
|
49
50
|
type CourseEnrollment = z.infer<typeof courseEnrollmentSchema>;
|
|
51
|
+
type CourseEnrollmentMetrics = z.infer<typeof courseEnrollmentMetricsSchema>;
|
|
52
|
+
type AirplaneIssue = z.infer<typeof airplaneIssueSchema>;
|
|
53
|
+
type AirplaneIssueSeverity = z.infer<typeof airplaneIssueSeverityEnum>;
|
|
54
|
+
type AirplaneIssueStatus = z.infer<typeof airplaneIssueStatusEnum>;
|
|
50
55
|
type Event = z.infer<typeof eventSchema>;
|
|
51
56
|
type Ticket = z.infer<typeof ticketSchema>;
|
|
52
57
|
type Post = z.infer<typeof postSchema>;
|
|
@@ -140,4 +145,4 @@ interface ComplianceResponse {
|
|
|
140
145
|
};
|
|
141
146
|
}
|
|
142
147
|
|
|
143
|
-
export type { Address, AircraftRating, Airplane, AirplanePermission, Airport, Alert, AllowedDocumentType, ApproachType, Avail, BaseMembership, BaseModel, Booking, Comment, Company, ComplianceData, ComplianceGroup, ComplianceRequirement, ComplianceRequirementGroup, ComplianceResponse, ComplianceSummary, Course, CourseEnrollment, CourseFee, CreateCommentInput, DataWrappedResponse, Document, DocumentComplianceStatus, DocumentRequirement, DocumentRequirementGroup, DocumentRequirementGroupAssignment, DocumentShare, DocumentType, Event, Expense, ExpenseItem, ExtendedAirplane, Fee, FlightLog, Invoice, Landing, LandingFee, MaintenanceEvent, MaintenanceEventEstimation, MaintenanceStatus, Media, MediaCollection, Membership, PaginatedResponse, Post, PrePaidPackage, Price, Qualification, RecurringFlight, Resource, Role, Runway, ScheduledFlight, Setting, SpecialFlight, Ticket, ToggleFavoriteResponse, UpdateCommentInput, User, UserAircraftRating, UserQualification, Waypoint };
|
|
148
|
+
export type { Address, AircraftRating, Airplane, AirplaneIssue, AirplaneIssueSeverity, AirplaneIssueStatus, AirplanePermission, AirplaneShareInvite, Airport, Alert, AllowedDocumentType, ApproachType, Avail, BaseMembership, BaseModel, Booking, Comment, Company, ComplianceData, ComplianceGroup, ComplianceRequirement, ComplianceRequirementGroup, ComplianceResponse, ComplianceSummary, Course, CourseEnrollment, CourseEnrollmentMetrics, CourseFee, CreateCommentInput, DataWrappedResponse, Document, DocumentComplianceStatus, DocumentRequirement, DocumentRequirementGroup, DocumentRequirementGroupAssignment, DocumentShare, DocumentType, Event, Expense, ExpenseItem, ExtendedAirplane, Fee, FlightLog, Invoice, Landing, LandingFee, MaintenanceEvent, MaintenanceEventEstimation, MaintenanceStatus, Media, MediaCollection, Membership, PaginatedResponse, Post, PrePaidPackage, Price, Qualification, RecurringFlight, Resource, Role, Runway, ScheduledFlight, Setting, SpecialFlight, Ticket, ToggleFavoriteResponse, UpdateCommentInput, User, UserAircraftRating, UserQualification, Waypoint };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@updraft-solutions/mcrit-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Shared TypeScript types, Zod schemas, and pure helpers for the MCRIT aviation fleet management platform",
|
|
5
5
|
"homepage": "https://github.com/updraft-solutions/mcrit-sdk#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -133,6 +133,13 @@
|
|
|
133
133
|
"src",
|
|
134
134
|
"README.md"
|
|
135
135
|
],
|
|
136
|
+
"scripts": {
|
|
137
|
+
"build": "tsup",
|
|
138
|
+
"dev": "tsup --watch",
|
|
139
|
+
"typecheck": "tsc --noEmit",
|
|
140
|
+
"test": "vitest run",
|
|
141
|
+
"prepublishOnly": "pnpm build"
|
|
142
|
+
},
|
|
136
143
|
"publishConfig": {
|
|
137
144
|
"access": "public"
|
|
138
145
|
},
|
|
@@ -161,11 +168,5 @@
|
|
|
161
168
|
"typescript": "^5.7.0",
|
|
162
169
|
"vitest": "^3.0.0",
|
|
163
170
|
"vue": "^3.5.0"
|
|
164
|
-
},
|
|
165
|
-
"scripts": {
|
|
166
|
-
"build": "tsup",
|
|
167
|
-
"dev": "tsup --watch",
|
|
168
|
-
"typecheck": "tsc --noEmit",
|
|
169
|
-
"test": "vitest run"
|
|
170
171
|
}
|
|
171
|
-
}
|
|
172
|
+
}
|
package/src/index.ts
CHANGED
package/src/schemas/common.ts
CHANGED
|
@@ -70,4 +70,7 @@ export const companySchema = z.object({
|
|
|
70
70
|
id: z.number(),
|
|
71
71
|
name: z.string(),
|
|
72
72
|
media: mediaCollection,
|
|
73
|
+
can: z.record(z.string(), z.boolean().nullable()).optional(),
|
|
74
|
+
permissions: z.array(z.string()).optional(),
|
|
75
|
+
ai_landing_fee_invoices_enabled: z.boolean().optional(),
|
|
73
76
|
});
|
package/src/schemas/models.ts
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
BaseModel,
|
|
4
4
|
companySchema,
|
|
5
5
|
contactAttributeSchema,
|
|
6
|
+
mediaCollection,
|
|
6
7
|
mediaSchema,
|
|
7
8
|
userSchema,
|
|
8
9
|
zContactDTO,
|
|
@@ -19,11 +20,24 @@ export const baseMembershipSchema = z.object({
|
|
|
19
20
|
company_id: z.number(),
|
|
20
21
|
company: companySchema.nullable().optional(),
|
|
21
22
|
name: z.string(),
|
|
23
|
+
phone: z.string().nullable().optional(),
|
|
22
24
|
status: z.string(),
|
|
23
25
|
instructor: z.boolean(),
|
|
24
26
|
admin: z.boolean(),
|
|
25
27
|
accountant: z.boolean(),
|
|
26
28
|
student: z.boolean(),
|
|
29
|
+
content_creator: z.boolean(),
|
|
30
|
+
charter_client: z.boolean(),
|
|
31
|
+
roles: z
|
|
32
|
+
.array(
|
|
33
|
+
z
|
|
34
|
+
.object({
|
|
35
|
+
id: z.number(),
|
|
36
|
+
name: z.string(),
|
|
37
|
+
})
|
|
38
|
+
.passthrough(),
|
|
39
|
+
)
|
|
40
|
+
.optional(),
|
|
27
41
|
created_at: z.string(),
|
|
28
42
|
updated_at: z.string(),
|
|
29
43
|
can: z
|
|
@@ -105,6 +119,7 @@ export const courseFeeSchema = feeSchema.extend({
|
|
|
105
119
|
count: z.number().optional(),
|
|
106
120
|
variant: z.string().optional(),
|
|
107
121
|
is_optional: z.boolean().optional(),
|
|
122
|
+
is_initial_payment: z.boolean().optional(),
|
|
108
123
|
});
|
|
109
124
|
|
|
110
125
|
export const airplaneSchema = BaseModel.extend({
|
|
@@ -113,20 +128,23 @@ export const airplaneSchema = BaseModel.extend({
|
|
|
113
128
|
company_id: z.number(),
|
|
114
129
|
registration: z.string(),
|
|
115
130
|
model: z.string(),
|
|
116
|
-
media:
|
|
117
|
-
.object({
|
|
118
|
-
avatar: mediaSchema.nullable().optional(),
|
|
119
|
-
header: mediaSchema.nullable().optional(),
|
|
120
|
-
images: z.array(mediaSchema).nullable().optional(),
|
|
121
|
-
documents: z.array(mediaSchema).nullable().optional(),
|
|
122
|
-
})
|
|
123
|
-
.nullable()
|
|
124
|
-
.optional()
|
|
125
|
-
.optional(),
|
|
131
|
+
media: mediaCollection.optional(),
|
|
126
132
|
fee: feeSchema.optional(),
|
|
127
133
|
booking_fee: feeSchema.optional(),
|
|
128
134
|
hasFavorited: z.boolean().optional(),
|
|
129
135
|
homebase_id: z.number().nullable().optional(),
|
|
136
|
+
hangar_location_map_feature_id: z.number().nullable().optional(),
|
|
137
|
+
parking_lng: z.number().nullable().optional(),
|
|
138
|
+
parking_lat: z.number().nullable().optional(),
|
|
139
|
+
hangar: z
|
|
140
|
+
.object({
|
|
141
|
+
id: z.number(),
|
|
142
|
+
name: z.string().nullable(),
|
|
143
|
+
kind: z.string(),
|
|
144
|
+
location_map_id: z.number(),
|
|
145
|
+
})
|
|
146
|
+
.nullable()
|
|
147
|
+
.optional(),
|
|
130
148
|
description: z.string().optional(),
|
|
131
149
|
capacity: z.number().optional(),
|
|
132
150
|
manufacturer: z.string().optional(),
|
|
@@ -136,16 +154,36 @@ export const airplaneSchema = BaseModel.extend({
|
|
|
136
154
|
length: z.string().optional(),
|
|
137
155
|
ato: z.boolean().optional(),
|
|
138
156
|
restricted_access: z.boolean().optional(),
|
|
157
|
+
global_airplane_id: z.number().nullable().optional(),
|
|
158
|
+
is_master: z.boolean().optional(),
|
|
159
|
+
master_company_id: z.number().nullable().optional(),
|
|
160
|
+
shared_companies: z
|
|
161
|
+
.array(z.object({ id: z.number(), name: z.string() }))
|
|
162
|
+
.optional(),
|
|
139
163
|
can: z.object({
|
|
140
164
|
view: zNullableBool,
|
|
141
165
|
update: zNullableBool,
|
|
142
166
|
viewMaintenanceEvents: zNullableBool,
|
|
143
167
|
createMaintenanceEvents: zNullableBool,
|
|
144
168
|
createBooking: zNullableBool,
|
|
145
|
-
|
|
169
|
+
createAirplanePermissions: zNullableBool,
|
|
146
170
|
}),
|
|
147
171
|
});
|
|
148
172
|
|
|
173
|
+
export const airplaneShareInviteSchema = z.object({
|
|
174
|
+
id: z.number(),
|
|
175
|
+
status: z.enum(["pending", "accepted", "declined", "withdrawn"]),
|
|
176
|
+
responded_at: z.string().nullable().optional(),
|
|
177
|
+
created_at: z.string().optional(),
|
|
178
|
+
global_airplane: z.object({
|
|
179
|
+
id: z.number(),
|
|
180
|
+
registration: z.string(),
|
|
181
|
+
model: z.string(),
|
|
182
|
+
}),
|
|
183
|
+
master_company: z.object({ id: z.number(), name: z.string() }),
|
|
184
|
+
invited_company: z.object({ id: z.number(), name: z.string() }),
|
|
185
|
+
});
|
|
186
|
+
|
|
149
187
|
export const airplanePermissionSchema = z.object({
|
|
150
188
|
type: z.literal("airplane_permission"),
|
|
151
189
|
id: z.number(),
|
|
@@ -311,6 +349,7 @@ export const extendedAirplaneSchema = airplaneSchema.extend({
|
|
|
311
349
|
documents: z.array(z.any()).optional(),
|
|
312
350
|
})
|
|
313
351
|
.optional(),
|
|
352
|
+
master_media: mediaCollection.optional(),
|
|
314
353
|
can: z
|
|
315
354
|
.object({
|
|
316
355
|
update: zNullableBool,
|
|
@@ -338,11 +377,10 @@ export const bookingSchema = BaseModel.extend({
|
|
|
338
377
|
ifr: z.boolean().default(false),
|
|
339
378
|
airplane_id: z.number(),
|
|
340
379
|
author: userSchema.optional(),
|
|
341
|
-
attendants: z.array(userSchema).optional(),
|
|
342
380
|
company_id: z.number(),
|
|
381
|
+
company_name: z.string().nullable().optional(),
|
|
343
382
|
company: companySchema.optional(),
|
|
344
383
|
airplane: airplaneSchema.optional(),
|
|
345
|
-
attendant_ids: z.array(z.number()).optional(),
|
|
346
384
|
etdZ: z.string(),
|
|
347
385
|
etaZ: z.string(),
|
|
348
386
|
duration_minutes: z.number().optional(),
|
|
@@ -353,6 +391,28 @@ export const bookingSchema = BaseModel.extend({
|
|
|
353
391
|
next_booking_id: z.number().nullable().optional(),
|
|
354
392
|
previous_booking_id: z.number().nullable().optional(),
|
|
355
393
|
maintenance: z.number().optional(),
|
|
394
|
+
is_solo: z.boolean().optional().default(false),
|
|
395
|
+
course_enrollment_id: z.number().nullable().optional(),
|
|
396
|
+
// Minimal linked enrollment, present on booking show/store/update payloads.
|
|
397
|
+
// Used by the form prefill registry to derive the J2 Flugauftrag course.
|
|
398
|
+
course_enrollment: z
|
|
399
|
+
.object({
|
|
400
|
+
id: z.number(),
|
|
401
|
+
course_id: z.number().nullable().optional(),
|
|
402
|
+
})
|
|
403
|
+
.nullable()
|
|
404
|
+
.optional(),
|
|
405
|
+
crew_assignments: z
|
|
406
|
+
.array(
|
|
407
|
+
z.object({
|
|
408
|
+
id: z.number().optional(),
|
|
409
|
+
membership_id: z.number(),
|
|
410
|
+
role: z.string(),
|
|
411
|
+
is_pic: z.boolean().optional(),
|
|
412
|
+
membership: z.any().optional(),
|
|
413
|
+
}),
|
|
414
|
+
)
|
|
415
|
+
.optional(),
|
|
356
416
|
contact: zContactDTO.optional(),
|
|
357
417
|
remarks: z.string().optional(),
|
|
358
418
|
can: z
|
|
@@ -400,11 +460,22 @@ export const documentSchema = z.object({
|
|
|
400
460
|
.optional(),
|
|
401
461
|
});
|
|
402
462
|
|
|
463
|
+
// Post merge-phase-3a a requirement references a FormTemplate
|
|
464
|
+
// (`form_template_id` + nested `form_template`) instead of a DocumentType
|
|
465
|
+
// FQCN. Schema NAMES keep the `document*` prefix, matching the backend's
|
|
466
|
+
// kept `documentRequirementGroups` route names (the legacy document domain
|
|
467
|
+
// itself was deleted in merge Phase 4).
|
|
403
468
|
export const documentRequirement = z.object({
|
|
404
469
|
id: z.number(),
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
470
|
+
form_requirement_group_id: z.number(),
|
|
471
|
+
form_template_id: z.number(),
|
|
472
|
+
form_template: z
|
|
473
|
+
.object({
|
|
474
|
+
id: z.number(),
|
|
475
|
+
name: z.string(),
|
|
476
|
+
slug: z.string().nullable().optional(),
|
|
477
|
+
})
|
|
478
|
+
.optional(),
|
|
408
479
|
logical_group: z.string().nullable().optional(),
|
|
409
480
|
group_operator: z.enum(["AND", "OR"]).nullable().optional(),
|
|
410
481
|
metadata: z
|
|
@@ -429,10 +500,10 @@ export const documentRequirementGroup = z.object({
|
|
|
429
500
|
company_id: z.number().nullable().optional(),
|
|
430
501
|
is_default_template: z.boolean().default(false),
|
|
431
502
|
is_active: z.boolean().default(true),
|
|
432
|
-
requirements: z.array(documentRequirement).optional(),
|
|
433
|
-
documentRequirements: z.array(documentRequirement).optional(),
|
|
503
|
+
requirements: z.array(documentRequirement).optional(), // Backend uses 'requirements'
|
|
504
|
+
documentRequirements: z.array(documentRequirement).optional(), // Frontend compatibility
|
|
434
505
|
group_operator: z.enum(["AND", "OR"]).default("AND"),
|
|
435
|
-
|
|
506
|
+
documentRequirements_count: z.number().optional(),
|
|
436
507
|
assignments_count: z.number().optional(),
|
|
437
508
|
created_by: z.number().nullable().optional(),
|
|
438
509
|
updated_by: z.number().nullable().optional(),
|
|
@@ -451,9 +522,9 @@ export const documentRequirementGroupAssignment = z.object({
|
|
|
451
522
|
id: z.number(),
|
|
452
523
|
assignable_type: z.string(),
|
|
453
524
|
assignable_id: z.number(),
|
|
454
|
-
|
|
525
|
+
requirement_group_id: z.number(),
|
|
455
526
|
requirement_group: documentRequirementGroup.optional(),
|
|
456
|
-
requirementGroup: documentRequirementGroup.optional(),
|
|
527
|
+
requirementGroup: documentRequirementGroup.optional(), // Frontend compatibility
|
|
457
528
|
created_at: z.string(),
|
|
458
529
|
updated_at: z.string(),
|
|
459
530
|
});
|
|
@@ -574,11 +645,21 @@ export const flightLogSchema = z.object({
|
|
|
574
645
|
etdZ: z.string(),
|
|
575
646
|
etaZ: z.string(),
|
|
576
647
|
duration_minutes: z.number(),
|
|
577
|
-
|
|
578
|
-
|
|
648
|
+
crew_assignments: z
|
|
649
|
+
.array(
|
|
650
|
+
z.object({
|
|
651
|
+
id: z.number().optional(),
|
|
652
|
+
membership_id: z.number(),
|
|
653
|
+
role: z.string(),
|
|
654
|
+
is_pic: z.boolean().optional(),
|
|
655
|
+
membership: z.any().optional(),
|
|
656
|
+
}),
|
|
657
|
+
)
|
|
658
|
+
.optional(),
|
|
579
659
|
total_landings: z.number().nullable().optional(),
|
|
580
660
|
full_stop_landings: z.number().nullable().optional(),
|
|
581
661
|
touch_and_gos: z.number().default(0),
|
|
662
|
+
low_approaches: z.number().default(0),
|
|
582
663
|
flight_rule: z.string().nullable().optional(),
|
|
583
664
|
flight_time_type: z.string().nullable().optional(),
|
|
584
665
|
dep_airport_id: z.number().nullable().optional(),
|
|
@@ -632,6 +713,7 @@ export const invoiceSchema = z.object({
|
|
|
632
713
|
recipient_zip: z.string().nullable().optional(),
|
|
633
714
|
recipient_state: z.string().nullable().optional(),
|
|
634
715
|
recipient_country: z.string().nullable().optional(),
|
|
716
|
+
recipient_vat_id: z.string().nullable().optional(),
|
|
635
717
|
issuer_name: z.string().nullable().optional(),
|
|
636
718
|
issuer_address_street_1: z.string().nullable().optional(),
|
|
637
719
|
issuer_address_street_2: z.string().nullable().optional(),
|
|
@@ -727,6 +809,21 @@ export const courseSchema = z.object({
|
|
|
727
809
|
.optional(),
|
|
728
810
|
});
|
|
729
811
|
|
|
812
|
+
/**
|
|
813
|
+
* Materialized, admin-only metrics for an enrollment — recomputed server-side
|
|
814
|
+
* (see m-crit-api course_enrollment_metrics). `flags` is an extensible bag of
|
|
815
|
+
* computed booleans (e.g. `has_solo`).
|
|
816
|
+
*/
|
|
817
|
+
export const courseEnrollmentMetricsSchema = z.object({
|
|
818
|
+
last_flight_at: z.string().nullable(),
|
|
819
|
+
next_flight_at: z.string().nullable(),
|
|
820
|
+
total_flight_minutes: z.number().default(0),
|
|
821
|
+
flags: z
|
|
822
|
+
.record(z.string(), z.union([z.boolean(), z.number(), z.string()]))
|
|
823
|
+
.default({}),
|
|
824
|
+
calculated_at: z.string().nullable(),
|
|
825
|
+
});
|
|
826
|
+
|
|
730
827
|
export const courseEnrollmentSchema = z.object({
|
|
731
828
|
type: z.literal("course_enrollment").optional(),
|
|
732
829
|
id: z.number(),
|
|
@@ -738,7 +835,11 @@ export const courseEnrollmentSchema = z.object({
|
|
|
738
835
|
enrollment_date: z.string(),
|
|
739
836
|
completion_date: z.string().nullable().optional(),
|
|
740
837
|
progress_percentage: z.number().default(0),
|
|
838
|
+
milestone_count: z.number().optional(),
|
|
741
839
|
comments: z.string().nullable().optional(),
|
|
840
|
+
initial_payment_generated: z.boolean().optional(),
|
|
841
|
+
initial_payment_removable: z.boolean().optional(),
|
|
842
|
+
metrics: courseEnrollmentMetricsSchema.optional(),
|
|
742
843
|
created_at: z.string(),
|
|
743
844
|
updated_at: z.string(),
|
|
744
845
|
course: courseSchema.optional(),
|
|
@@ -792,6 +893,7 @@ export const addressSchema = z.object({
|
|
|
792
893
|
state: z.string().nullable().optional(),
|
|
793
894
|
country: z.string().nullable().optional(),
|
|
794
895
|
additional_info: z.string().nullable().optional(),
|
|
896
|
+
vat_id: z.string().nullable().optional(),
|
|
795
897
|
created_at: z.string(),
|
|
796
898
|
updated_at: z.string(),
|
|
797
899
|
});
|
|
@@ -877,21 +979,26 @@ export const settingSchema = z.object({
|
|
|
877
979
|
export const postSchema = z.object({
|
|
878
980
|
type: z.literal("post"),
|
|
879
981
|
id: z.number(),
|
|
880
|
-
|
|
881
|
-
|
|
982
|
+
company_id: z.number(),
|
|
983
|
+
postable_type: z.string().nullable().optional(),
|
|
984
|
+
postable_id: z.number().nullable().optional(),
|
|
882
985
|
author_id: z.number(),
|
|
883
986
|
author: userSchema.optional(),
|
|
884
|
-
title: z.string(),
|
|
987
|
+
title: z.string().nullable().optional(),
|
|
885
988
|
content: z.string(),
|
|
886
|
-
|
|
887
|
-
|
|
989
|
+
sticky: z.boolean().default(false),
|
|
990
|
+
public: z.boolean().default(false),
|
|
991
|
+
media: mediaCollection.optional(),
|
|
888
992
|
created_at: z.string(),
|
|
889
993
|
updated_at: z.string(),
|
|
890
994
|
can: z
|
|
891
995
|
.object({
|
|
996
|
+
view: zNullableBool,
|
|
892
997
|
update: zNullableBool,
|
|
893
998
|
delete: zNullableBool,
|
|
894
|
-
|
|
999
|
+
setFlags: zNullableBool,
|
|
1000
|
+
restore: zNullableBool,
|
|
1001
|
+
forceDelete: zNullableBool,
|
|
895
1002
|
})
|
|
896
1003
|
.optional(),
|
|
897
1004
|
});
|
|
@@ -906,7 +1013,6 @@ export const commentSchema = z.object({
|
|
|
906
1013
|
body: z.string(),
|
|
907
1014
|
author_id: z.number().optional(),
|
|
908
1015
|
author: userSchema.optional(),
|
|
909
|
-
resolved_at: z.string().optional().nullable(),
|
|
910
1016
|
created_at: z.string(),
|
|
911
1017
|
updated_at: z.string().optional(),
|
|
912
1018
|
children: z.lazy((): z.ZodTypeAny => commentSchema.array()).optional(),
|
|
@@ -915,7 +1021,6 @@ export const commentSchema = z.object({
|
|
|
915
1021
|
view: z.boolean().optional(),
|
|
916
1022
|
update: z.boolean().optional().nullable(),
|
|
917
1023
|
delete: z.boolean().optional().nullable(),
|
|
918
|
-
resolve: z.boolean().optional(),
|
|
919
1024
|
reply: z.boolean().optional(),
|
|
920
1025
|
viewComments: z.boolean().optional(),
|
|
921
1026
|
createComments: z.boolean().optional(),
|
|
@@ -923,6 +1028,45 @@ export const commentSchema = z.object({
|
|
|
923
1028
|
.optional(),
|
|
924
1029
|
});
|
|
925
1030
|
|
|
1031
|
+
// Airplane issue (aviation defect log) — matches backend AirplaneIssueResource
|
|
1032
|
+
export const airplaneIssueSeverityEnum = z.enum([
|
|
1033
|
+
"minor",
|
|
1034
|
+
"major",
|
|
1035
|
+
"grounding",
|
|
1036
|
+
]);
|
|
1037
|
+
export const airplaneIssueStatusEnum = z.enum(["open", "deferred", "resolved"]);
|
|
1038
|
+
|
|
1039
|
+
export const airplaneIssueSchema = z.object({
|
|
1040
|
+
type: z.literal("airplaneIssue"),
|
|
1041
|
+
id: z.number(),
|
|
1042
|
+
airplane_id: z.number(),
|
|
1043
|
+
title: z.string().nullable().optional(),
|
|
1044
|
+
body: z.string(),
|
|
1045
|
+
severity: airplaneIssueSeverityEnum,
|
|
1046
|
+
ata_chapter: z.string().nullable().optional(),
|
|
1047
|
+
status: airplaneIssueStatusEnum,
|
|
1048
|
+
reporter: userSchema.optional(),
|
|
1049
|
+
resolver: userSchema.optional(),
|
|
1050
|
+
deferred_at: z.string().nullable().optional(),
|
|
1051
|
+
deferred_until: z.string().nullable().optional(),
|
|
1052
|
+
deferral_notes: z.string().nullable().optional(),
|
|
1053
|
+
resolved_at: z.string().nullable().optional(),
|
|
1054
|
+
resolution_notes: z.string().nullable().optional(),
|
|
1055
|
+
attachments: z.array(mediaSchema).optional(),
|
|
1056
|
+
created_at: z.string(),
|
|
1057
|
+
updated_at: z.string().optional(),
|
|
1058
|
+
can: z
|
|
1059
|
+
.object({
|
|
1060
|
+
view: z.boolean().nullable().optional(),
|
|
1061
|
+
update: z.boolean().nullable().optional(),
|
|
1062
|
+
resolve: z.boolean().nullable().optional(),
|
|
1063
|
+
defer: z.boolean().nullable().optional(),
|
|
1064
|
+
reopen: z.boolean().nullable().optional(),
|
|
1065
|
+
delete: z.boolean().nullable().optional(),
|
|
1066
|
+
})
|
|
1067
|
+
.optional(),
|
|
1068
|
+
});
|
|
1069
|
+
|
|
926
1070
|
export const specialFlightSchema = z.object({
|
|
927
1071
|
type: z.literal("specialFlight"),
|
|
928
1072
|
id: z.number(),
|