@platform-modules/civil-aviation-authority 2.3.24 → 2.3.26
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/data-source.js +10 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +16 -2
- package/dist/models/LogisticsVehicleMaintenanceApprovalModel.d.ts +23 -0
- package/dist/models/LogisticsVehicleMaintenanceApprovalModel.js +96 -0
- package/dist/models/LogisticsVehicleMaintenanceAttachmentModel.d.ts +12 -0
- package/dist/models/LogisticsVehicleMaintenanceAttachmentModel.js +64 -0
- package/dist/models/LogisticsVehicleMaintenanceChatModel.d.ts +20 -0
- package/dist/models/LogisticsVehicleMaintenanceChatModel.js +78 -0
- package/dist/models/LogisticsVehicleMaintenanceRequestModel.d.ts +28 -0
- package/dist/models/LogisticsVehicleMaintenanceRequestModel.js +107 -0
- package/dist/models/LogisticsVehicleMaintenanceWorkflowModel.d.ts +18 -0
- package/dist/models/LogisticsVehicleMaintenanceWorkflowModel.js +76 -0
- package/dist/models/ShiftAllowanceRequestModel.d.ts +37 -0
- package/dist/models/ShiftAllowanceRequestModel.js +140 -0
- package/package.json +1 -1
- package/src/data-source.ts +10 -0
- package/src/index.ts +9 -0
- package/src/models/LogisticsVehicleMaintenanceApprovalModel.ts +83 -0
- package/src/models/LogisticsVehicleMaintenanceAttachmentModel.ts +52 -0
- package/src/models/LogisticsVehicleMaintenanceChatModel.ts +65 -0
- package/src/models/LogisticsVehicleMaintenanceRequestModel.ts +93 -0
- package/src/models/LogisticsVehicleMaintenanceWorkflowModel.ts +62 -0
- package/src/models/ShiftAllowanceRequestModel.ts +126 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { BaseModel } from "./BaseModel";
|
|
2
|
+
export declare enum ShiftAllowanceRequestStatus {
|
|
3
|
+
PENDING = "Pending",
|
|
4
|
+
ASSIGNED = "Assigned",
|
|
5
|
+
IN_PROGRESS = "In Progress",
|
|
6
|
+
COMPLETED = "Completed",
|
|
7
|
+
APPROVED = "Approved",
|
|
8
|
+
REJECTED = "Rejected"
|
|
9
|
+
}
|
|
10
|
+
export declare enum ShiftAllowanceValue {
|
|
11
|
+
TWENTY_TWO_PERCENT = "22%",
|
|
12
|
+
THIRTY_PERCENT = "30%",
|
|
13
|
+
SEVENTY_PERCENT = "70%"
|
|
14
|
+
}
|
|
15
|
+
export declare class ShiftAllowanceRequest extends BaseModel {
|
|
16
|
+
req_user_department_id: number | null;
|
|
17
|
+
req_user_section_id: number | null;
|
|
18
|
+
req_user_position_id: number | null;
|
|
19
|
+
service_id: number | null;
|
|
20
|
+
sub_service_id: number | null;
|
|
21
|
+
user_id: number;
|
|
22
|
+
description: string | null;
|
|
23
|
+
status: ShiftAllowanceRequestStatus;
|
|
24
|
+
reviewer_user_id: number | null;
|
|
25
|
+
assigned_to_user_id: number | null;
|
|
26
|
+
assigned_at: Date | null;
|
|
27
|
+
workflow_execution_id: string | null;
|
|
28
|
+
employee_name: string;
|
|
29
|
+
employee_id: string;
|
|
30
|
+
job_title: string;
|
|
31
|
+
financial_grade: string;
|
|
32
|
+
allowance_value: ShiftAllowanceValue;
|
|
33
|
+
shift_start_date: Date;
|
|
34
|
+
shift_end_date: Date;
|
|
35
|
+
reason_for_request: string | null;
|
|
36
|
+
constructor(user_id: number, status?: ShiftAllowanceRequestStatus, service_id?: number | null, sub_service_id?: number | null, req_user_department_id?: number | null, req_user_section_id?: number | null, req_user_position_id?: number | null, description?: string | null, reviewer_user_id?: number | null, assigned_to_user_id?: number | null, assigned_at?: Date | null, workflow_execution_id?: string | null, employee_name?: string, employee_id?: string, job_title?: string, financial_grade?: string, allowance_value?: ShiftAllowanceValue, shift_start_date?: Date, shift_end_date?: Date, reason_for_request?: string | null);
|
|
37
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ShiftAllowanceRequest = exports.ShiftAllowanceValue = exports.ShiftAllowanceRequestStatus = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
var ShiftAllowanceRequestStatus;
|
|
16
|
+
(function (ShiftAllowanceRequestStatus) {
|
|
17
|
+
ShiftAllowanceRequestStatus["PENDING"] = "Pending";
|
|
18
|
+
ShiftAllowanceRequestStatus["ASSIGNED"] = "Assigned";
|
|
19
|
+
ShiftAllowanceRequestStatus["IN_PROGRESS"] = "In Progress";
|
|
20
|
+
ShiftAllowanceRequestStatus["COMPLETED"] = "Completed";
|
|
21
|
+
ShiftAllowanceRequestStatus["APPROVED"] = "Approved";
|
|
22
|
+
ShiftAllowanceRequestStatus["REJECTED"] = "Rejected";
|
|
23
|
+
})(ShiftAllowanceRequestStatus || (exports.ShiftAllowanceRequestStatus = ShiftAllowanceRequestStatus = {}));
|
|
24
|
+
var ShiftAllowanceValue;
|
|
25
|
+
(function (ShiftAllowanceValue) {
|
|
26
|
+
ShiftAllowanceValue["TWENTY_TWO_PERCENT"] = "22%";
|
|
27
|
+
ShiftAllowanceValue["THIRTY_PERCENT"] = "30%";
|
|
28
|
+
ShiftAllowanceValue["SEVENTY_PERCENT"] = "70%";
|
|
29
|
+
})(ShiftAllowanceValue || (exports.ShiftAllowanceValue = ShiftAllowanceValue = {}));
|
|
30
|
+
let ShiftAllowanceRequest = class ShiftAllowanceRequest extends BaseModel_1.BaseModel {
|
|
31
|
+
constructor(user_id, status = ShiftAllowanceRequestStatus.PENDING, service_id, sub_service_id, req_user_department_id, req_user_section_id, req_user_position_id, description, reviewer_user_id, assigned_to_user_id, assigned_at, workflow_execution_id, employee_name, employee_id, job_title, financial_grade, allowance_value, shift_start_date, shift_end_date, reason_for_request) {
|
|
32
|
+
super();
|
|
33
|
+
this.user_id = user_id;
|
|
34
|
+
this.status = status;
|
|
35
|
+
this.service_id = service_id || null;
|
|
36
|
+
this.sub_service_id = sub_service_id || null;
|
|
37
|
+
this.req_user_department_id = req_user_department_id || null;
|
|
38
|
+
this.req_user_section_id = req_user_section_id || null;
|
|
39
|
+
this.req_user_position_id = req_user_position_id || null;
|
|
40
|
+
this.description = description || null;
|
|
41
|
+
this.reviewer_user_id = reviewer_user_id || null;
|
|
42
|
+
this.assigned_to_user_id = assigned_to_user_id || null;
|
|
43
|
+
this.assigned_at = assigned_at || null;
|
|
44
|
+
this.workflow_execution_id = workflow_execution_id || null;
|
|
45
|
+
this.employee_name = employee_name || "";
|
|
46
|
+
this.employee_id = employee_id || "";
|
|
47
|
+
this.job_title = job_title || "";
|
|
48
|
+
this.financial_grade = financial_grade || "";
|
|
49
|
+
this.allowance_value = allowance_value || ShiftAllowanceValue.TWENTY_TWO_PERCENT;
|
|
50
|
+
this.shift_start_date = shift_start_date || new Date();
|
|
51
|
+
this.shift_end_date = shift_end_date || new Date();
|
|
52
|
+
this.reason_for_request = reason_for_request || null;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
exports.ShiftAllowanceRequest = ShiftAllowanceRequest;
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.Column)({ type: "integer", nullable: true }),
|
|
58
|
+
__metadata("design:type", Object)
|
|
59
|
+
], ShiftAllowanceRequest.prototype, "req_user_department_id", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, typeorm_1.Column)({ type: "integer", nullable: true }),
|
|
62
|
+
__metadata("design:type", Object)
|
|
63
|
+
], ShiftAllowanceRequest.prototype, "req_user_section_id", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, typeorm_1.Column)({ type: "integer", nullable: true }),
|
|
66
|
+
__metadata("design:type", Object)
|
|
67
|
+
], ShiftAllowanceRequest.prototype, "req_user_position_id", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, typeorm_1.Column)({ type: "integer", nullable: true }),
|
|
70
|
+
__metadata("design:type", Object)
|
|
71
|
+
], ShiftAllowanceRequest.prototype, "service_id", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, typeorm_1.Column)({ type: "integer", nullable: true }),
|
|
74
|
+
__metadata("design:type", Object)
|
|
75
|
+
], ShiftAllowanceRequest.prototype, "sub_service_id", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, typeorm_1.Column)({ type: "integer", nullable: false }),
|
|
78
|
+
__metadata("design:type", Number)
|
|
79
|
+
], ShiftAllowanceRequest.prototype, "user_id", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, typeorm_1.Column)({ type: "text", nullable: true }),
|
|
82
|
+
__metadata("design:type", Object)
|
|
83
|
+
], ShiftAllowanceRequest.prototype, "description", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, typeorm_1.Column)({ type: "enum", enum: ShiftAllowanceRequestStatus, default: ShiftAllowanceRequestStatus.PENDING, nullable: false }),
|
|
86
|
+
__metadata("design:type", String)
|
|
87
|
+
], ShiftAllowanceRequest.prototype, "status", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, typeorm_1.Column)({ type: "integer", nullable: true }),
|
|
90
|
+
__metadata("design:type", Object)
|
|
91
|
+
], ShiftAllowanceRequest.prototype, "reviewer_user_id", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, typeorm_1.Column)({ type: "integer", nullable: true }),
|
|
94
|
+
__metadata("design:type", Object)
|
|
95
|
+
], ShiftAllowanceRequest.prototype, "assigned_to_user_id", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
(0, typeorm_1.Column)({ type: "timestamp", nullable: true }),
|
|
98
|
+
__metadata("design:type", Object)
|
|
99
|
+
], ShiftAllowanceRequest.prototype, "assigned_at", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true }),
|
|
102
|
+
__metadata("design:type", Object)
|
|
103
|
+
], ShiftAllowanceRequest.prototype, "workflow_execution_id", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: false }),
|
|
106
|
+
__metadata("design:type", String)
|
|
107
|
+
], ShiftAllowanceRequest.prototype, "employee_name", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 100, nullable: false }),
|
|
110
|
+
__metadata("design:type", String)
|
|
111
|
+
], ShiftAllowanceRequest.prototype, "employee_id", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: false }),
|
|
114
|
+
__metadata("design:type", String)
|
|
115
|
+
], ShiftAllowanceRequest.prototype, "job_title", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 100, nullable: false }),
|
|
118
|
+
__metadata("design:type", String)
|
|
119
|
+
], ShiftAllowanceRequest.prototype, "financial_grade", void 0);
|
|
120
|
+
__decorate([
|
|
121
|
+
(0, typeorm_1.Column)({ type: "enum", enum: ShiftAllowanceValue, nullable: false }),
|
|
122
|
+
__metadata("design:type", String)
|
|
123
|
+
], ShiftAllowanceRequest.prototype, "allowance_value", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
(0, typeorm_1.Column)({ type: "date", nullable: false }),
|
|
126
|
+
__metadata("design:type", Date)
|
|
127
|
+
], ShiftAllowanceRequest.prototype, "shift_start_date", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
(0, typeorm_1.Column)({ type: "date", nullable: false }),
|
|
130
|
+
__metadata("design:type", Date)
|
|
131
|
+
], ShiftAllowanceRequest.prototype, "shift_end_date", void 0);
|
|
132
|
+
__decorate([
|
|
133
|
+
(0, typeorm_1.Column)({ type: "text", nullable: true }),
|
|
134
|
+
__metadata("design:type", Object)
|
|
135
|
+
], ShiftAllowanceRequest.prototype, "reason_for_request", void 0);
|
|
136
|
+
exports.ShiftAllowanceRequest = ShiftAllowanceRequest = __decorate([
|
|
137
|
+
(0, typeorm_1.Entity)({ name: "shift_allowance_requests" }),
|
|
138
|
+
__metadata("design:paramtypes", [Number, String, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, String, String, String, String, String, Date,
|
|
139
|
+
Date, Object])
|
|
140
|
+
], ShiftAllowanceRequest);
|
package/package.json
CHANGED
package/src/data-source.ts
CHANGED
|
@@ -37,6 +37,11 @@ import { LogisticsApprovalDetails } from './models/LogisticsApprovalModel';
|
|
|
37
37
|
import { LogisticsRequestChat } from './models/LogisticsChatModel';
|
|
38
38
|
import { LogisticsRequestAttachment } from './models/LogisticsAttachmentModel';
|
|
39
39
|
import { LogisticsWorkFlow } from './models/LogisticsWorkflowModel';
|
|
40
|
+
import { LogisticsVehicleMaintenanceRequests } from './models/LogisticsVehicleMaintenanceRequestModel';
|
|
41
|
+
import { LogisticsVehicleMaintenanceApprovalDetails } from './models/LogisticsVehicleMaintenanceApprovalModel';
|
|
42
|
+
import { LogisticsVehicleMaintenanceAttachment } from './models/LogisticsVehicleMaintenanceAttachmentModel';
|
|
43
|
+
import { LogisticsVehicleMaintenanceChat } from './models/LogisticsVehicleMaintenanceChatModel';
|
|
44
|
+
import { LogisticsVehicleMaintenanceWorkFlow } from './models/LogisticsVehicleMaintenanceWorkflowModel';
|
|
40
45
|
import { ImportantLinks } from './models/importantLinksModel';
|
|
41
46
|
import { DelegateSettings } from './models/DelegateSettingsModel';
|
|
42
47
|
import { Feedback } from './models/feedbackModel';
|
|
@@ -162,6 +167,11 @@ export const AppDataSource = new DataSource({
|
|
|
162
167
|
LogisticsRequestChat,
|
|
163
168
|
LogisticsRequestAttachment,
|
|
164
169
|
LogisticsWorkFlow,
|
|
170
|
+
LogisticsVehicleMaintenanceRequests,
|
|
171
|
+
LogisticsVehicleMaintenanceApprovalDetails,
|
|
172
|
+
LogisticsVehicleMaintenanceAttachment,
|
|
173
|
+
LogisticsVehicleMaintenanceChat,
|
|
174
|
+
LogisticsVehicleMaintenanceWorkFlow,
|
|
165
175
|
AccessCardRequest,
|
|
166
176
|
AccessCardApproval,
|
|
167
177
|
AccessCardAttachment,
|
package/src/index.ts
CHANGED
|
@@ -34,6 +34,15 @@ export * from './models/LogisticsChatModel';
|
|
|
34
34
|
export * from './models/LogisticsAttachmentModel';
|
|
35
35
|
export * from './models/importantLinksModel';
|
|
36
36
|
export * from './models/LogisticsWorkflowModel';
|
|
37
|
+
export * from './models/LogisticsVehicleMaintenanceRequestModel';
|
|
38
|
+
export * from './models/LogisticsVehicleMaintenanceApprovalModel';
|
|
39
|
+
export * from './models/LogisticsVehicleMaintenanceAttachmentModel';
|
|
40
|
+
export * from './models/LogisticsVehicleMaintenanceChatModel';
|
|
41
|
+
export * from './models/LogisticsVehicleMaintenanceWorkflowModel';
|
|
42
|
+
export { VehicleMaintenanceType, VehicleMaintenanceStatus } from './models/LogisticsVehicleMaintenanceRequestModel';
|
|
43
|
+
export { LogisticsVehicleMaintenanceApprovalStatus } from './models/LogisticsVehicleMaintenanceApprovalModel';
|
|
44
|
+
export { LogisticsVehicleMaintenanceMessageType } from './models/LogisticsVehicleMaintenanceChatModel';
|
|
45
|
+
export { LogisticsVehicleMaintenanceWorkFlowStatus } from './models/LogisticsVehicleMaintenanceWorkflowModel';
|
|
37
46
|
export * from './models/AccessCardRequestModel';
|
|
38
47
|
export * from './models/AccessCardApprovalModel';
|
|
39
48
|
export * from './models/AccessCardAttachmentModel';
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export enum LogisticsVehicleMaintenanceApprovalStatus {
|
|
6
|
+
PENDING = "Pending",
|
|
7
|
+
IN_PROGRESS = "In Progress",
|
|
8
|
+
APPROVED = "Approved",
|
|
9
|
+
REJECTED = "Rejected"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@Entity({ name: 'logistics_vehicle_maintenance_approvals' })
|
|
13
|
+
export class LogisticsVehicleMaintenanceApprovalDetails extends BaseModel {
|
|
14
|
+
@Column({ type: 'integer', nullable: false })
|
|
15
|
+
request_id: number;
|
|
16
|
+
|
|
17
|
+
@Column({ type: 'integer', nullable: true })
|
|
18
|
+
service_id: number | null;
|
|
19
|
+
|
|
20
|
+
@Column({ type: 'integer', nullable: true })
|
|
21
|
+
sub_service_id: number | null;
|
|
22
|
+
|
|
23
|
+
@Column({ type: 'integer', nullable: false })
|
|
24
|
+
level: number;
|
|
25
|
+
|
|
26
|
+
@Column({ type: 'integer', nullable: true })
|
|
27
|
+
approver_role_id: number;
|
|
28
|
+
|
|
29
|
+
@Column({ type: 'integer', nullable: true })
|
|
30
|
+
department_id: number | null;
|
|
31
|
+
|
|
32
|
+
@Column({ type: 'integer', nullable: true })
|
|
33
|
+
section_id: number | null;
|
|
34
|
+
|
|
35
|
+
@Column({ type: 'integer', nullable: true })
|
|
36
|
+
approver_user_id: number | null;
|
|
37
|
+
|
|
38
|
+
@Column({ type: 'integer', nullable: true })
|
|
39
|
+
delegate_user_id: number | null;
|
|
40
|
+
|
|
41
|
+
@Column({ type: 'integer', nullable: true })
|
|
42
|
+
approved_by: number | null;
|
|
43
|
+
|
|
44
|
+
@Column({ type: 'varchar', length: 500, nullable: true, default: '' })
|
|
45
|
+
comment: string;
|
|
46
|
+
|
|
47
|
+
@Column({ type: 'enum', enum: LogisticsVehicleMaintenanceApprovalStatus, default: LogisticsVehicleMaintenanceApprovalStatus.PENDING, nullable: false })
|
|
48
|
+
approval_status: LogisticsVehicleMaintenanceApprovalStatus;
|
|
49
|
+
|
|
50
|
+
@Column({ type: 'boolean', default: true, nullable: false })
|
|
51
|
+
is_allowed: boolean;
|
|
52
|
+
|
|
53
|
+
constructor(
|
|
54
|
+
request_id: number,
|
|
55
|
+
approver_role_id: number,
|
|
56
|
+
comment: string,
|
|
57
|
+
approval_status: LogisticsVehicleMaintenanceApprovalStatus,
|
|
58
|
+
level: number,
|
|
59
|
+
department_id?: number | null,
|
|
60
|
+
section_id?: number | null,
|
|
61
|
+
approver_user_id?: number | null,
|
|
62
|
+
delegate_user_id?: number | null,
|
|
63
|
+
approved_by?: number | null,
|
|
64
|
+
service_id?: number,
|
|
65
|
+
sub_service_id?: number,
|
|
66
|
+
is_allowed?: boolean
|
|
67
|
+
) {
|
|
68
|
+
super();
|
|
69
|
+
this.request_id = request_id;
|
|
70
|
+
this.service_id = service_id || null;
|
|
71
|
+
this.sub_service_id = sub_service_id || null;
|
|
72
|
+
this.approver_role_id = approver_role_id;
|
|
73
|
+
this.comment = comment;
|
|
74
|
+
this.approval_status = approval_status;
|
|
75
|
+
this.level = level;
|
|
76
|
+
this.department_id = department_id || null;
|
|
77
|
+
this.section_id = section_id || null;
|
|
78
|
+
this.approver_user_id = approver_user_id || null;
|
|
79
|
+
this.delegate_user_id = delegate_user_id || null;
|
|
80
|
+
this.approved_by = approved_by || null;
|
|
81
|
+
this.is_allowed = is_allowed !== undefined ? is_allowed : true;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
@Entity({ name: 'logistics_vehicle_maintenance_attachments' })
|
|
5
|
+
export class LogisticsVehicleMaintenanceAttachment extends BaseModel {
|
|
6
|
+
|
|
7
|
+
@Column({ type: 'integer', nullable: false })
|
|
8
|
+
request_id: number;
|
|
9
|
+
|
|
10
|
+
@Column({ type: 'integer', nullable: true })
|
|
11
|
+
service_id: number | null;
|
|
12
|
+
|
|
13
|
+
@Column({ type: 'integer', nullable: true })
|
|
14
|
+
sub_service_id: number | null;
|
|
15
|
+
|
|
16
|
+
@Column({ type: 'varchar', length: 500, nullable: false })
|
|
17
|
+
file_url: string;
|
|
18
|
+
|
|
19
|
+
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
20
|
+
file_name: string;
|
|
21
|
+
|
|
22
|
+
@Column({ type: 'varchar', length: 100, nullable: true })
|
|
23
|
+
file_type: string;
|
|
24
|
+
|
|
25
|
+
@Column({ type: 'bigint', nullable: true })
|
|
26
|
+
file_size: number | null;
|
|
27
|
+
|
|
28
|
+
@Column({ type: 'integer', nullable: true })
|
|
29
|
+
chat_id: number | null;
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
constructor(
|
|
33
|
+
request_id: number,
|
|
34
|
+
file_url: string,
|
|
35
|
+
file_name?: string,
|
|
36
|
+
file_type?: string,
|
|
37
|
+
file_size?: number,
|
|
38
|
+
service_id?: number,
|
|
39
|
+
sub_service_id?: number,
|
|
40
|
+
chat_id?: number
|
|
41
|
+
) {
|
|
42
|
+
super();
|
|
43
|
+
this.request_id = request_id;
|
|
44
|
+
this.service_id = service_id || null;
|
|
45
|
+
this.sub_service_id = sub_service_id || null;
|
|
46
|
+
this.file_url = file_url;
|
|
47
|
+
this.file_name = file_name || '';
|
|
48
|
+
this.file_type = file_type || '';
|
|
49
|
+
this.file_size = file_size || null;
|
|
50
|
+
this.chat_id = chat_id || null;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
import { LogisticsVehicleMaintenanceApprovalStatus } from './LogisticsVehicleMaintenanceApprovalModel';
|
|
4
|
+
|
|
5
|
+
export enum LogisticsVehicleMaintenanceMessageType {
|
|
6
|
+
TEXT = "text",
|
|
7
|
+
IMAGE = "image",
|
|
8
|
+
VIDEO = "video",
|
|
9
|
+
FILE = "file",
|
|
10
|
+
LINK = "link"
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@Entity({ name: 'logistics_vehicle_maintenance_chats' })
|
|
14
|
+
export class LogisticsVehicleMaintenanceChat extends BaseModel {
|
|
15
|
+
|
|
16
|
+
@Column({ type: 'integer', nullable: false })
|
|
17
|
+
request_id: number;
|
|
18
|
+
|
|
19
|
+
@Column({ type: 'integer', nullable: true })
|
|
20
|
+
service_id: number | null;
|
|
21
|
+
|
|
22
|
+
@Column({ type: 'integer', nullable: true })
|
|
23
|
+
sub_service_id: number | null;
|
|
24
|
+
|
|
25
|
+
@Column({ type: 'integer', nullable: false })
|
|
26
|
+
user_id: number;
|
|
27
|
+
|
|
28
|
+
@Column({ type: 'integer', nullable: true })
|
|
29
|
+
role_id: number;
|
|
30
|
+
|
|
31
|
+
@Column({ type: 'text', nullable: false })
|
|
32
|
+
message: string;
|
|
33
|
+
|
|
34
|
+
@Column({
|
|
35
|
+
type: 'enum',
|
|
36
|
+
enum: LogisticsVehicleMaintenanceMessageType,
|
|
37
|
+
default: LogisticsVehicleMaintenanceMessageType.TEXT,
|
|
38
|
+
nullable: false
|
|
39
|
+
})
|
|
40
|
+
messageType: LogisticsVehicleMaintenanceMessageType;
|
|
41
|
+
|
|
42
|
+
@Column({ type: 'text', nullable: true })
|
|
43
|
+
status: string;
|
|
44
|
+
|
|
45
|
+
constructor(
|
|
46
|
+
request_id: number,
|
|
47
|
+
user_id: number,
|
|
48
|
+
role_id: number,
|
|
49
|
+
message: string,
|
|
50
|
+
service_id?: number,
|
|
51
|
+
sub_service_id?: number,
|
|
52
|
+
messageType?: LogisticsVehicleMaintenanceMessageType,
|
|
53
|
+
status?: LogisticsVehicleMaintenanceApprovalStatus
|
|
54
|
+
) {
|
|
55
|
+
super();
|
|
56
|
+
this.request_id = request_id;
|
|
57
|
+
this.service_id = service_id || null;
|
|
58
|
+
this.sub_service_id = sub_service_id || null;
|
|
59
|
+
this.user_id = user_id;
|
|
60
|
+
this.role_id = role_id;
|
|
61
|
+
this.message = message;
|
|
62
|
+
this.messageType = messageType || LogisticsVehicleMaintenanceMessageType.TEXT;
|
|
63
|
+
this.status = status || LogisticsVehicleMaintenanceApprovalStatus.PENDING;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -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
|
+
}
|