@updraft-solutions/mcrit-sdk 0.4.0 → 0.5.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.
Files changed (42) hide show
  1. package/dist/chunk-AKLFMP7G.cjs +2525 -0
  2. package/dist/chunk-YCIXOVEC.js +2525 -0
  3. package/dist/index.cjs +193 -3
  4. package/dist/index.d.cts +3 -3
  5. package/dist/index.d.ts +3 -3
  6. package/dist/index.js +196 -6
  7. package/dist/schemas/index.cjs +192 -2
  8. package/dist/schemas/index.d.cts +3123 -94
  9. package/dist/schemas/index.d.ts +3123 -94
  10. package/dist/schemas/index.js +195 -5
  11. package/dist/{models-Bc5BKYuI.d.cts → training-Der1DPU-.d.cts} +17563 -1056
  12. package/dist/{models-Bc5BKYuI.d.ts → training-Der1DPU-.d.ts} +17563 -1056
  13. package/dist/types/index.cjs +1 -1
  14. package/dist/types/index.d.cts +275 -6
  15. package/dist/types/index.d.ts +275 -6
  16. package/dist/types/index.js +1 -1
  17. package/package.json +1 -1
  18. package/src/index.ts +39 -0
  19. package/src/schemas/common.ts +33 -0
  20. package/src/schemas/course-milestone.ts +78 -0
  21. package/src/schemas/equipment.ts +27 -0
  22. package/src/schemas/form-template.ts +413 -0
  23. package/src/schemas/index.ts +7 -1
  24. package/src/schemas/location-map.ts +175 -0
  25. package/src/schemas/models.ts +38 -20
  26. package/src/schemas/newsletter.ts +362 -0
  27. package/src/schemas/todo.ts +46 -0
  28. package/src/schemas/training.ts +500 -0
  29. package/src/types/ai.ts +85 -0
  30. package/src/types/aircraft-block.ts +23 -0
  31. package/src/types/api.ts +3 -1
  32. package/src/types/background-task.ts +28 -0
  33. package/src/types/compliance.ts +27 -3
  34. package/src/types/index.ts +5 -0
  35. package/src/types/landing-fee.ts +92 -0
  36. package/src/types/models.ts +43 -3
  37. package/src/types/roles.ts +26 -0
  38. package/dist/chunk-RC2BBT6H.cjs +0 -1384
  39. package/dist/chunk-WQLDSZNN.js +0 -1384
  40. package/src/schemas/fee.ts +0 -37
  41. /package/dist/{chunk-LXNCAKJZ.js → chunk-2WJHTRIE.js} +0 -0
  42. /package/dist/{chunk-MOOGM3DW.cjs → chunk-DCEOET63.cjs} +0 -0
@@ -1,10 +1,24 @@
1
+ import type { FormSubmission } from "../schemas/form-template";
2
+
1
3
  export interface ComplianceRequirement {
2
4
  requirement_id: number;
3
- document_type_class: string;
4
- document_type_label: string;
5
+ form_template_id: number;
6
+ form_template_name: string;
5
7
  logical_group: string;
6
8
  is_satisfied: boolean;
7
- document: any | null;
9
+ // True when the member has already signed the satisfying submission and
10
+ // only the company's counter-signature is outstanding (e.g. the INflight
11
+ // Chartervertrag). The requirement is still unsatisfied, but the member
12
+ // isn't the blocker — consumers refine this into an `awaiting_countersign`
13
+ // display state.
14
+ awaiting_countersignature?: boolean;
15
+ // The submission to display for this requirement: the satisfying (final,
16
+ // non-expired) one when present, otherwise the latest expired /
17
+ // awaiting-signatures submission so the UI can explain *why* an unmet
18
+ // requirement is unmet (abgelaufen / wartet auf Unterschriften) instead of
19
+ // just "missing". Null only when no relevant submission exists at all.
20
+ // Satisfaction is decided by `is_satisfied`, never by this field's presence.
21
+ submission: FormSubmission | null;
8
22
  }
9
23
 
10
24
  export interface ComplianceRequirementGroup {
@@ -14,11 +28,21 @@ export interface ComplianceRequirementGroup {
14
28
  requirements: ComplianceRequirement[];
15
29
  }
16
30
 
31
+ // Where a requirement group's applicability comes from (annotated per group
32
+ // by the backend's HasFormRequirementGroups::getComplianceStatus()):
33
+ // direct assignment, a company role mapping, or a compliance-enforcing
34
+ // airplane the member has access to.
35
+ export type ComplianceGroupSource =
36
+ | { type: "direct" }
37
+ | { type: "role"; role: string }
38
+ | { type: "airplane"; airplane_id: number; registration: string };
39
+
17
40
  export interface ComplianceGroup {
18
41
  group_id: number;
19
42
  group_name: string;
20
43
  overall_satisfied: boolean;
21
44
  requirement_groups: ComplianceRequirementGroup[];
45
+ sources?: ComplianceGroupSource[];
22
46
  }
23
47
 
24
48
  export interface ComplianceSummary {
@@ -1,3 +1,8 @@
1
1
  export * from "./models";
2
2
  export * from "./api";
3
3
  export * from "./compliance";
4
+ export * from "./aircraft-block";
5
+ export * from "./background-task";
6
+ export * from "./ai";
7
+ export * from "./roles";
8
+ export * from "./landing-fee";
@@ -0,0 +1,92 @@
1
+ // Landing-fee bulk import (template upload + AI invoice import) contracts.
2
+
3
+ export interface LandingFeeTemplateParams {
4
+ landing_type: "FULLSTOP" | "TOUCHANDGO" | "LOWAPPROACH";
5
+ net_gross: "net" | "gross";
6
+ valid_from: string; // Y-m-d
7
+ tax_percentage?: number;
8
+ approach_type_id?: number;
9
+ }
10
+
11
+ export interface LandingFeeImportResult {
12
+ created: number;
13
+ updated: number;
14
+ unchanged: number;
15
+ prices_added: number;
16
+ skipped: number;
17
+ issues: string[];
18
+ preview: Array<
19
+ [string, string, string, string, string, "new" | "update" | "unchanged"]
20
+ >;
21
+ meta: {
22
+ landing_type: string;
23
+ approach_type_id: number;
24
+ net_gross: string;
25
+ tax_percentage: number;
26
+ valid_from: string;
27
+ };
28
+ }
29
+
30
+ export interface LandingFeeInvoicePreviewRow {
31
+ registration: string;
32
+ airplane_id: number | null;
33
+ fee_type: string;
34
+ landing_type: string | null;
35
+ unit_price: number;
36
+ price_basis: "net" | "gross";
37
+ vat_rate: number | null;
38
+ net_total: number | null;
39
+ gross_total: number | null;
40
+ current_price: number | null;
41
+ current_net_total: number | null;
42
+ current_gross_total: number | null;
43
+ date: string | null;
44
+ start_time: string | null;
45
+ landing_time: string | null;
46
+ status:
47
+ | "new"
48
+ | "changed"
49
+ | "unchanged"
50
+ | "unmatched-aircraft"
51
+ | "unmapped-fee-type"
52
+ | "airport-unknown";
53
+ }
54
+
55
+ export interface LandingFeeInvoicePreview {
56
+ rejected: boolean;
57
+ message: string | null;
58
+ company_id: number;
59
+ airport: { id: number; ident: string; name: string } | null;
60
+ invoice: {
61
+ number: string | null;
62
+ date: string | null;
63
+ currency: string | null;
64
+ issuing_airport_name: string | null;
65
+ suggested_airport_icao_ident: string | null;
66
+ };
67
+ landing_fee_rows: LandingFeeInvoicePreviewRow[];
68
+ other_fees: Array<Record<string, unknown>>;
69
+ warnings: Array<{ type: string; message: string }>;
70
+ }
71
+
72
+ export interface LandingFeeInvoiceApplyPayload {
73
+ airport_id: number;
74
+ valid_from: string;
75
+ tax_percentage: number;
76
+ approach_type_id: number;
77
+ rows: Array<{
78
+ airplane_id: number;
79
+ landing_type: string;
80
+ unit_price: number;
81
+ price_basis: "net" | "gross";
82
+ vat_rate: number | null;
83
+ }>;
84
+ }
85
+
86
+ export interface LandingFeeInvoiceApplyResult {
87
+ created: number;
88
+ updated: number;
89
+ unchanged: number;
90
+ prices_added: number;
91
+ issues: string[];
92
+ }
@@ -1,6 +1,7 @@
1
1
  import type { z } from "zod";
2
2
  import type * as Common from "../schemas/common";
3
3
  import type * as ModelSchemas from "../schemas/models";
4
+ import type { courseCheckSyllabusSchema } from "../schemas/training";
4
5
 
5
6
  // Common types
6
7
  export type BaseModel = z.infer<typeof Common.BaseModel>;
@@ -42,10 +43,11 @@ export type RecurringFlight = z.infer<
42
43
  // Fee types
43
44
  export type Fee = z.infer<typeof ModelSchemas.feeSchema>;
44
45
  export type CourseFee = z.infer<typeof ModelSchemas.courseFeeSchema>;
45
- export type Tag = z.infer<typeof ModelSchemas.tagSchema>;
46
- export type CourseCheckSyllabus = z.infer<
47
- typeof ModelSchemas.courseCheckSyllabusSchema
46
+ export type FeeCategoryOptions = z.infer<
47
+ typeof ModelSchemas.feeCategoryOptionsSchema
48
48
  >;
49
+ export type Tag = z.infer<typeof ModelSchemas.tagSchema>;
50
+ export type CourseCheckSyllabus = z.infer<typeof courseCheckSyllabusSchema>;
49
51
  export type Price = z.infer<typeof ModelSchemas.priceSchema>;
50
52
 
51
53
  // Maintenance types
@@ -123,6 +125,44 @@ export type AirplaneIssueStatus = z.infer<
123
125
  export type Event = z.infer<typeof ModelSchemas.eventSchema>;
124
126
  export type Ticket = z.infer<typeof ModelSchemas.ticketSchema>;
125
127
  export type Post = z.infer<typeof ModelSchemas.postSchema>;
128
+
129
+ export interface CreatePostInput {
130
+ title?: string | null;
131
+ content: string;
132
+ sticky?: boolean;
133
+ public?: boolean;
134
+ }
135
+
136
+ export interface UpdatePostInput {
137
+ title?: string | null;
138
+ content: string;
139
+ sticky?: boolean;
140
+ public?: boolean;
141
+ }
142
+
143
+ export interface CreateAirplaneIssueInput {
144
+ title?: string | null;
145
+ body: string;
146
+ severity?: AirplaneIssueSeverity;
147
+ ata_chapter?: string | null;
148
+ }
149
+
150
+ export interface UpdateAirplaneIssueInput {
151
+ title?: string | null;
152
+ body?: string;
153
+ severity?: AirplaneIssueSeverity;
154
+ ata_chapter?: string | null;
155
+ }
156
+
157
+ export interface ResolveAirplaneIssueInput {
158
+ resolution_notes?: string | null;
159
+ }
160
+
161
+ export interface DeferAirplaneIssueInput {
162
+ deferred_until?: string | null;
163
+ deferral_notes?: string | null;
164
+ }
165
+
126
166
  export type Comment = z.infer<typeof ModelSchemas.commentSchema>;
127
167
 
128
168
  export interface CreateCommentInput {
@@ -0,0 +1,26 @@
1
+ // Roles & permissions admin shapes (company role editor + permission matrix).
2
+
3
+ export interface RoleListItem {
4
+ id: number;
5
+ name: string;
6
+ description: string | null;
7
+ is_system: boolean;
8
+ has_duties: boolean;
9
+ company_id: number | null;
10
+ permissions_count: number;
11
+ }
12
+
13
+ export interface PermissionItem {
14
+ id: number;
15
+ name: string;
16
+ description: string | null;
17
+ group: string;
18
+ }
19
+
20
+ export interface RoleDetail extends Omit<RoleListItem, "permissions_count"> {
21
+ permissions: PermissionItem[];
22
+ }
23
+
24
+ export interface GroupedPermissions {
25
+ [group: string]: PermissionItem[];
26
+ }