@platform-modules/civil-aviation-authority 2.3.24 → 2.3.25

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.
@@ -0,0 +1,93 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum VehicleMaintenanceType {
5
+ PREVENTIVE = "Preventive",
6
+ CORRECTIVE = "Corrective",
7
+ EMERGENCY = "Emergency"
8
+ }
9
+
10
+ export enum VehicleMaintenanceStatus {
11
+ PENDING = "Pending",
12
+ ASSIGNED = "Assigned",
13
+ IN_PROGRESS = "In Progress",
14
+ APPROVED = "Approved",
15
+ REJECTED = "Rejected"
16
+ }
17
+
18
+ @Entity({ name: 'logistics_vehicle_maintenance_requests' })
19
+ export class LogisticsVehicleMaintenanceRequests extends BaseModel {
20
+
21
+ @Column({ type: 'int', nullable: true })
22
+ req_user_department_id: number | null;
23
+
24
+ @Column({ type: 'int', nullable: true })
25
+ req_user_section_id: number | null;
26
+
27
+ @Column({ nullable: true })
28
+ service_id: number;
29
+
30
+ @Column({ nullable: true })
31
+ sub_service_id: number;
32
+
33
+ @Column({ nullable: false })
34
+ user_id: number;
35
+
36
+ @Column({ type: 'varchar', length: 100, nullable: false })
37
+ vehicle_number: string;
38
+
39
+ @Column({
40
+ type: "enum",
41
+ enum: VehicleMaintenanceType,
42
+ nullable: false,
43
+ })
44
+ type_of_maintenance_required: VehicleMaintenanceType;
45
+
46
+ @Column({ type: 'text', nullable: false })
47
+ issue_description: string;
48
+
49
+ @Column({ type: "date", nullable: true })
50
+ preferred_maintenance_date: Date | null;
51
+
52
+ @Column({ type: "date", nullable: false, default: () => "CURRENT_DATE" })
53
+ request_submission_date: Date;
54
+
55
+ @Column({
56
+ type: "enum",
57
+ enum: VehicleMaintenanceStatus,
58
+ default: VehicleMaintenanceStatus.PENDING,
59
+ nullable: false,
60
+ })
61
+ status: VehicleMaintenanceStatus;
62
+
63
+ @Column({ type: "varchar", nullable: true })
64
+ workflow_execution_id: string | null;
65
+
66
+ constructor(
67
+ req_user_department_id: number | null,
68
+ req_user_section_id: number | null,
69
+ service_id: number,
70
+ sub_service_id: number,
71
+ user_id: number,
72
+ vehicle_number: string,
73
+ type_of_maintenance_required: VehicleMaintenanceType,
74
+ issue_description: string,
75
+ status: VehicleMaintenanceStatus,
76
+ preferred_maintenance_date?: Date | null,
77
+ workflow_execution_id?: string | null,
78
+ ) {
79
+ super();
80
+ this.req_user_department_id = req_user_department_id ?? null;
81
+ this.req_user_section_id = req_user_section_id ?? null;
82
+ this.service_id = service_id;
83
+ this.sub_service_id = sub_service_id;
84
+ this.user_id = user_id;
85
+ this.vehicle_number = vehicle_number;
86
+ this.type_of_maintenance_required = type_of_maintenance_required;
87
+ this.issue_description = issue_description;
88
+ this.preferred_maintenance_date = preferred_maintenance_date ?? null;
89
+ this.request_submission_date = new Date();
90
+ this.status = status;
91
+ this.workflow_execution_id = workflow_execution_id ?? null;
92
+ }
93
+ }
@@ -0,0 +1,62 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum LogisticsVehicleMaintenanceWorkFlowStatus {
5
+ COMPLETED = "Completed",
6
+ NOT_YET_STARTED = "Not Yet Started",
7
+ PENDING = "Pending"
8
+ }
9
+
10
+ //This model is used to store the logistics vehicle maintenance workflow status and activity logs
11
+ @Entity({ name: 'logistics_vehicle_maintenance_workflows' })
12
+ export class LogisticsVehicleMaintenanceWorkFlow extends BaseModel {
13
+ @Column({ type: 'integer', nullable: false })
14
+ request_id: number;
15
+
16
+ @Column({ type: 'integer', nullable: true })
17
+ service_id: number | null;
18
+
19
+ @Column({ type: 'integer', nullable: true })
20
+ sub_service_id: number | null;
21
+
22
+ @Column({ type: 'varchar', length: 500, nullable: false })
23
+ content: string;
24
+
25
+ @Column({ type: 'enum', enum: LogisticsVehicleMaintenanceWorkFlowStatus, default: LogisticsVehicleMaintenanceWorkFlowStatus.NOT_YET_STARTED, nullable: false })
26
+ status: LogisticsVehicleMaintenanceWorkFlowStatus;
27
+
28
+ @Column({ type: 'integer', nullable: true })
29
+ user_id: number | null;
30
+
31
+ @Column({ type: 'integer', nullable: true })
32
+ role_id: number | null;
33
+
34
+ @Column({ type: 'integer', nullable: true })
35
+ department_id: number | null;
36
+
37
+ @Column({ type: 'integer', nullable: true })
38
+ section_id: number | null;
39
+
40
+ constructor(
41
+ request_id: number,
42
+ content: string,
43
+ status: LogisticsVehicleMaintenanceWorkFlowStatus,
44
+ service_id?: number,
45
+ sub_service_id?: number,
46
+ user_id?: number,
47
+ role_id?: number,
48
+ department_id?: number,
49
+ section_id?: number
50
+ ) {
51
+ super();
52
+ this.request_id = request_id;
53
+ this.service_id = service_id || null;
54
+ this.sub_service_id = sub_service_id || null;
55
+ this.content = content;
56
+ this.status = status;
57
+ this.user_id = user_id || null;
58
+ this.role_id = role_id || null;
59
+ this.department_id = department_id || null;
60
+ this.section_id = section_id || null;
61
+ }
62
+ }