@updraft-solutions/mcrit-sdk 0.3.1 → 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 (49) hide show
  1. package/dist/chunk-AKLFMP7G.cjs +2525 -0
  2. package/dist/{chunk-MF7G76QS.cjs → chunk-IVMOR5SW.cjs} +26 -1
  3. package/dist/{chunk-D5DUVW34.js → chunk-KIMCBEY7.js} +26 -1
  4. package/dist/chunk-YCIXOVEC.js +2525 -0
  5. package/dist/format/index.cjs +2 -2
  6. package/dist/format/index.d.cts +13 -4
  7. package/dist/format/index.d.ts +13 -4
  8. package/dist/format/index.js +1 -1
  9. package/dist/index.cjs +201 -5
  10. package/dist/index.d.cts +3 -3
  11. package/dist/index.d.ts +3 -3
  12. package/dist/index.js +208 -12
  13. package/dist/schemas/index.cjs +198 -2
  14. package/dist/schemas/index.d.cts +3157 -128
  15. package/dist/schemas/index.d.ts +3157 -128
  16. package/dist/schemas/index.js +201 -5
  17. package/dist/{models-BWmpcfR8.d.cts → training-Der1DPU-.d.cts} +23757 -6528
  18. package/dist/{models-BWmpcfR8.d.ts → training-Der1DPU-.d.ts} +23757 -6528
  19. package/dist/types/index.cjs +1 -1
  20. package/dist/types/index.d.cts +277 -6
  21. package/dist/types/index.d.ts +277 -6
  22. package/dist/types/index.js +1 -1
  23. package/package.json +1 -1
  24. package/src/format/index.ts +51 -5
  25. package/src/index.ts +39 -0
  26. package/src/schemas/common.ts +37 -0
  27. package/src/schemas/course-milestone.ts +78 -0
  28. package/src/schemas/equipment.ts +27 -0
  29. package/src/schemas/form-template.ts +413 -0
  30. package/src/schemas/index.ts +7 -1
  31. package/src/schemas/location-map.ts +175 -0
  32. package/src/schemas/models.ts +110 -28
  33. package/src/schemas/newsletter.ts +362 -0
  34. package/src/schemas/todo.ts +46 -0
  35. package/src/schemas/training.ts +500 -0
  36. package/src/types/ai.ts +85 -0
  37. package/src/types/aircraft-block.ts +23 -0
  38. package/src/types/api.ts +3 -1
  39. package/src/types/background-task.ts +28 -0
  40. package/src/types/compliance.ts +27 -3
  41. package/src/types/index.ts +5 -0
  42. package/src/types/landing-fee.ts +92 -0
  43. package/src/types/models.ts +44 -0
  44. package/src/types/roles.ts +26 -0
  45. package/dist/chunk-7QF3OJ45.cjs +0 -1325
  46. package/dist/chunk-FS5I4MBG.js +0 -1325
  47. package/src/schemas/fee.ts +0 -37
  48. /package/dist/{chunk-LXNCAKJZ.js → chunk-2WJHTRIE.js} +0 -0
  49. /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,6 +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>;
46
+ export type FeeCategoryOptions = z.infer<
47
+ typeof ModelSchemas.feeCategoryOptionsSchema
48
+ >;
49
+ export type Tag = z.infer<typeof ModelSchemas.tagSchema>;
50
+ export type CourseCheckSyllabus = z.infer<typeof courseCheckSyllabusSchema>;
45
51
  export type Price = z.infer<typeof ModelSchemas.priceSchema>;
46
52
 
47
53
  // Maintenance types
@@ -119,6 +125,44 @@ export type AirplaneIssueStatus = z.infer<
119
125
  export type Event = z.infer<typeof ModelSchemas.eventSchema>;
120
126
  export type Ticket = z.infer<typeof ModelSchemas.ticketSchema>;
121
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
+
122
166
  export type Comment = z.infer<typeof ModelSchemas.commentSchema>;
123
167
 
124
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
+ }