@platform-modules/foreign-ministry 1.3.261 → 1.3.262
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/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/models/ServiceSlaApprovalModel.d.ts +13 -0
- package/dist/models/ServiceSlaApprovalModel.js +68 -0
- package/dist/models/SlaConfigModel.d.ts +16 -0
- package/dist/models/SlaConfigModel.js +58 -0
- package/dist/models/SlaRequestModel.d.ts +19 -0
- package/dist/models/SlaRequestModel.js +79 -0
- package/package.json +1 -1
- package/src/index.ts +3 -0
- package/src/models/ServiceSlaApprovalModel.ts +43 -0
- package/src/models/SlaConfigModel.ts +35 -0
- package/src/models/SlaRequestModel.ts +55 -0
package/dist/index.d.ts
CHANGED
|
@@ -91,6 +91,9 @@ export * from './models/UpdateAttendanceRequestModel';
|
|
|
91
91
|
export * from './models/UpdateAttendanceApprovalModel';
|
|
92
92
|
export * from './models/UpdateAttendanceChatModel';
|
|
93
93
|
export * from './models/UpdateAttendanceWorkflowModel';
|
|
94
|
+
export * from './models/SlaRequestModel';
|
|
95
|
+
export * from './models/ServiceSlaApprovalModel';
|
|
96
|
+
export * from './models/SlaConfigModel';
|
|
94
97
|
export * from './models/GeneralServiceRequestsModel';
|
|
95
98
|
export * from './models/GeneralServiceApprovalsModel';
|
|
96
99
|
export * from './models/GeneralServiceWorkFlowModel';
|
package/dist/index.js
CHANGED
|
@@ -108,6 +108,9 @@ __exportStar(require("./models/UpdateAttendanceRequestModel"), exports);
|
|
|
108
108
|
__exportStar(require("./models/UpdateAttendanceApprovalModel"), exports);
|
|
109
109
|
__exportStar(require("./models/UpdateAttendanceChatModel"), exports);
|
|
110
110
|
__exportStar(require("./models/UpdateAttendanceWorkflowModel"), exports);
|
|
111
|
+
__exportStar(require("./models/SlaRequestModel"), exports);
|
|
112
|
+
__exportStar(require("./models/ServiceSlaApprovalModel"), exports);
|
|
113
|
+
__exportStar(require("./models/SlaConfigModel"), exports);
|
|
111
114
|
__exportStar(require("./models/GeneralServiceRequestsModel"), exports);
|
|
112
115
|
__exportStar(require("./models/GeneralServiceApprovalsModel"), exports);
|
|
113
116
|
__exportStar(require("./models/GeneralServiceWorkFlowModel"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseModel } from "./BaseModel";
|
|
2
|
+
export declare class ServiceSlaApproval extends BaseModel {
|
|
3
|
+
request_id: number;
|
|
4
|
+
source_approval_id: number;
|
|
5
|
+
service_id: number | null;
|
|
6
|
+
sub_service_id: number | null;
|
|
7
|
+
approval_status: string;
|
|
8
|
+
level: number;
|
|
9
|
+
approver_user_id: number | null;
|
|
10
|
+
approver_role_id: number | null;
|
|
11
|
+
department_id: number | null;
|
|
12
|
+
section_id: number | null;
|
|
13
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
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.ServiceSlaApproval = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
let ServiceSlaApproval = class ServiceSlaApproval extends BaseModel_1.BaseModel {
|
|
16
|
+
};
|
|
17
|
+
exports.ServiceSlaApproval = ServiceSlaApproval;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, typeorm_1.Column)({ type: "int" }),
|
|
20
|
+
__metadata("design:type", Number)
|
|
21
|
+
], ServiceSlaApproval.prototype, "request_id", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.Column)({ type: "int" }),
|
|
24
|
+
__metadata("design:type", Number)
|
|
25
|
+
], ServiceSlaApproval.prototype, "source_approval_id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.Column)({ type: "int", nullable: true }),
|
|
28
|
+
__metadata("design:type", Object)
|
|
29
|
+
], ServiceSlaApproval.prototype, "service_id", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Column)({ type: "int", nullable: true }),
|
|
32
|
+
__metadata("design:type", Object)
|
|
33
|
+
], ServiceSlaApproval.prototype, "sub_service_id", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 64 }),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], ServiceSlaApproval.prototype, "approval_status", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)({ type: "int" }),
|
|
40
|
+
__metadata("design:type", Number)
|
|
41
|
+
], ServiceSlaApproval.prototype, "level", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({ type: "int", nullable: true }),
|
|
44
|
+
__metadata("design:type", Object)
|
|
45
|
+
], ServiceSlaApproval.prototype, "approver_user_id", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({ type: "int", nullable: true }),
|
|
48
|
+
__metadata("design:type", Object)
|
|
49
|
+
], ServiceSlaApproval.prototype, "approver_role_id", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.Column)({ type: "int", nullable: true }),
|
|
52
|
+
__metadata("design:type", Object)
|
|
53
|
+
], ServiceSlaApproval.prototype, "department_id", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.Column)({ type: "int", nullable: true }),
|
|
56
|
+
__metadata("design:type", Object)
|
|
57
|
+
], ServiceSlaApproval.prototype, "section_id", void 0);
|
|
58
|
+
exports.ServiceSlaApproval = ServiceSlaApproval = __decorate([
|
|
59
|
+
(0, typeorm_1.Entity)({ name: "sla_approval" }),
|
|
60
|
+
(0, typeorm_1.Index)("idx_sla_approval_request_id", ["request_id"]),
|
|
61
|
+
(0, typeorm_1.Index)("idx_sla_approval_source_approval_id", ["source_approval_id"]),
|
|
62
|
+
(0, typeorm_1.Index)("idx_sla_approval_service_subservice", ["service_id", "sub_service_id"]),
|
|
63
|
+
(0, typeorm_1.Index)("idx_sla_approval_approval_status", ["approval_status"]),
|
|
64
|
+
(0, typeorm_1.Index)("idx_sla_approval_level", ["level"]),
|
|
65
|
+
(0, typeorm_1.Index)("idx_sla_approval_approver_user_id", ["approver_user_id"]),
|
|
66
|
+
(0, typeorm_1.Index)("idx_sla_approval_request_level", ["request_id", "level"]),
|
|
67
|
+
(0, typeorm_1.Index)("idx_sla_approval_svc_sub_status", ["service_id", "sub_service_id", "approval_status"])
|
|
68
|
+
], ServiceSlaApproval);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseModel } from "./BaseModel";
|
|
2
|
+
export declare enum SlaDeliveryType {
|
|
3
|
+
EMAIL = "EMAIL",
|
|
4
|
+
NOTIFICATION = "NOTIFICATION",
|
|
5
|
+
BOTH = "BOTH"
|
|
6
|
+
}
|
|
7
|
+
export declare class SlaConfig extends BaseModel {
|
|
8
|
+
service_id: number | null;
|
|
9
|
+
sub_service_id: number | null;
|
|
10
|
+
status: string[];
|
|
11
|
+
type: SlaDeliveryType;
|
|
12
|
+
days: number;
|
|
13
|
+
content: string;
|
|
14
|
+
level: number | null;
|
|
15
|
+
is_active: boolean;
|
|
16
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
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.SlaConfig = exports.SlaDeliveryType = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
var SlaDeliveryType;
|
|
16
|
+
(function (SlaDeliveryType) {
|
|
17
|
+
SlaDeliveryType["EMAIL"] = "EMAIL";
|
|
18
|
+
SlaDeliveryType["NOTIFICATION"] = "NOTIFICATION";
|
|
19
|
+
SlaDeliveryType["BOTH"] = "BOTH";
|
|
20
|
+
})(SlaDeliveryType || (exports.SlaDeliveryType = SlaDeliveryType = {}));
|
|
21
|
+
let SlaConfig = class SlaConfig extends BaseModel_1.BaseModel {
|
|
22
|
+
};
|
|
23
|
+
exports.SlaConfig = SlaConfig;
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.Column)({ type: "int", nullable: true }),
|
|
26
|
+
__metadata("design:type", Object)
|
|
27
|
+
], SlaConfig.prototype, "service_id", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.Column)({ type: "int", nullable: true }),
|
|
30
|
+
__metadata("design:type", Object)
|
|
31
|
+
], SlaConfig.prototype, "sub_service_id", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.Column)({ type: "jsonb", default: () => "'[]'::jsonb" }),
|
|
34
|
+
__metadata("design:type", Array)
|
|
35
|
+
], SlaConfig.prototype, "status", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 20, default: SlaDeliveryType.NOTIFICATION }),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], SlaConfig.prototype, "type", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.Column)({ type: "int", name: "days" }),
|
|
42
|
+
__metadata("design:type", Number)
|
|
43
|
+
], SlaConfig.prototype, "days", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({ type: "text" }),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], SlaConfig.prototype, "content", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({ type: "int", nullable: true }),
|
|
50
|
+
__metadata("design:type", Object)
|
|
51
|
+
], SlaConfig.prototype, "level", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Column)({ type: "boolean", default: true }),
|
|
54
|
+
__metadata("design:type", Boolean)
|
|
55
|
+
], SlaConfig.prototype, "is_active", void 0);
|
|
56
|
+
exports.SlaConfig = SlaConfig = __decorate([
|
|
57
|
+
(0, typeorm_1.Entity)({ name: "sla_config" })
|
|
58
|
+
], SlaConfig);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseModel } from "./BaseModel";
|
|
2
|
+
export declare enum SlaRequestStatus {
|
|
3
|
+
PENDING = "Pending",
|
|
4
|
+
IN_PROGRESS = "In Progress",
|
|
5
|
+
APPROVED = "Approved",
|
|
6
|
+
REJECTED = "Rejected"
|
|
7
|
+
}
|
|
8
|
+
export declare class SlaRequest extends BaseModel {
|
|
9
|
+
req_user_department_id: number | null;
|
|
10
|
+
req_user_section_id: number | null;
|
|
11
|
+
service_id: number | null;
|
|
12
|
+
sub_service_id: number | null;
|
|
13
|
+
user_id: number;
|
|
14
|
+
status: SlaRequestStatus;
|
|
15
|
+
workflow_execution_id: string | null;
|
|
16
|
+
request_id: number;
|
|
17
|
+
request_obj: Record<string, unknown>;
|
|
18
|
+
constructor();
|
|
19
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
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.SlaRequest = exports.SlaRequestStatus = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
var SlaRequestStatus;
|
|
16
|
+
(function (SlaRequestStatus) {
|
|
17
|
+
SlaRequestStatus["PENDING"] = "Pending";
|
|
18
|
+
SlaRequestStatus["IN_PROGRESS"] = "In Progress";
|
|
19
|
+
SlaRequestStatus["APPROVED"] = "Approved";
|
|
20
|
+
SlaRequestStatus["REJECTED"] = "Rejected";
|
|
21
|
+
})(SlaRequestStatus || (exports.SlaRequestStatus = SlaRequestStatus = {}));
|
|
22
|
+
let SlaRequest = class SlaRequest extends BaseModel_1.BaseModel {
|
|
23
|
+
constructor() {
|
|
24
|
+
super();
|
|
25
|
+
this.request_id = 0;
|
|
26
|
+
this.request_obj = {};
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
exports.SlaRequest = SlaRequest;
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Column)({ type: "int", nullable: true }),
|
|
32
|
+
__metadata("design:type", Object)
|
|
33
|
+
], SlaRequest.prototype, "req_user_department_id", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({ type: "int", nullable: true }),
|
|
36
|
+
__metadata("design:type", Object)
|
|
37
|
+
], SlaRequest.prototype, "req_user_section_id", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)({ type: "int", nullable: true }),
|
|
40
|
+
__metadata("design:type", Object)
|
|
41
|
+
], SlaRequest.prototype, "service_id", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({ type: "int", nullable: true }),
|
|
44
|
+
__metadata("design:type", Object)
|
|
45
|
+
], SlaRequest.prototype, "sub_service_id", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({ type: "int", nullable: false }),
|
|
48
|
+
__metadata("design:type", Number)
|
|
49
|
+
], SlaRequest.prototype, "user_id", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.Column)({
|
|
52
|
+
type: "enum",
|
|
53
|
+
enum: SlaRequestStatus,
|
|
54
|
+
default: SlaRequestStatus.PENDING,
|
|
55
|
+
nullable: false
|
|
56
|
+
}),
|
|
57
|
+
__metadata("design:type", String)
|
|
58
|
+
], SlaRequest.prototype, "status", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true }),
|
|
61
|
+
__metadata("design:type", Object)
|
|
62
|
+
], SlaRequest.prototype, "workflow_execution_id", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, typeorm_1.Column)({ type: "int", nullable: false }),
|
|
65
|
+
__metadata("design:type", Number)
|
|
66
|
+
], SlaRequest.prototype, "request_id", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, typeorm_1.Column)({ type: "jsonb", nullable: false, default: () => "'{}'::jsonb" }),
|
|
69
|
+
__metadata("design:type", Object)
|
|
70
|
+
], SlaRequest.prototype, "request_obj", void 0);
|
|
71
|
+
exports.SlaRequest = SlaRequest = __decorate([
|
|
72
|
+
(0, typeorm_1.Entity)({ name: "sla_requests" }),
|
|
73
|
+
(0, typeorm_1.Index)("uq_sla_requests_request_id", ["request_id"], { unique: true }),
|
|
74
|
+
(0, typeorm_1.Index)("idx_sla_requests_user_id", ["user_id"]),
|
|
75
|
+
(0, typeorm_1.Index)("idx_sla_requests_service_subservice", ["service_id", "sub_service_id"]),
|
|
76
|
+
(0, typeorm_1.Index)("idx_sla_requests_workflow_execution_id", ["workflow_execution_id"]),
|
|
77
|
+
(0, typeorm_1.Index)("idx_sla_requests_status", ["status"]),
|
|
78
|
+
__metadata("design:paramtypes", [])
|
|
79
|
+
], SlaRequest);
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -91,6 +91,9 @@ export * from './models/UpdateAttendanceRequestModel';
|
|
|
91
91
|
export * from './models/UpdateAttendanceApprovalModel';
|
|
92
92
|
export * from './models/UpdateAttendanceChatModel';
|
|
93
93
|
export * from './models/UpdateAttendanceWorkflowModel';
|
|
94
|
+
export * from './models/SlaRequestModel';
|
|
95
|
+
export * from './models/ServiceSlaApprovalModel';
|
|
96
|
+
export * from './models/SlaConfigModel';
|
|
94
97
|
export * from './models/GeneralServiceRequestsModel';
|
|
95
98
|
export * from './models/GeneralServiceApprovalsModel';
|
|
96
99
|
export * from './models/GeneralServiceWorkFlowModel';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Column, Entity, Index } from "typeorm";
|
|
2
|
+
import { BaseModel } from "./BaseModel";
|
|
3
|
+
|
|
4
|
+
@Entity({ name: "sla_approval" })
|
|
5
|
+
@Index("idx_sla_approval_request_id", ["request_id"])
|
|
6
|
+
@Index("idx_sla_approval_source_approval_id", ["source_approval_id"])
|
|
7
|
+
@Index("idx_sla_approval_service_subservice", ["service_id", "sub_service_id"])
|
|
8
|
+
@Index("idx_sla_approval_approval_status", ["approval_status"])
|
|
9
|
+
@Index("idx_sla_approval_level", ["level"])
|
|
10
|
+
@Index("idx_sla_approval_approver_user_id", ["approver_user_id"])
|
|
11
|
+
@Index("idx_sla_approval_request_level", ["request_id", "level"])
|
|
12
|
+
@Index("idx_sla_approval_svc_sub_status", ["service_id", "sub_service_id", "approval_status"])
|
|
13
|
+
export class ServiceSlaApproval extends BaseModel {
|
|
14
|
+
@Column({ type: "int" })
|
|
15
|
+
request_id: number;
|
|
16
|
+
|
|
17
|
+
@Column({ type: "int" })
|
|
18
|
+
source_approval_id: number;
|
|
19
|
+
|
|
20
|
+
@Column({ type: "int", nullable: true })
|
|
21
|
+
service_id: number | null;
|
|
22
|
+
|
|
23
|
+
@Column({ type: "int", nullable: true })
|
|
24
|
+
sub_service_id: number | null;
|
|
25
|
+
|
|
26
|
+
@Column({ type: "varchar", length: 64 })
|
|
27
|
+
approval_status: string;
|
|
28
|
+
|
|
29
|
+
@Column({ type: "int" })
|
|
30
|
+
level: number;
|
|
31
|
+
|
|
32
|
+
@Column({ type: "int", nullable: true })
|
|
33
|
+
approver_user_id: number | null;
|
|
34
|
+
|
|
35
|
+
@Column({ type: "int", nullable: true })
|
|
36
|
+
approver_role_id: number | null;
|
|
37
|
+
|
|
38
|
+
@Column({ type: "int", nullable: true })
|
|
39
|
+
department_id: number | null;
|
|
40
|
+
|
|
41
|
+
@Column({ type: "int", nullable: true })
|
|
42
|
+
section_id: number | null;
|
|
43
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from "./BaseModel";
|
|
3
|
+
|
|
4
|
+
export enum SlaDeliveryType {
|
|
5
|
+
EMAIL = "EMAIL",
|
|
6
|
+
NOTIFICATION = "NOTIFICATION",
|
|
7
|
+
BOTH = "BOTH"
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@Entity({ name: "sla_config" })
|
|
11
|
+
export class SlaConfig extends BaseModel {
|
|
12
|
+
@Column({ type: "int", nullable: true })
|
|
13
|
+
service_id: number | null;
|
|
14
|
+
|
|
15
|
+
@Column({ type: "int", nullable: true })
|
|
16
|
+
sub_service_id: number | null;
|
|
17
|
+
|
|
18
|
+
@Column({ type: "jsonb", default: () => "'[]'::jsonb" })
|
|
19
|
+
status: string[];
|
|
20
|
+
|
|
21
|
+
@Column({ type: "varchar", length: 20, default: SlaDeliveryType.NOTIFICATION })
|
|
22
|
+
type: SlaDeliveryType;
|
|
23
|
+
|
|
24
|
+
@Column({ type: "int", name: "days" })
|
|
25
|
+
days: number;
|
|
26
|
+
|
|
27
|
+
@Column({ type: "text" })
|
|
28
|
+
content: string;
|
|
29
|
+
|
|
30
|
+
@Column({ type: "int", nullable: true })
|
|
31
|
+
level: number | null;
|
|
32
|
+
|
|
33
|
+
@Column({ type: "boolean", default: true })
|
|
34
|
+
is_active: boolean;
|
|
35
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Column, Entity, Index } from "typeorm";
|
|
2
|
+
import { BaseModel } from "./BaseModel";
|
|
3
|
+
|
|
4
|
+
export enum SlaRequestStatus {
|
|
5
|
+
PENDING = "Pending",
|
|
6
|
+
IN_PROGRESS = "In Progress",
|
|
7
|
+
APPROVED = "Approved",
|
|
8
|
+
REJECTED = "Rejected"
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@Entity({ name: "sla_requests" })
|
|
12
|
+
@Index("uq_sla_requests_request_id", ["request_id"], { unique: true })
|
|
13
|
+
@Index("idx_sla_requests_user_id", ["user_id"])
|
|
14
|
+
@Index("idx_sla_requests_service_subservice", ["service_id", "sub_service_id"])
|
|
15
|
+
@Index("idx_sla_requests_workflow_execution_id", ["workflow_execution_id"])
|
|
16
|
+
@Index("idx_sla_requests_status", ["status"])
|
|
17
|
+
export class SlaRequest extends BaseModel {
|
|
18
|
+
@Column({ type: "int", nullable: true })
|
|
19
|
+
req_user_department_id: number | null;
|
|
20
|
+
|
|
21
|
+
@Column({ type: "int", nullable: true })
|
|
22
|
+
req_user_section_id: number | null;
|
|
23
|
+
|
|
24
|
+
@Column({ type: "int", nullable: true })
|
|
25
|
+
service_id: number | null;
|
|
26
|
+
|
|
27
|
+
@Column({ type: "int", nullable: true })
|
|
28
|
+
sub_service_id: number | null;
|
|
29
|
+
|
|
30
|
+
@Column({ type: "int", nullable: false })
|
|
31
|
+
user_id: number;
|
|
32
|
+
|
|
33
|
+
@Column({
|
|
34
|
+
type: "enum",
|
|
35
|
+
enum: SlaRequestStatus,
|
|
36
|
+
default: SlaRequestStatus.PENDING,
|
|
37
|
+
nullable: false
|
|
38
|
+
})
|
|
39
|
+
status: SlaRequestStatus;
|
|
40
|
+
|
|
41
|
+
@Column({ type: "varchar", length: 255, nullable: true })
|
|
42
|
+
workflow_execution_id: string | null;
|
|
43
|
+
|
|
44
|
+
@Column({ type: "int", nullable: false })
|
|
45
|
+
request_id: number;
|
|
46
|
+
|
|
47
|
+
@Column({ type: "jsonb", nullable: false, default: () => "'{}'::jsonb" })
|
|
48
|
+
request_obj: Record<string, unknown>;
|
|
49
|
+
|
|
50
|
+
constructor() {
|
|
51
|
+
super();
|
|
52
|
+
this.request_id = 0;
|
|
53
|
+
this.request_obj = {};
|
|
54
|
+
}
|
|
55
|
+
}
|