@platform-modules/civil-aviation-authority 2.2.307 → 2.2.309
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 +13 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/models/HrServiceApprovalModel.d.ts +25 -0
- package/dist/models/HrServiceApprovalModel.js +107 -0
- package/dist/models/HrServiceAttachmentModel.d.ts +13 -0
- package/dist/models/HrServiceAttachmentModel.js +69 -0
- package/dist/models/HrServiceChatModel.d.ts +28 -0
- package/dist/models/HrServiceChatModel.js +96 -0
- package/dist/models/HrServiceRequestModel.d.ts +24 -0
- package/dist/models/HrServiceRequestModel.js +93 -0
- package/dist/models/HrServiceWorkflowModel.d.ts +19 -0
- package/dist/models/HrServiceWorkflowModel.js +81 -0
- package/dist/models/TrainingRequestModel.d.ts +43 -0
- package/dist/models/TrainingRequestModel.js +161 -0
- package/package.json +1 -1
- package/src/data-source.ts +13 -1
- package/src/index.ts +6 -0
- package/src/models/HrServiceApprovalModel.ts +94 -0
- package/src/models/HrServiceAttachmentModel.ts +56 -0
- package/src/models/HrServiceChatModel.ts +83 -0
- package/src/models/HrServiceRequestModel.ts +80 -0
- package/src/models/HrServiceWorkflowModel.ts +68 -0
- package/src/models/TrainingRequestModel.ts +148 -0
|
@@ -0,0 +1,161 @@
|
|
|
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.TrainingRequest = exports.TrainingMediaCoverageRequired = exports.TypeOfCategory = exports.TypeOfTraining = exports.TrainingRequestStatus = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
var TrainingRequestStatus;
|
|
16
|
+
(function (TrainingRequestStatus) {
|
|
17
|
+
TrainingRequestStatus["PENDING"] = "Pending";
|
|
18
|
+
TrainingRequestStatus["ASSIGNED"] = "Assigned";
|
|
19
|
+
TrainingRequestStatus["IN_PROGRESS"] = "In Progress";
|
|
20
|
+
TrainingRequestStatus["COMPLETED"] = "Completed";
|
|
21
|
+
TrainingRequestStatus["APPROVED"] = "Approved";
|
|
22
|
+
TrainingRequestStatus["REJECTED"] = "Rejected";
|
|
23
|
+
})(TrainingRequestStatus || (exports.TrainingRequestStatus = TrainingRequestStatus = {}));
|
|
24
|
+
var TypeOfTraining;
|
|
25
|
+
(function (TypeOfTraining) {
|
|
26
|
+
TypeOfTraining["INSIDE_TRAINING"] = "Inside Training";
|
|
27
|
+
TypeOfTraining["OUTSIDE_TRAINING"] = "Outside Training";
|
|
28
|
+
})(TypeOfTraining || (exports.TypeOfTraining = TypeOfTraining = {}));
|
|
29
|
+
var TypeOfCategory;
|
|
30
|
+
(function (TypeOfCategory) {
|
|
31
|
+
TypeOfCategory["PLANNED"] = "Planned";
|
|
32
|
+
TypeOfCategory["OUT_OF_PLANNED"] = "Out of planned";
|
|
33
|
+
})(TypeOfCategory || (exports.TypeOfCategory = TypeOfCategory = {}));
|
|
34
|
+
var TrainingMediaCoverageRequired;
|
|
35
|
+
(function (TrainingMediaCoverageRequired) {
|
|
36
|
+
TrainingMediaCoverageRequired["YES"] = "Yes";
|
|
37
|
+
TrainingMediaCoverageRequired["NO"] = "No";
|
|
38
|
+
})(TrainingMediaCoverageRequired || (exports.TrainingMediaCoverageRequired = TrainingMediaCoverageRequired = {}));
|
|
39
|
+
let TrainingRequest = class TrainingRequest extends BaseModel_1.BaseModel {
|
|
40
|
+
constructor(user_id, type_of_training, description, place, no_of_attendees, media_coverage_required, status = TrainingRequestStatus.PENDING, service_id, sub_service_id, req_user_department_id, req_user_section_id, req_user_position_id, type_of_category, start_date, end_date, reviewer_user_id, assigned_to_user_id, assigned_at, workflow_execution_id) {
|
|
41
|
+
super();
|
|
42
|
+
this.user_id = user_id;
|
|
43
|
+
this.type_of_training = type_of_training;
|
|
44
|
+
this.description = description;
|
|
45
|
+
this.place = place;
|
|
46
|
+
this.no_of_attendees = no_of_attendees;
|
|
47
|
+
this.media_coverage_required = media_coverage_required;
|
|
48
|
+
this.status = status;
|
|
49
|
+
this.service_id = service_id || null;
|
|
50
|
+
this.sub_service_id = sub_service_id || null;
|
|
51
|
+
this.req_user_department_id = req_user_department_id || null;
|
|
52
|
+
this.req_user_section_id = req_user_section_id || null;
|
|
53
|
+
this.req_user_position_id = req_user_position_id || null;
|
|
54
|
+
this.type_of_category = type_of_category || null;
|
|
55
|
+
this.start_date = start_date || null;
|
|
56
|
+
this.end_date = end_date || null;
|
|
57
|
+
this.reviewer_user_id = reviewer_user_id || null;
|
|
58
|
+
this.assigned_to_user_id = assigned_to_user_id || null;
|
|
59
|
+
this.assigned_at = assigned_at || null;
|
|
60
|
+
this.workflow_execution_id = workflow_execution_id || null;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
exports.TrainingRequest = TrainingRequest;
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, typeorm_1.Column)({ type: "integer", nullable: true }),
|
|
66
|
+
__metadata("design:type", Object)
|
|
67
|
+
], TrainingRequest.prototype, "req_user_department_id", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, typeorm_1.Column)({ type: "integer", nullable: true }),
|
|
70
|
+
__metadata("design:type", Object)
|
|
71
|
+
], TrainingRequest.prototype, "req_user_section_id", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, typeorm_1.Column)({ type: "integer", nullable: true }),
|
|
74
|
+
__metadata("design:type", Object)
|
|
75
|
+
], TrainingRequest.prototype, "req_user_position_id", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, typeorm_1.Column)({ type: "integer", nullable: true }),
|
|
78
|
+
__metadata("design:type", Object)
|
|
79
|
+
], TrainingRequest.prototype, "service_id", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, typeorm_1.Column)({ type: "integer", nullable: true }),
|
|
82
|
+
__metadata("design:type", Object)
|
|
83
|
+
], TrainingRequest.prototype, "sub_service_id", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, typeorm_1.Column)({ type: "integer", nullable: false }),
|
|
86
|
+
__metadata("design:type", Number)
|
|
87
|
+
], TrainingRequest.prototype, "user_id", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, typeorm_1.Column)({
|
|
90
|
+
type: "enum",
|
|
91
|
+
enum: TypeOfTraining,
|
|
92
|
+
nullable: false
|
|
93
|
+
}),
|
|
94
|
+
__metadata("design:type", String)
|
|
95
|
+
], TrainingRequest.prototype, "type_of_training", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
(0, typeorm_1.Column)({
|
|
98
|
+
type: "enum",
|
|
99
|
+
enum: TypeOfCategory,
|
|
100
|
+
nullable: true
|
|
101
|
+
}),
|
|
102
|
+
__metadata("design:type", Object)
|
|
103
|
+
], TrainingRequest.prototype, "type_of_category", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, typeorm_1.Column)({ type: "text", nullable: false }),
|
|
106
|
+
__metadata("design:type", String)
|
|
107
|
+
], TrainingRequest.prototype, "description", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, typeorm_1.Column)({ type: "date", nullable: true }),
|
|
110
|
+
__metadata("design:type", Object)
|
|
111
|
+
], TrainingRequest.prototype, "start_date", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, typeorm_1.Column)({ type: "date", nullable: true }),
|
|
114
|
+
__metadata("design:type", Object)
|
|
115
|
+
], TrainingRequest.prototype, "end_date", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: false }),
|
|
118
|
+
__metadata("design:type", String)
|
|
119
|
+
], TrainingRequest.prototype, "place", void 0);
|
|
120
|
+
__decorate([
|
|
121
|
+
(0, typeorm_1.Column)({ type: "integer", nullable: false }),
|
|
122
|
+
__metadata("design:type", Number)
|
|
123
|
+
], TrainingRequest.prototype, "no_of_attendees", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
(0, typeorm_1.Column)({
|
|
126
|
+
type: "enum",
|
|
127
|
+
enum: TrainingMediaCoverageRequired,
|
|
128
|
+
default: TrainingMediaCoverageRequired.NO,
|
|
129
|
+
nullable: false
|
|
130
|
+
}),
|
|
131
|
+
__metadata("design:type", String)
|
|
132
|
+
], TrainingRequest.prototype, "media_coverage_required", void 0);
|
|
133
|
+
__decorate([
|
|
134
|
+
(0, typeorm_1.Column)({
|
|
135
|
+
type: "enum",
|
|
136
|
+
enum: TrainingRequestStatus,
|
|
137
|
+
default: TrainingRequestStatus.PENDING,
|
|
138
|
+
nullable: false
|
|
139
|
+
}),
|
|
140
|
+
__metadata("design:type", String)
|
|
141
|
+
], TrainingRequest.prototype, "status", void 0);
|
|
142
|
+
__decorate([
|
|
143
|
+
(0, typeorm_1.Column)({ type: "integer", nullable: true }),
|
|
144
|
+
__metadata("design:type", Object)
|
|
145
|
+
], TrainingRequest.prototype, "reviewer_user_id", void 0);
|
|
146
|
+
__decorate([
|
|
147
|
+
(0, typeorm_1.Column)({ type: "integer", nullable: true }),
|
|
148
|
+
__metadata("design:type", Object)
|
|
149
|
+
], TrainingRequest.prototype, "assigned_to_user_id", void 0);
|
|
150
|
+
__decorate([
|
|
151
|
+
(0, typeorm_1.Column)({ type: "timestamp", nullable: true }),
|
|
152
|
+
__metadata("design:type", Object)
|
|
153
|
+
], TrainingRequest.prototype, "assigned_at", void 0);
|
|
154
|
+
__decorate([
|
|
155
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true }),
|
|
156
|
+
__metadata("design:type", Object)
|
|
157
|
+
], TrainingRequest.prototype, "workflow_execution_id", void 0);
|
|
158
|
+
exports.TrainingRequest = TrainingRequest = __decorate([
|
|
159
|
+
(0, typeorm_1.Entity)({ name: "training_requests" }),
|
|
160
|
+
__metadata("design:paramtypes", [Number, String, String, String, Number, String, String, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object])
|
|
161
|
+
], TrainingRequest);
|
package/package.json
CHANGED
package/src/data-source.ts
CHANGED
|
@@ -74,6 +74,12 @@ import { AirportEntryPermitChat } from './models/AirportEntryPermitChatModel';
|
|
|
74
74
|
import { AirportEntryPermitAttachment } from './models/AirportEntryPermitAttachmentModel';
|
|
75
75
|
import { GroupNames } from './models/GroupNamesModel';
|
|
76
76
|
import { Group } from './models/GroupModel';
|
|
77
|
+
import { HrServiceRequest } from './models/HrServiceRequestModel';
|
|
78
|
+
import { HrServiceApprovalDetails } from './models/HrServiceApprovalModel';
|
|
79
|
+
import { HrServiceWorkFlow } from './models/HrServiceWorkflowModel';
|
|
80
|
+
import { HrServiceRequestAttachment } from './models/HrServiceAttachmentModel';
|
|
81
|
+
import { HrServiceRequestChat } from './models/HrServiceChatModel';
|
|
82
|
+
import { TrainingRequest } from './models/TrainingRequestModel';
|
|
77
83
|
|
|
78
84
|
export const AppDataSource = new DataSource({
|
|
79
85
|
type: 'postgres',
|
|
@@ -154,6 +160,12 @@ export const AppDataSource = new DataSource({
|
|
|
154
160
|
AirportEntryPermitApproval,
|
|
155
161
|
AirportEntryPermitWorkFlow,
|
|
156
162
|
AirportEntryPermitChat,
|
|
157
|
-
AirportEntryPermitAttachment
|
|
163
|
+
AirportEntryPermitAttachment,
|
|
164
|
+
HrServiceRequest,
|
|
165
|
+
HrServiceApprovalDetails,
|
|
166
|
+
HrServiceWorkFlow,
|
|
167
|
+
HrServiceRequestAttachment,
|
|
168
|
+
HrServiceRequestChat,
|
|
169
|
+
TrainingRequest
|
|
158
170
|
],
|
|
159
171
|
});
|
package/src/index.ts
CHANGED
|
@@ -69,3 +69,9 @@ export * from './models/AirportEntryPermitChatModel';
|
|
|
69
69
|
export * from './models/AirportEntryPermitAttachmentModel';
|
|
70
70
|
export * from './models/GroupNamesModel';
|
|
71
71
|
export * from './models/GroupModel';
|
|
72
|
+
export * from './models/HrServiceRequestModel';
|
|
73
|
+
export * from './models/HrServiceApprovalModel';
|
|
74
|
+
export * from './models/HrServiceWorkflowModel';
|
|
75
|
+
export * from './models/HrServiceAttachmentModel';
|
|
76
|
+
export * from './models/HrServiceChatModel';
|
|
77
|
+
export * from './models/TrainingRequestModel';
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from "./BaseModel";
|
|
3
|
+
|
|
4
|
+
export enum HrServiceApprovalStatus {
|
|
5
|
+
PENDING = "Pending",
|
|
6
|
+
IN_PROGRESS = "In Progress",
|
|
7
|
+
APPROVED = "Approved",
|
|
8
|
+
REJECTED = "Rejected",
|
|
9
|
+
ASSIGNED = "Assigned"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@Entity({ name: "hr_service_approvals" })
|
|
13
|
+
export class HrServiceApprovalDetails 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_user_id: number | null;
|
|
28
|
+
|
|
29
|
+
@Column({ type: "integer", nullable: true })
|
|
30
|
+
approver_role_id: number | null;
|
|
31
|
+
|
|
32
|
+
@Column({ type: "integer", nullable: true })
|
|
33
|
+
department_id: number | null;
|
|
34
|
+
|
|
35
|
+
@Column({ type: "integer", nullable: true })
|
|
36
|
+
section_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: 255, nullable: true, default: "" })
|
|
45
|
+
comment: string;
|
|
46
|
+
|
|
47
|
+
@Column({
|
|
48
|
+
type: "enum",
|
|
49
|
+
enum: HrServiceApprovalStatus,
|
|
50
|
+
default: HrServiceApprovalStatus.PENDING,
|
|
51
|
+
nullable: false
|
|
52
|
+
})
|
|
53
|
+
approval_status: HrServiceApprovalStatus;
|
|
54
|
+
|
|
55
|
+
@Column({ type: "boolean", default: false, nullable: false })
|
|
56
|
+
is_manager: boolean;
|
|
57
|
+
|
|
58
|
+
@Column({ type: "boolean", default: true, nullable: false })
|
|
59
|
+
is_allowed: boolean;
|
|
60
|
+
|
|
61
|
+
constructor(
|
|
62
|
+
request_id: number,
|
|
63
|
+
approver_user_id: number | null,
|
|
64
|
+
approver_role_id: number | null,
|
|
65
|
+
comment: string,
|
|
66
|
+
approval_status: HrServiceApprovalStatus,
|
|
67
|
+
level: number,
|
|
68
|
+
service_id?: number | null,
|
|
69
|
+
sub_service_id?: number | null,
|
|
70
|
+
department_id?: number | null,
|
|
71
|
+
section_id?: number | null,
|
|
72
|
+
delegate_user_id?: number | null,
|
|
73
|
+
approved_by?: number | null,
|
|
74
|
+
is_manager?: boolean,
|
|
75
|
+
is_allowed?: boolean
|
|
76
|
+
) {
|
|
77
|
+
super();
|
|
78
|
+
this.request_id = request_id;
|
|
79
|
+
this.service_id = service_id || null;
|
|
80
|
+
this.sub_service_id = sub_service_id || null;
|
|
81
|
+
this.approver_user_id = approver_user_id;
|
|
82
|
+
this.approver_role_id = approver_role_id;
|
|
83
|
+
this.comment = comment;
|
|
84
|
+
this.approval_status = approval_status;
|
|
85
|
+
this.level = level;
|
|
86
|
+
this.department_id = department_id || null;
|
|
87
|
+
this.section_id = section_id || null;
|
|
88
|
+
this.delegate_user_id = delegate_user_id || null;
|
|
89
|
+
this.approved_by = approved_by || null;
|
|
90
|
+
this.is_manager = is_manager ?? false;
|
|
91
|
+
this.is_allowed = is_allowed !== undefined ? is_allowed : true;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from "./BaseModel";
|
|
3
|
+
|
|
4
|
+
@Entity({ name: "hr_service_request_attachments" })
|
|
5
|
+
export class HrServiceRequestAttachment extends BaseModel {
|
|
6
|
+
@Column({ type: "integer", nullable: false })
|
|
7
|
+
request_id: number;
|
|
8
|
+
|
|
9
|
+
@Column({ type: "integer", nullable: true })
|
|
10
|
+
service_id: number | null;
|
|
11
|
+
|
|
12
|
+
@Column({ type: "integer", nullable: true })
|
|
13
|
+
sub_service_id: number | null;
|
|
14
|
+
|
|
15
|
+
@Column({ type: "integer", nullable: false })
|
|
16
|
+
uploaded_by: number;
|
|
17
|
+
|
|
18
|
+
@Column({ type: "varchar", length: 500, nullable: false })
|
|
19
|
+
file_url: string;
|
|
20
|
+
|
|
21
|
+
@Column({ type: "varchar", length: 255, nullable: true })
|
|
22
|
+
file_name: string;
|
|
23
|
+
|
|
24
|
+
@Column({ type: "varchar", length: 100, nullable: true })
|
|
25
|
+
file_type: string;
|
|
26
|
+
|
|
27
|
+
@Column({ type: "bigint", nullable: true })
|
|
28
|
+
file_size: number | null;
|
|
29
|
+
|
|
30
|
+
@Column({ type: "text", nullable: true })
|
|
31
|
+
description: string;
|
|
32
|
+
|
|
33
|
+
constructor(
|
|
34
|
+
request_id: number,
|
|
35
|
+
uploaded_by: number,
|
|
36
|
+
file_url: string,
|
|
37
|
+
service_id?: number | null,
|
|
38
|
+
sub_service_id?: number | null,
|
|
39
|
+
file_name?: string,
|
|
40
|
+
file_type?: string,
|
|
41
|
+
file_size?: number,
|
|
42
|
+
description?: string
|
|
43
|
+
) {
|
|
44
|
+
super();
|
|
45
|
+
this.request_id = request_id;
|
|
46
|
+
this.service_id = service_id || null;
|
|
47
|
+
this.sub_service_id = sub_service_id || null;
|
|
48
|
+
this.uploaded_by = uploaded_by;
|
|
49
|
+
this.file_url = file_url;
|
|
50
|
+
this.file_name = file_name || "";
|
|
51
|
+
this.file_type = file_type || "";
|
|
52
|
+
this.file_size = file_size || null;
|
|
53
|
+
this.description = description || "";
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from "./BaseModel";
|
|
3
|
+
|
|
4
|
+
export enum HrServiceMessageType {
|
|
5
|
+
TEXT = "text",
|
|
6
|
+
IMAGE = "image",
|
|
7
|
+
VIDEO = "video",
|
|
8
|
+
FILE = "file",
|
|
9
|
+
LINK = "link"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export enum HrServiceChatStatus {
|
|
13
|
+
SUBMITTED = "Submitted",
|
|
14
|
+
COMPLETED = "Completed",
|
|
15
|
+
PENDING = "Pending",
|
|
16
|
+
REJECTED = "Rejected",
|
|
17
|
+
ASSIGNED = "Assigned",
|
|
18
|
+
APPROVED = "Approved"
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@Entity({ name: "hr_service_request_chat" })
|
|
22
|
+
export class HrServiceRequestChat extends BaseModel {
|
|
23
|
+
@Column({ type: "integer", nullable: false })
|
|
24
|
+
request_id: number;
|
|
25
|
+
|
|
26
|
+
@Column({ type: "integer", nullable: true })
|
|
27
|
+
service_id: number | null;
|
|
28
|
+
|
|
29
|
+
@Column({ type: "integer", nullable: true })
|
|
30
|
+
sub_service_id: number | null;
|
|
31
|
+
|
|
32
|
+
@Column({ type: "integer", nullable: false })
|
|
33
|
+
user_id: number;
|
|
34
|
+
|
|
35
|
+
@Column({ type: "text", nullable: false })
|
|
36
|
+
message: string;
|
|
37
|
+
|
|
38
|
+
@Column({ type: "integer", nullable: true })
|
|
39
|
+
approver_role_id: number | null;
|
|
40
|
+
|
|
41
|
+
@Column({
|
|
42
|
+
type: "enum",
|
|
43
|
+
enum: HrServiceMessageType,
|
|
44
|
+
default: HrServiceMessageType.TEXT,
|
|
45
|
+
nullable: false
|
|
46
|
+
})
|
|
47
|
+
messageType: HrServiceMessageType;
|
|
48
|
+
|
|
49
|
+
@Column({ type: "boolean", default: false })
|
|
50
|
+
is_internal: boolean;
|
|
51
|
+
|
|
52
|
+
@Column({
|
|
53
|
+
type: "enum",
|
|
54
|
+
enum: HrServiceChatStatus,
|
|
55
|
+
default: HrServiceChatStatus.PENDING,
|
|
56
|
+
nullable: false
|
|
57
|
+
})
|
|
58
|
+
status: HrServiceChatStatus;
|
|
59
|
+
|
|
60
|
+
constructor(
|
|
61
|
+
request_id: number,
|
|
62
|
+
user_id: number,
|
|
63
|
+
message: string,
|
|
64
|
+
service_id?: number | null,
|
|
65
|
+
sub_service_id?: number | null,
|
|
66
|
+
messageType?: HrServiceMessageType,
|
|
67
|
+
is_internal?: boolean,
|
|
68
|
+
status?: HrServiceChatStatus,
|
|
69
|
+
approver_role_id?: number
|
|
70
|
+
) {
|
|
71
|
+
super();
|
|
72
|
+
this.request_id = request_id;
|
|
73
|
+
this.service_id = service_id || null;
|
|
74
|
+
this.sub_service_id = sub_service_id || null;
|
|
75
|
+
this.user_id = user_id;
|
|
76
|
+
this.message = message;
|
|
77
|
+
this.messageType = messageType || HrServiceMessageType.TEXT;
|
|
78
|
+
this.is_internal = is_internal || false;
|
|
79
|
+
this.status = status || HrServiceChatStatus.PENDING;
|
|
80
|
+
this.approver_role_id = approver_role_id || null;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from "./BaseModel";
|
|
3
|
+
|
|
4
|
+
export enum HrServiceRequestStatus {
|
|
5
|
+
PENDING = "Pending",
|
|
6
|
+
ASSIGNED = "Assigned",
|
|
7
|
+
IN_PROGRESS = "In Progress",
|
|
8
|
+
COMPLETED = "Completed",
|
|
9
|
+
APPROVED = "Approved",
|
|
10
|
+
REJECTED = "Rejected"
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@Entity({ name: "hr_service_requests" })
|
|
14
|
+
export class HrServiceRequest extends BaseModel {
|
|
15
|
+
@Column({ type: "integer", nullable: true })
|
|
16
|
+
req_user_department_id: number | null;
|
|
17
|
+
|
|
18
|
+
@Column({ type: "integer", nullable: true })
|
|
19
|
+
req_user_section_id: number | null;
|
|
20
|
+
|
|
21
|
+
@Column({ type: "integer", nullable: true })
|
|
22
|
+
req_user_position_id: number | null;
|
|
23
|
+
|
|
24
|
+
@Column({ type: "integer", nullable: true })
|
|
25
|
+
service_id: number | null;
|
|
26
|
+
|
|
27
|
+
@Column({ type: "integer", nullable: true })
|
|
28
|
+
sub_service_id: number | null;
|
|
29
|
+
|
|
30
|
+
@Column({ type: "integer", nullable: false })
|
|
31
|
+
user_id: number;
|
|
32
|
+
|
|
33
|
+
@Column({ type: "text", nullable: true })
|
|
34
|
+
description: string | null;
|
|
35
|
+
|
|
36
|
+
@Column({ type: "enum", enum: HrServiceRequestStatus, default: HrServiceRequestStatus.PENDING, nullable: false })
|
|
37
|
+
status: HrServiceRequestStatus;
|
|
38
|
+
|
|
39
|
+
@Column({ type: "integer", nullable: true })
|
|
40
|
+
reviewer_user_id: number | null;
|
|
41
|
+
|
|
42
|
+
@Column({ type: "integer", nullable: true })
|
|
43
|
+
assigned_to_user_id: number | null;
|
|
44
|
+
|
|
45
|
+
@Column({ type: "timestamp", nullable: true })
|
|
46
|
+
assigned_at: Date | null;
|
|
47
|
+
|
|
48
|
+
@Column({ type: "varchar", length: 255, nullable: true })
|
|
49
|
+
workflow_execution_id: string | null;
|
|
50
|
+
|
|
51
|
+
constructor(
|
|
52
|
+
user_id: number,
|
|
53
|
+
status: HrServiceRequestStatus = HrServiceRequestStatus.PENDING,
|
|
54
|
+
service_id?: number | null,
|
|
55
|
+
sub_service_id?: number | null,
|
|
56
|
+
req_user_department_id?: number | null,
|
|
57
|
+
req_user_section_id?: number | null,
|
|
58
|
+
req_user_position_id?: number | null,
|
|
59
|
+
description?: string | null,
|
|
60
|
+
reviewer_user_id?: number | null,
|
|
61
|
+
assigned_to_user_id?: number | null,
|
|
62
|
+
assigned_at?: Date | null,
|
|
63
|
+
workflow_execution_id?: string | null
|
|
64
|
+
) {
|
|
65
|
+
super();
|
|
66
|
+
this.user_id = user_id;
|
|
67
|
+
this.status = status;
|
|
68
|
+
this.service_id = service_id || null;
|
|
69
|
+
this.sub_service_id = sub_service_id || null;
|
|
70
|
+
this.req_user_department_id = req_user_department_id || null;
|
|
71
|
+
this.req_user_section_id = req_user_section_id || null;
|
|
72
|
+
this.req_user_position_id = req_user_position_id || null;
|
|
73
|
+
this.description = description || null;
|
|
74
|
+
this.reviewer_user_id = reviewer_user_id || null;
|
|
75
|
+
this.assigned_to_user_id = assigned_to_user_id || null;
|
|
76
|
+
this.assigned_at = assigned_at || null;
|
|
77
|
+
this.workflow_execution_id = workflow_execution_id || null;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from "./BaseModel";
|
|
3
|
+
|
|
4
|
+
export enum HrServiceWorkFlowStatus {
|
|
5
|
+
COMPLETED = "Completed",
|
|
6
|
+
NOT_YET_STARTED = "Not Yet Started",
|
|
7
|
+
PENDING = "Pending",
|
|
8
|
+
REJECTED = "Rejected"
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@Entity({ name: "hr_service_work_flows" })
|
|
12
|
+
export class HrServiceWorkFlow extends BaseModel {
|
|
13
|
+
@Column({ type: "int", 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: "int", nullable: true })
|
|
23
|
+
order: number | null;
|
|
24
|
+
|
|
25
|
+
@Column({ type: "varchar", length: 255, nullable: false })
|
|
26
|
+
content: string;
|
|
27
|
+
|
|
28
|
+
@Column({ type: "integer", nullable: true })
|
|
29
|
+
approver_role_id: number | null;
|
|
30
|
+
|
|
31
|
+
@Column({ type: "integer", nullable: true })
|
|
32
|
+
approver_user_id: number | null;
|
|
33
|
+
|
|
34
|
+
@Column({ type: "integer", nullable: true })
|
|
35
|
+
approved_by: number | null;
|
|
36
|
+
|
|
37
|
+
@Column({
|
|
38
|
+
type: "enum",
|
|
39
|
+
enum: HrServiceWorkFlowStatus,
|
|
40
|
+
default: HrServiceWorkFlowStatus.PENDING,
|
|
41
|
+
nullable: false
|
|
42
|
+
})
|
|
43
|
+
status: HrServiceWorkFlowStatus;
|
|
44
|
+
|
|
45
|
+
constructor(
|
|
46
|
+
request_id: number,
|
|
47
|
+
content: string,
|
|
48
|
+
status: HrServiceWorkFlowStatus,
|
|
49
|
+
service_id?: number | null,
|
|
50
|
+
sub_service_id?: number | null,
|
|
51
|
+
order?: number,
|
|
52
|
+
approver_role_id?: number | null,
|
|
53
|
+
approver_user_id?: number | null,
|
|
54
|
+
approved_by?: number | null
|
|
55
|
+
) {
|
|
56
|
+
super();
|
|
57
|
+
this.request_id = request_id;
|
|
58
|
+
this.service_id = service_id || null;
|
|
59
|
+
this.sub_service_id = sub_service_id || null;
|
|
60
|
+
this.content = content;
|
|
61
|
+
this.status = status;
|
|
62
|
+
this.order = order || null;
|
|
63
|
+
this.approver_role_id = approver_role_id || null;
|
|
64
|
+
this.approver_user_id = approver_user_id || null;
|
|
65
|
+
this.approved_by = approved_by || null;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|