@platform-modules/civil-aviation-authority 2.0.5 → 2.0.7

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/.env CHANGED
@@ -1,11 +1,11 @@
1
- DB_HOST=localhost
2
- DB_PORT=5433
3
- DB_USER=postgres
4
- DB_PASS=123
5
- DB_NAME=CAA
1
+ # DB_HOST=localhost
2
+ # DB_PORT=5433
3
+ # DB_USER=postgres
4
+ # DB_PASS=123
5
+ # DB_NAME=CAA
6
6
 
7
- # DB_HOST=164.52.222.169
8
- # DB_PORT=5432
9
- # DB_USER=postgres_admin_user
10
- # DB_PASS=pg_admin_user_pwd_caa_fa_$%^&OIukhjgcvbn
11
- # DB_NAME=CAA
7
+ DB_HOST=164.52.222.169
8
+ DB_PORT=5432
9
+ DB_USER=postgres_admin_user
10
+ DB_PASS=pg_admin_user_pwd_caa_fa_$%^&OIukhjgcvbn
11
+ DB_NAME=CAA
@@ -34,6 +34,8 @@ const NotificationModel_1 = require("./models/NotificationModel");
34
34
  const ITRequestChatModel_1 = require("./models/ITRequestChatModel");
35
35
  const ITRequestAttachmentModel_1 = require("./models/ITRequestAttachmentModel");
36
36
  const LogisticsModel_1 = require("./models/LogisticsModel");
37
+ const LogisticsForeignVehicleModel_1 = require("./models/LogisticsForeignVehicleModel");
38
+ const LogisticsForeignVehiclePassengerModel_1 = require("./models/LogisticsForeignVehiclePassengerModel");
37
39
  const LogisticsApprovalModel_1 = require("./models/LogisticsApprovalModel");
38
40
  const LogisticsChatModel_1 = require("./models/LogisticsChatModel");
39
41
  const LogisticsAttachmentModel_1 = require("./models/LogisticsAttachmentModel");
@@ -76,6 +78,8 @@ exports.AppDataSource = new typeorm_1.DataSource({
76
78
  ITRequestChatModel_1.ITRequestChat,
77
79
  ITRequestAttachmentModel_1.ITRequestAttachment,
78
80
  LogisticsModel_1.LogisticsRequests,
81
+ LogisticsForeignVehicleModel_1.LogisticsForeignVehicleRequests,
82
+ LogisticsForeignVehiclePassengerModel_1.LogisticsForeignVehiclePassengers,
79
83
  LogisticsApprovalModel_1.LogisticsApprovalDetails,
80
84
  LogisticsChatModel_1.LogisticsRequestChat,
81
85
  LogisticsAttachmentModel_1.LogisticsRequestAttachment,
package/dist/index.d.ts CHANGED
@@ -26,6 +26,8 @@ export * from './models/NotificationModel';
26
26
  export * from './models/ITRequestChatModel';
27
27
  export * from './models/ITRequestAttachmentModel';
28
28
  export * from './models/LogisticsModel';
29
+ export * from './models/LogisticsForeignVehicleModel';
30
+ export * from './models/LogisticsForeignVehiclePassengerModel';
29
31
  export * from './models/LogisticsApprovalModel';
30
32
  export * from './models/LogisticsChatModel';
31
33
  export * from './models/LogisticsAttachmentModel';
package/dist/index.js CHANGED
@@ -43,6 +43,8 @@ __exportStar(require("./models/NotificationModel"), exports);
43
43
  __exportStar(require("./models/ITRequestChatModel"), exports);
44
44
  __exportStar(require("./models/ITRequestAttachmentModel"), exports);
45
45
  __exportStar(require("./models/LogisticsModel"), exports);
46
+ __exportStar(require("./models/LogisticsForeignVehicleModel"), exports);
47
+ __exportStar(require("./models/LogisticsForeignVehiclePassengerModel"), exports);
46
48
  __exportStar(require("./models/LogisticsApprovalModel"), exports);
47
49
  __exportStar(require("./models/LogisticsChatModel"), exports);
48
50
  __exportStar(require("./models/LogisticsAttachmentModel"), exports);
@@ -6,6 +6,8 @@ export declare enum LogisticsApprovalStatus {
6
6
  }
7
7
  export declare class LogisticsApprovalDetails extends BaseModel {
8
8
  request_id: number;
9
+ service_id: number | null;
10
+ sub_service_id: number | null;
9
11
  level: number;
10
12
  approver_role_id: number;
11
13
  department_id: number | null;
@@ -13,5 +15,5 @@ export declare class LogisticsApprovalDetails extends BaseModel {
13
15
  approved_by: number | null;
14
16
  comment: string;
15
17
  approval_status: LogisticsApprovalStatus;
16
- constructor(request_id: number, approver_role_id: number, comment: string, approval_status: LogisticsApprovalStatus, level: number, department_id?: number | null, section_id?: number | null, approved_by?: number | null);
18
+ constructor(request_id: number, approver_role_id: number, comment: string, approval_status: LogisticsApprovalStatus, level: number, department_id?: number | null, section_id?: number | null, approved_by?: number | null, service_id?: number, sub_service_id?: number);
17
19
  }
@@ -19,9 +19,11 @@ var LogisticsApprovalStatus;
19
19
  LogisticsApprovalStatus["REJECTED"] = "Rejected";
20
20
  })(LogisticsApprovalStatus || (exports.LogisticsApprovalStatus = LogisticsApprovalStatus = {}));
21
21
  let LogisticsApprovalDetails = class LogisticsApprovalDetails extends BaseModel_1.BaseModel {
22
- constructor(request_id, approver_role_id, comment, approval_status, level, department_id, section_id, approved_by) {
22
+ constructor(request_id, approver_role_id, comment, approval_status, level, department_id, section_id, approved_by, service_id, sub_service_id) {
23
23
  super();
24
24
  this.request_id = request_id;
25
+ this.service_id = service_id || null;
26
+ this.sub_service_id = sub_service_id || null;
25
27
  this.approver_role_id = approver_role_id;
26
28
  this.comment = comment;
27
29
  this.approval_status = approval_status;
@@ -36,6 +38,14 @@ __decorate([
36
38
  (0, typeorm_1.Column)({ type: 'integer', nullable: false }),
37
39
  __metadata("design:type", Number)
38
40
  ], LogisticsApprovalDetails.prototype, "request_id", void 0);
41
+ __decorate([
42
+ (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
43
+ __metadata("design:type", Object)
44
+ ], LogisticsApprovalDetails.prototype, "service_id", void 0);
45
+ __decorate([
46
+ (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
47
+ __metadata("design:type", Object)
48
+ ], LogisticsApprovalDetails.prototype, "sub_service_id", void 0);
39
49
  __decorate([
40
50
  (0, typeorm_1.Column)({ type: 'integer', nullable: false }),
41
51
  __metadata("design:type", Number)
@@ -57,7 +67,7 @@ __decorate([
57
67
  __metadata("design:type", Object)
58
68
  ], LogisticsApprovalDetails.prototype, "approved_by", void 0);
59
69
  __decorate([
60
- (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: false }),
70
+ (0, typeorm_1.Column)({ type: 'varchar', length: 500, nullable: true, default: '' }),
61
71
  __metadata("design:type", String)
62
72
  ], LogisticsApprovalDetails.prototype, "comment", void 0);
63
73
  __decorate([
@@ -66,5 +76,5 @@ __decorate([
66
76
  ], LogisticsApprovalDetails.prototype, "approval_status", void 0);
67
77
  exports.LogisticsApprovalDetails = LogisticsApprovalDetails = __decorate([
68
78
  (0, typeorm_1.Entity)({ name: 'logistics_approvals' }),
69
- __metadata("design:paramtypes", [Number, Number, String, String, Number, Object, Object, Object])
79
+ __metadata("design:paramtypes", [Number, Number, String, String, Number, Object, Object, Object, Number, Number])
70
80
  ], LogisticsApprovalDetails);
@@ -1,9 +1,11 @@
1
1
  import { BaseModel } from './BaseModel';
2
2
  export declare class LogisticsRequestAttachment extends BaseModel {
3
3
  request_id: number;
4
+ service_id: number | null;
5
+ sub_service_id: number | null;
4
6
  file_url: string;
5
7
  file_name: string;
6
8
  file_type: string;
7
9
  file_size: number | null;
8
- constructor(request_id: number, file_url: string, file_name?: string, file_type?: string, file_size?: number);
10
+ constructor(request_id: number, file_url: string, file_name?: string, file_type?: string, file_size?: number, service_id?: number, sub_service_id?: number);
9
11
  }
@@ -13,9 +13,11 @@ exports.LogisticsRequestAttachment = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const BaseModel_1 = require("./BaseModel");
15
15
  let LogisticsRequestAttachment = class LogisticsRequestAttachment extends BaseModel_1.BaseModel {
16
- constructor(request_id, file_url, file_name, file_type, file_size) {
16
+ constructor(request_id, file_url, file_name, file_type, file_size, service_id, sub_service_id) {
17
17
  super();
18
18
  this.request_id = request_id;
19
+ this.service_id = service_id || null;
20
+ this.sub_service_id = sub_service_id || null;
19
21
  this.file_url = file_url;
20
22
  this.file_name = file_name || '';
21
23
  this.file_type = file_type || '';
@@ -27,6 +29,14 @@ __decorate([
27
29
  (0, typeorm_1.Column)({ type: 'integer', nullable: false }),
28
30
  __metadata("design:type", Number)
29
31
  ], LogisticsRequestAttachment.prototype, "request_id", void 0);
32
+ __decorate([
33
+ (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
34
+ __metadata("design:type", Object)
35
+ ], LogisticsRequestAttachment.prototype, "service_id", void 0);
36
+ __decorate([
37
+ (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
38
+ __metadata("design:type", Object)
39
+ ], LogisticsRequestAttachment.prototype, "sub_service_id", void 0);
30
40
  __decorate([
31
41
  (0, typeorm_1.Column)({ type: 'varchar', length: 500, nullable: false }),
32
42
  __metadata("design:type", String)
@@ -45,5 +55,5 @@ __decorate([
45
55
  ], LogisticsRequestAttachment.prototype, "file_size", void 0);
46
56
  exports.LogisticsRequestAttachment = LogisticsRequestAttachment = __decorate([
47
57
  (0, typeorm_1.Entity)({ name: 'logistics_request_attachments' }),
48
- __metadata("design:paramtypes", [Number, String, String, String, Number])
58
+ __metadata("design:paramtypes", [Number, String, String, String, Number, Number, Number])
49
59
  ], LogisticsRequestAttachment);
@@ -1,7 +1,17 @@
1
1
  import { BaseModel } from './BaseModel';
2
+ export declare enum MessageType {
3
+ TEXT = "text",
4
+ IMAGE = "image",
5
+ VIDEO = "video",
6
+ FILE = "file",
7
+ LINK = "link"
8
+ }
2
9
  export declare class LogisticsRequestChat extends BaseModel {
3
10
  request_id: number;
11
+ service_id: number | null;
12
+ sub_service_id: number | null;
4
13
  user_id: number;
5
14
  message: string;
6
- constructor(request_id: number, user_id: number, message: string);
15
+ messageType: MessageType;
16
+ constructor(request_id: number, user_id: number, message: string, service_id?: number, sub_service_id?: number, messageType?: MessageType);
7
17
  }
@@ -9,15 +9,26 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.LogisticsRequestChat = void 0;
12
+ exports.LogisticsRequestChat = exports.MessageType = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const BaseModel_1 = require("./BaseModel");
15
+ var MessageType;
16
+ (function (MessageType) {
17
+ MessageType["TEXT"] = "text";
18
+ MessageType["IMAGE"] = "image";
19
+ MessageType["VIDEO"] = "video";
20
+ MessageType["FILE"] = "file";
21
+ MessageType["LINK"] = "link";
22
+ })(MessageType || (exports.MessageType = MessageType = {}));
15
23
  let LogisticsRequestChat = class LogisticsRequestChat extends BaseModel_1.BaseModel {
16
- constructor(request_id, user_id, message) {
24
+ constructor(request_id, user_id, message, service_id, sub_service_id, messageType) {
17
25
  super();
18
26
  this.request_id = request_id;
27
+ this.service_id = service_id || null;
28
+ this.sub_service_id = sub_service_id || null;
19
29
  this.user_id = user_id;
20
30
  this.message = message;
31
+ this.messageType = messageType || MessageType.TEXT;
21
32
  }
22
33
  };
23
34
  exports.LogisticsRequestChat = LogisticsRequestChat;
@@ -25,6 +36,14 @@ __decorate([
25
36
  (0, typeorm_1.Column)({ type: 'integer', nullable: false }),
26
37
  __metadata("design:type", Number)
27
38
  ], LogisticsRequestChat.prototype, "request_id", void 0);
39
+ __decorate([
40
+ (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
41
+ __metadata("design:type", Object)
42
+ ], LogisticsRequestChat.prototype, "service_id", void 0);
43
+ __decorate([
44
+ (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
45
+ __metadata("design:type", Object)
46
+ ], LogisticsRequestChat.prototype, "sub_service_id", void 0);
28
47
  __decorate([
29
48
  (0, typeorm_1.Column)({ type: 'integer', nullable: false }),
30
49
  __metadata("design:type", Number)
@@ -33,7 +52,16 @@ __decorate([
33
52
  (0, typeorm_1.Column)({ type: 'text', nullable: false }),
34
53
  __metadata("design:type", String)
35
54
  ], LogisticsRequestChat.prototype, "message", void 0);
55
+ __decorate([
56
+ (0, typeorm_1.Column)({
57
+ type: 'enum',
58
+ enum: MessageType,
59
+ default: MessageType.TEXT,
60
+ nullable: false
61
+ }),
62
+ __metadata("design:type", String)
63
+ ], LogisticsRequestChat.prototype, "messageType", void 0);
36
64
  exports.LogisticsRequestChat = LogisticsRequestChat = __decorate([
37
65
  (0, typeorm_1.Entity)({ name: 'logistics_request_chat' }),
38
- __metadata("design:paramtypes", [Number, Number, String])
66
+ __metadata("design:paramtypes", [Number, Number, String, Number, Number, String])
39
67
  ], LogisticsRequestChat);
@@ -0,0 +1,43 @@
1
+ import { BaseModel } from './BaseModel';
2
+ export declare enum Foreign_Purpose_of_Travel {
3
+ AIRPORT_PICKUP = "Airport Pickup/Drop-off",
4
+ OFFICIAL_MEETING = "Official Meeting",
5
+ SITE_VISIT = "Site Visit",
6
+ CONFERENCE = "Conference/Event",
7
+ OTHER = "Other"
8
+ }
9
+ export declare enum Foreign_Vehicle_Required_Location {
10
+ INSIDE = "Inside Muscat",
11
+ OUTSIDE = "Outside Muscat"
12
+ }
13
+ export declare enum Foreign_Request_Type {
14
+ NEW_REQUEST = "New Request",
15
+ EXTENSION = "Extension of Previous Request"
16
+ }
17
+ export declare enum Foreign_Request_Status {
18
+ PENDING = "Pending",
19
+ ASSIGNED = "Assigned",
20
+ IN_PROGRESS = "In Progress",
21
+ APPROVED = "Approved",
22
+ REJECTED = "Rejected"
23
+ }
24
+ export declare class LogisticsForeignVehicleRequests extends BaseModel {
25
+ req_user_department_id: number | null;
26
+ req_user_section_id: number | null;
27
+ service_id: number;
28
+ sub_service_id: number;
29
+ user_id: number;
30
+ number_of_passengers: number;
31
+ purpose_of_travel: Foreign_Purpose_of_Travel;
32
+ vehicle_required_location: Foreign_Vehicle_Required_Location;
33
+ employee_id_passport: string | null;
34
+ contact_number: string;
35
+ request_type: Foreign_Request_Type;
36
+ origin_city: string | null;
37
+ destination_city: string;
38
+ arrival_departure_datetime: Date;
39
+ special_instructions: string | null;
40
+ status: Foreign_Request_Status;
41
+ workflow_execution_id: string | null;
42
+ constructor(req_user_department_id: number | null, req_user_section_id: number | null, service_id: number, sub_service_id: number, user_id: number, number_of_passengers: number, purpose_of_travel: Foreign_Purpose_of_Travel, vehicle_required_location: Foreign_Vehicle_Required_Location, contact_number: string, request_type: Foreign_Request_Type, destination_city: string, arrival_departure_datetime: Date, status: Foreign_Request_Status, employee_id_passport?: string | null, origin_city?: string | null, special_instructions?: string | null, workflow_execution_id?: string | null);
43
+ }
@@ -0,0 +1,155 @@
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.LogisticsForeignVehicleRequests = exports.Foreign_Request_Status = exports.Foreign_Request_Type = exports.Foreign_Vehicle_Required_Location = exports.Foreign_Purpose_of_Travel = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ var Foreign_Purpose_of_Travel;
16
+ (function (Foreign_Purpose_of_Travel) {
17
+ Foreign_Purpose_of_Travel["AIRPORT_PICKUP"] = "Airport Pickup/Drop-off";
18
+ Foreign_Purpose_of_Travel["OFFICIAL_MEETING"] = "Official Meeting";
19
+ Foreign_Purpose_of_Travel["SITE_VISIT"] = "Site Visit";
20
+ Foreign_Purpose_of_Travel["CONFERENCE"] = "Conference/Event";
21
+ Foreign_Purpose_of_Travel["OTHER"] = "Other";
22
+ })(Foreign_Purpose_of_Travel || (exports.Foreign_Purpose_of_Travel = Foreign_Purpose_of_Travel = {}));
23
+ var Foreign_Vehicle_Required_Location;
24
+ (function (Foreign_Vehicle_Required_Location) {
25
+ Foreign_Vehicle_Required_Location["INSIDE"] = "Inside Muscat";
26
+ Foreign_Vehicle_Required_Location["OUTSIDE"] = "Outside Muscat";
27
+ })(Foreign_Vehicle_Required_Location || (exports.Foreign_Vehicle_Required_Location = Foreign_Vehicle_Required_Location = {}));
28
+ var Foreign_Request_Type;
29
+ (function (Foreign_Request_Type) {
30
+ Foreign_Request_Type["NEW_REQUEST"] = "New Request";
31
+ Foreign_Request_Type["EXTENSION"] = "Extension of Previous Request";
32
+ })(Foreign_Request_Type || (exports.Foreign_Request_Type = Foreign_Request_Type = {}));
33
+ var Foreign_Request_Status;
34
+ (function (Foreign_Request_Status) {
35
+ Foreign_Request_Status["PENDING"] = "Pending";
36
+ Foreign_Request_Status["ASSIGNED"] = "Assigned";
37
+ Foreign_Request_Status["IN_PROGRESS"] = "In Progress";
38
+ Foreign_Request_Status["APPROVED"] = "Approved";
39
+ Foreign_Request_Status["REJECTED"] = "Rejected";
40
+ })(Foreign_Request_Status || (exports.Foreign_Request_Status = Foreign_Request_Status = {}));
41
+ let LogisticsForeignVehicleRequests = class LogisticsForeignVehicleRequests extends BaseModel_1.BaseModel {
42
+ constructor(req_user_department_id, req_user_section_id, service_id, sub_service_id, user_id, number_of_passengers, purpose_of_travel, vehicle_required_location, contact_number, request_type, destination_city, arrival_departure_datetime, status, employee_id_passport, origin_city, special_instructions, workflow_execution_id) {
43
+ super();
44
+ this.req_user_department_id = req_user_department_id ?? null;
45
+ this.req_user_section_id = req_user_section_id ?? null;
46
+ this.service_id = service_id;
47
+ this.sub_service_id = sub_service_id;
48
+ this.user_id = user_id;
49
+ this.number_of_passengers = number_of_passengers;
50
+ this.purpose_of_travel = purpose_of_travel;
51
+ this.vehicle_required_location = vehicle_required_location;
52
+ this.employee_id_passport = employee_id_passport ?? null;
53
+ this.contact_number = contact_number;
54
+ this.request_type = request_type;
55
+ this.origin_city = origin_city ?? null;
56
+ this.destination_city = destination_city;
57
+ this.arrival_departure_datetime = arrival_departure_datetime;
58
+ this.special_instructions = special_instructions ?? null;
59
+ this.status = status;
60
+ this.workflow_execution_id = workflow_execution_id ?? null;
61
+ }
62
+ };
63
+ exports.LogisticsForeignVehicleRequests = LogisticsForeignVehicleRequests;
64
+ __decorate([
65
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
66
+ __metadata("design:type", Object)
67
+ ], LogisticsForeignVehicleRequests.prototype, "req_user_department_id", void 0);
68
+ __decorate([
69
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
70
+ __metadata("design:type", Object)
71
+ ], LogisticsForeignVehicleRequests.prototype, "req_user_section_id", void 0);
72
+ __decorate([
73
+ (0, typeorm_1.Column)({ nullable: true }),
74
+ __metadata("design:type", Number)
75
+ ], LogisticsForeignVehicleRequests.prototype, "service_id", void 0);
76
+ __decorate([
77
+ (0, typeorm_1.Column)({ nullable: true }),
78
+ __metadata("design:type", Number)
79
+ ], LogisticsForeignVehicleRequests.prototype, "sub_service_id", void 0);
80
+ __decorate([
81
+ (0, typeorm_1.Column)({ nullable: false }),
82
+ __metadata("design:type", Number)
83
+ ], LogisticsForeignVehicleRequests.prototype, "user_id", void 0);
84
+ __decorate([
85
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
86
+ __metadata("design:type", Number)
87
+ ], LogisticsForeignVehicleRequests.prototype, "number_of_passengers", void 0);
88
+ __decorate([
89
+ (0, typeorm_1.Column)({
90
+ type: "enum",
91
+ enum: Foreign_Purpose_of_Travel,
92
+ default: Foreign_Purpose_of_Travel.OTHER,
93
+ nullable: false,
94
+ }),
95
+ __metadata("design:type", String)
96
+ ], LogisticsForeignVehicleRequests.prototype, "purpose_of_travel", void 0);
97
+ __decorate([
98
+ (0, typeorm_1.Column)({
99
+ type: "enum",
100
+ enum: Foreign_Vehicle_Required_Location,
101
+ default: Foreign_Vehicle_Required_Location.INSIDE,
102
+ nullable: false,
103
+ }),
104
+ __metadata("design:type", String)
105
+ ], LogisticsForeignVehicleRequests.prototype, "vehicle_required_location", void 0);
106
+ __decorate([
107
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
108
+ __metadata("design:type", Object)
109
+ ], LogisticsForeignVehicleRequests.prototype, "employee_id_passport", void 0);
110
+ __decorate([
111
+ (0, typeorm_1.Column)({ type: 'varchar', length: 20, nullable: false }),
112
+ __metadata("design:type", String)
113
+ ], LogisticsForeignVehicleRequests.prototype, "contact_number", void 0);
114
+ __decorate([
115
+ (0, typeorm_1.Column)({
116
+ type: "enum",
117
+ enum: Foreign_Request_Type,
118
+ default: Foreign_Request_Type.NEW_REQUEST,
119
+ nullable: false,
120
+ }),
121
+ __metadata("design:type", String)
122
+ ], LogisticsForeignVehicleRequests.prototype, "request_type", void 0);
123
+ __decorate([
124
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
125
+ __metadata("design:type", Object)
126
+ ], LogisticsForeignVehicleRequests.prototype, "origin_city", void 0);
127
+ __decorate([
128
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: false }),
129
+ __metadata("design:type", String)
130
+ ], LogisticsForeignVehicleRequests.prototype, "destination_city", void 0);
131
+ __decorate([
132
+ (0, typeorm_1.Column)({ type: 'timestamp', nullable: false }),
133
+ __metadata("design:type", Date)
134
+ ], LogisticsForeignVehicleRequests.prototype, "arrival_departure_datetime", void 0);
135
+ __decorate([
136
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
137
+ __metadata("design:type", Object)
138
+ ], LogisticsForeignVehicleRequests.prototype, "special_instructions", void 0);
139
+ __decorate([
140
+ (0, typeorm_1.Column)({
141
+ type: "enum",
142
+ enum: Foreign_Request_Status,
143
+ default: Foreign_Request_Status.PENDING,
144
+ nullable: false,
145
+ }),
146
+ __metadata("design:type", String)
147
+ ], LogisticsForeignVehicleRequests.prototype, "status", void 0);
148
+ __decorate([
149
+ (0, typeorm_1.Column)({ type: "varchar", nullable: true }),
150
+ __metadata("design:type", Object)
151
+ ], LogisticsForeignVehicleRequests.prototype, "workflow_execution_id", void 0);
152
+ exports.LogisticsForeignVehicleRequests = LogisticsForeignVehicleRequests = __decorate([
153
+ (0, typeorm_1.Entity)({ name: 'logistics_foreign_vehicle_requests' }),
154
+ __metadata("design:paramtypes", [Object, Object, Number, Number, Number, Number, String, String, String, String, String, Date, String, Object, Object, Object, Object])
155
+ ], LogisticsForeignVehicleRequests);
@@ -0,0 +1,6 @@
1
+ import { BaseModel } from './BaseModel';
2
+ export declare class LogisticsForeignVehiclePassengers extends BaseModel {
3
+ foreign_vehicle_request_id: number;
4
+ passenger_name: string;
5
+ constructor(foreign_vehicle_request_id: number, passenger_name: string);
6
+ }
@@ -0,0 +1,34 @@
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.LogisticsForeignVehiclePassengers = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ let LogisticsForeignVehiclePassengers = class LogisticsForeignVehiclePassengers extends BaseModel_1.BaseModel {
16
+ constructor(foreign_vehicle_request_id, passenger_name) {
17
+ super();
18
+ this.foreign_vehicle_request_id = foreign_vehicle_request_id;
19
+ this.passenger_name = passenger_name;
20
+ }
21
+ };
22
+ exports.LogisticsForeignVehiclePassengers = LogisticsForeignVehiclePassengers;
23
+ __decorate([
24
+ (0, typeorm_1.Column)({ type: 'integer', nullable: false }),
25
+ __metadata("design:type", Number)
26
+ ], LogisticsForeignVehiclePassengers.prototype, "foreign_vehicle_request_id", void 0);
27
+ __decorate([
28
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: false }),
29
+ __metadata("design:type", String)
30
+ ], LogisticsForeignVehiclePassengers.prototype, "passenger_name", void 0);
31
+ exports.LogisticsForeignVehiclePassengers = LogisticsForeignVehiclePassengers = __decorate([
32
+ (0, typeorm_1.Entity)({ name: 'logistics_foreign_vehicle_passengers' }),
33
+ __metadata("design:paramtypes", [Number, String])
34
+ ], LogisticsForeignVehiclePassengers);
@@ -6,7 +6,9 @@ export declare enum LogisticsWorkFlowStatus {
6
6
  }
7
7
  export declare class LogisticsWorkFlow extends BaseModel {
8
8
  request_id: number;
9
+ service_id: number | null;
10
+ sub_service_id: number | null;
9
11
  content: string;
10
12
  status: LogisticsWorkFlowStatus;
11
- constructor(request_id: number, content: string, status: LogisticsWorkFlowStatus);
13
+ constructor(request_id: number, content: string, status: LogisticsWorkFlowStatus, service_id?: number, sub_service_id?: number);
12
14
  }
@@ -18,22 +18,32 @@ var LogisticsWorkFlowStatus;
18
18
  LogisticsWorkFlowStatus["NOT_YET_STARTED"] = "Not Yet Started";
19
19
  LogisticsWorkFlowStatus["PENDING"] = "Pending";
20
20
  })(LogisticsWorkFlowStatus || (exports.LogisticsWorkFlowStatus = LogisticsWorkFlowStatus = {}));
21
- //This model is used to store the store the leave apporval matrix(HOD, Manager, HR, Director) based on leave type along with the levels
21
+ //This model is used to store the logistics workflow status and activity logs
22
22
  let LogisticsWorkFlow = class LogisticsWorkFlow extends BaseModel_1.BaseModel {
23
- constructor(request_id, content, status) {
23
+ constructor(request_id, content, status, service_id, sub_service_id) {
24
24
  super();
25
25
  this.request_id = request_id;
26
+ this.service_id = service_id || null;
27
+ this.sub_service_id = sub_service_id || null;
26
28
  this.content = content;
27
29
  this.status = status;
28
30
  }
29
31
  };
30
32
  exports.LogisticsWorkFlow = LogisticsWorkFlow;
31
33
  __decorate([
32
- (0, typeorm_1.Column)({ type: 'int', nullable: false }),
34
+ (0, typeorm_1.Column)({ type: 'integer', nullable: false }),
33
35
  __metadata("design:type", Number)
34
36
  ], LogisticsWorkFlow.prototype, "request_id", void 0);
35
37
  __decorate([
36
- (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: false }),
38
+ (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
39
+ __metadata("design:type", Object)
40
+ ], LogisticsWorkFlow.prototype, "service_id", void 0);
41
+ __decorate([
42
+ (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
43
+ __metadata("design:type", Object)
44
+ ], LogisticsWorkFlow.prototype, "sub_service_id", void 0);
45
+ __decorate([
46
+ (0, typeorm_1.Column)({ type: 'varchar', length: 500, nullable: false }),
37
47
  __metadata("design:type", String)
38
48
  ], LogisticsWorkFlow.prototype, "content", void 0);
39
49
  __decorate([
@@ -42,5 +52,5 @@ __decorate([
42
52
  ], LogisticsWorkFlow.prototype, "status", void 0);
43
53
  exports.LogisticsWorkFlow = LogisticsWorkFlow = __decorate([
44
54
  (0, typeorm_1.Entity)({ name: 'logistics_workflows' }),
45
- __metadata("design:paramtypes", [Number, String, String])
55
+ __metadata("design:paramtypes", [Number, String, String, Number, Number])
46
56
  ], LogisticsWorkFlow);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platform-modules/civil-aviation-authority",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -31,6 +31,8 @@ import { Notification } from './models/NotificationModel';
31
31
  import { ITRequestChat } from './models/ITRequestChatModel';
32
32
  import { ITRequestAttachment } from './models/ITRequestAttachmentModel';
33
33
  import { LogisticsRequests } from './models/LogisticsModel';
34
+ import { LogisticsForeignVehicleRequests } from './models/LogisticsForeignVehicleModel';
35
+ import { LogisticsForeignVehiclePassengers } from './models/LogisticsForeignVehiclePassengerModel';
34
36
  import { LogisticsApprovalDetails } from './models/LogisticsApprovalModel';
35
37
  import { LogisticsRequestChat } from './models/LogisticsChatModel';
36
38
  import { LogisticsRequestAttachment } from './models/LogisticsAttachmentModel';
@@ -76,6 +78,8 @@ export const AppDataSource = new DataSource({
76
78
  ITRequestChat,
77
79
  ITRequestAttachment,
78
80
  LogisticsRequests,
81
+ LogisticsForeignVehicleRequests,
82
+ LogisticsForeignVehiclePassengers,
79
83
  LogisticsApprovalDetails,
80
84
  LogisticsRequestChat,
81
85
  LogisticsRequestAttachment,
package/src/index.ts CHANGED
@@ -27,6 +27,8 @@ export * from './models/NotificationModel';
27
27
  export * from './models/ITRequestChatModel';
28
28
  export * from './models/ITRequestAttachmentModel';
29
29
  export * from './models/LogisticsModel';
30
+ export * from './models/LogisticsForeignVehicleModel';
31
+ export * from './models/LogisticsForeignVehiclePassengerModel';
30
32
  export * from './models/LogisticsApprovalModel';
31
33
  export * from './models/LogisticsChatModel';
32
34
  export * from './models/LogisticsAttachmentModel';
@@ -13,6 +13,12 @@ export class LogisticsApprovalDetails extends BaseModel {
13
13
  @Column({ type: 'integer', nullable: false })
14
14
  request_id: number;
15
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
+
16
22
  @Column({ type: 'integer', nullable: false })
17
23
  level: number;
18
24
 
@@ -28,7 +34,7 @@ export class LogisticsApprovalDetails extends BaseModel {
28
34
  @Column({ type: 'integer', nullable: true })
29
35
  approved_by: number | null;
30
36
 
31
- @Column({ type: 'varchar', length: 255, nullable: false })
37
+ @Column({ type: 'varchar', length: 500, nullable: true, default: '' })
32
38
  comment: string;
33
39
 
34
40
  @Column({ type: 'enum', enum: LogisticsApprovalStatus,default: LogisticsApprovalStatus.PENDING, nullable: false })
@@ -42,10 +48,14 @@ export class LogisticsApprovalDetails extends BaseModel {
42
48
  level: number,
43
49
  department_id?: number | null,
44
50
  section_id?: number | null,
45
- approved_by?: number | null
51
+ approved_by?: number | null,
52
+ service_id?: number,
53
+ sub_service_id?: number
46
54
  ) {
47
55
  super();
48
56
  this.request_id = request_id;
57
+ this.service_id = service_id || null;
58
+ this.sub_service_id = sub_service_id || null;
49
59
  this.approver_role_id = approver_role_id;
50
60
  this.comment = comment;
51
61
  this.approval_status = approval_status;
@@ -9,6 +9,12 @@ export class LogisticsRequestAttachment extends BaseModel {
9
9
  @Column({ type: 'integer', nullable: false })
10
10
  request_id: number;
11
11
 
12
+ @Column({ type: 'integer', nullable: true })
13
+ service_id: number | null;
14
+
15
+ @Column({ type: 'integer', nullable: true })
16
+ sub_service_id: number | null;
17
+
12
18
  @Column({ type: 'varchar', length: 500, nullable: false })
13
19
  file_url: string;
14
20
 
@@ -28,9 +34,13 @@ export class LogisticsRequestAttachment extends BaseModel {
28
34
  file_name?: string,
29
35
  file_type?: string,
30
36
  file_size?: number,
37
+ service_id?: number,
38
+ sub_service_id?: number
31
39
  ) {
32
40
  super();
33
41
  this.request_id = request_id;
42
+ this.service_id = service_id || null;
43
+ this.sub_service_id = sub_service_id || null;
34
44
  this.file_url = file_url;
35
45
  this.file_name = file_name || '';
36
46
  this.file_type = file_type || '';
@@ -1,7 +1,13 @@
1
- import { Column, Entity, ManyToOne, JoinColumn } from "typeorm";
1
+ import { Column, Entity } from "typeorm";
2
2
  import { BaseModel } from './BaseModel';
3
- import { ITHelpDeskRequests } from './ITHelpDeskModel';
4
- import { User } from './user';
3
+
4
+ export enum MessageType {
5
+ TEXT = "text",
6
+ IMAGE = "image",
7
+ VIDEO = "video",
8
+ FILE = "file",
9
+ LINK = "link"
10
+ }
5
11
 
6
12
  @Entity({ name: 'logistics_request_chat' })
7
13
  export class LogisticsRequestChat extends BaseModel {
@@ -9,21 +15,41 @@ export class LogisticsRequestChat extends BaseModel {
9
15
  @Column({ type: 'integer', nullable: false })
10
16
  request_id: number;
11
17
 
18
+ @Column({ type: 'integer', nullable: true })
19
+ service_id: number | null;
20
+
21
+ @Column({ type: 'integer', nullable: true })
22
+ sub_service_id: number | null;
23
+
12
24
  @Column({ type: 'integer', nullable: false })
13
25
  user_id: number;
14
26
 
15
27
  @Column({ type: 'text', nullable: false })
16
28
  message: string;
17
29
 
30
+ @Column({
31
+ type: 'enum',
32
+ enum: MessageType,
33
+ default: MessageType.TEXT,
34
+ nullable: false
35
+ })
36
+ messageType: MessageType;
37
+
18
38
  constructor(
19
39
  request_id: number,
20
40
  user_id: number,
21
41
  message: string,
42
+ service_id?: number,
43
+ sub_service_id?: number,
44
+ messageType?: MessageType
22
45
  ) {
23
46
  super();
24
47
  this.request_id = request_id;
48
+ this.service_id = service_id || null;
49
+ this.sub_service_id = sub_service_id || null;
25
50
  this.user_id = user_id;
26
51
  this.message = message;
52
+ this.messageType = messageType || MessageType.TEXT;
27
53
  }
28
54
  }
29
55
 
@@ -0,0 +1,143 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum Foreign_Purpose_of_Travel {
5
+ AIRPORT_PICKUP = "Airport Pickup/Drop-off",
6
+ OFFICIAL_MEETING = "Official Meeting",
7
+ SITE_VISIT = "Site Visit",
8
+ CONFERENCE = "Conference/Event",
9
+ OTHER = "Other"
10
+ }
11
+
12
+ export enum Foreign_Vehicle_Required_Location {
13
+ INSIDE = "Inside Muscat",
14
+ OUTSIDE = "Outside Muscat"
15
+ }
16
+
17
+ export enum Foreign_Request_Type {
18
+ NEW_REQUEST = "New Request",
19
+ EXTENSION = "Extension of Previous Request"
20
+ }
21
+
22
+ export enum Foreign_Request_Status {
23
+ PENDING = "Pending",
24
+ ASSIGNED = "Assigned",
25
+ IN_PROGRESS = "In Progress",
26
+ APPROVED = "Approved",
27
+ REJECTED = "Rejected"
28
+ }
29
+
30
+ @Entity({ name: 'logistics_foreign_vehicle_requests' })
31
+ export class LogisticsForeignVehicleRequests extends BaseModel {
32
+
33
+ @Column({ type: 'int', nullable: true })
34
+ req_user_department_id: number | null;
35
+
36
+ @Column({ type: 'int', nullable: true })
37
+ req_user_section_id: number | null;
38
+
39
+ @Column({ nullable: true })
40
+ service_id: number;
41
+
42
+ @Column({ nullable: true })
43
+ sub_service_id: number;
44
+
45
+ @Column({ nullable: false })
46
+ user_id: number;
47
+
48
+ @Column({ type: 'int', nullable: false })
49
+ number_of_passengers: number;
50
+
51
+ @Column({
52
+ type: "enum",
53
+ enum: Foreign_Purpose_of_Travel,
54
+ default: Foreign_Purpose_of_Travel.OTHER,
55
+ nullable: false,
56
+ })
57
+ purpose_of_travel: Foreign_Purpose_of_Travel;
58
+
59
+ @Column({
60
+ type: "enum",
61
+ enum: Foreign_Vehicle_Required_Location,
62
+ default: Foreign_Vehicle_Required_Location.INSIDE,
63
+ nullable: false,
64
+ })
65
+ vehicle_required_location: Foreign_Vehicle_Required_Location;
66
+
67
+ @Column({ type: 'varchar', length: 100, nullable: true })
68
+ employee_id_passport: string | null;
69
+
70
+ @Column({ type: 'varchar', length: 20, nullable: false })
71
+ contact_number: string;
72
+
73
+ @Column({
74
+ type: "enum",
75
+ enum: Foreign_Request_Type,
76
+ default: Foreign_Request_Type.NEW_REQUEST,
77
+ nullable: false,
78
+ })
79
+ request_type: Foreign_Request_Type;
80
+
81
+ @Column({ type: 'varchar', length: 255, nullable: true })
82
+ origin_city: string | null;
83
+
84
+ @Column({ type: 'varchar', length: 255, nullable: false })
85
+ destination_city: string;
86
+
87
+ @Column({ type: 'timestamp', nullable: false })
88
+ arrival_departure_datetime: Date;
89
+
90
+ @Column({ type: 'text', nullable: true })
91
+ special_instructions: string | null;
92
+
93
+ @Column({
94
+ type: "enum",
95
+ enum: Foreign_Request_Status,
96
+ default: Foreign_Request_Status.PENDING,
97
+ nullable: false,
98
+ })
99
+ status: Foreign_Request_Status;
100
+
101
+ @Column({ type: "varchar", nullable: true })
102
+ workflow_execution_id: string | null;
103
+
104
+ constructor(
105
+ req_user_department_id: number | null,
106
+ req_user_section_id: number | null,
107
+ service_id: number,
108
+ sub_service_id: number,
109
+ user_id: number,
110
+ number_of_passengers: number,
111
+ purpose_of_travel: Foreign_Purpose_of_Travel,
112
+ vehicle_required_location: Foreign_Vehicle_Required_Location,
113
+ contact_number: string,
114
+ request_type: Foreign_Request_Type,
115
+ destination_city: string,
116
+ arrival_departure_datetime: Date,
117
+ status: Foreign_Request_Status,
118
+ employee_id_passport?: string | null,
119
+ origin_city?: string | null,
120
+ special_instructions?: string | null,
121
+ workflow_execution_id?: string | null,
122
+ ) {
123
+ super();
124
+ this.req_user_department_id = req_user_department_id ?? null;
125
+ this.req_user_section_id = req_user_section_id ?? null;
126
+ this.service_id = service_id;
127
+ this.sub_service_id = sub_service_id;
128
+ this.user_id = user_id;
129
+ this.number_of_passengers = number_of_passengers;
130
+ this.purpose_of_travel = purpose_of_travel;
131
+ this.vehicle_required_location = vehicle_required_location;
132
+ this.employee_id_passport = employee_id_passport ?? null;
133
+ this.contact_number = contact_number;
134
+ this.request_type = request_type;
135
+ this.origin_city = origin_city ?? null;
136
+ this.destination_city = destination_city;
137
+ this.arrival_departure_datetime = arrival_departure_datetime;
138
+ this.special_instructions = special_instructions ?? null;
139
+ this.status = status;
140
+ this.workflow_execution_id = workflow_execution_id ?? null;
141
+ }
142
+ }
143
+
@@ -0,0 +1,23 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ @Entity({ name: 'logistics_foreign_vehicle_passengers' })
5
+ export class LogisticsForeignVehiclePassengers extends BaseModel {
6
+
7
+ @Column({ type: 'integer', nullable: false })
8
+ foreign_vehicle_request_id: number;
9
+
10
+ @Column({ type: 'varchar', length: 255, nullable: false })
11
+ passenger_name: string;
12
+
13
+
14
+ constructor(
15
+ foreign_vehicle_request_id: number,
16
+ passenger_name: string,
17
+ ) {
18
+ super();
19
+ this.foreign_vehicle_request_id = foreign_vehicle_request_id;
20
+ this.passenger_name = passenger_name;
21
+ }
22
+ }
23
+
@@ -7,21 +7,35 @@ export enum LogisticsWorkFlowStatus {
7
7
  PENDING = "Pending"
8
8
  }
9
9
 
10
- //This model is used to store the store the leave apporval matrix(HOD, Manager, HR, Director) based on leave type along with the levels
10
+ //This model is used to store the logistics workflow status and activity logs
11
11
  @Entity({ name: 'logistics_workflows' })
12
12
  export class LogisticsWorkFlow extends BaseModel {
13
- @Column({ type: 'int', nullable: false })
13
+ @Column({ type: 'integer', nullable: false })
14
14
  request_id: number;
15
15
 
16
- @Column({ type: 'varchar', length: 255, nullable: false })
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 })
17
23
  content: string;
18
24
 
19
25
  @Column({ type: 'enum', enum: LogisticsWorkFlowStatus, default: LogisticsWorkFlowStatus.NOT_YET_STARTED, nullable: false })
20
26
  status: LogisticsWorkFlowStatus;
21
27
 
22
- constructor(request_id: number, content: string, status: LogisticsWorkFlowStatus) {
28
+ constructor(
29
+ request_id: number,
30
+ content: string,
31
+ status: LogisticsWorkFlowStatus,
32
+ service_id?: number,
33
+ sub_service_id?: number
34
+ ) {
23
35
  super();
24
36
  this.request_id = request_id;
37
+ this.service_id = service_id || null;
38
+ this.sub_service_id = sub_service_id || null;
25
39
  this.content = content;
26
40
  this.status = status;
27
41
  }