@platform-modules/foreign-ministry 1.0.90 → 1.0.91
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 +8 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/models/FinancialRequestsModel.d.ts +2 -4
- package/dist/models/FinancialRequestsModel.js +6 -12
- package/dist/models/WorkflowDefinitions.d.ts +16 -0
- package/dist/models/WorkflowDefinitions.js +86 -0
- package/dist/models/WorkflowHierarchy.d.ts +16 -0
- package/dist/models/WorkflowHierarchy.js +81 -0
- package/dist/models/WorkflowTask.d.ts +7 -0
- package/dist/models/WorkflowTask.js +39 -0
- package/dist/models/WorkflowTaskNames.d.ts +8 -0
- package/dist/models/WorkflowTaskNames.js +44 -0
- package/package.json +1 -1
- package/src/data-source.ts +10 -0
- package/src/index.ts +4 -0
- package/src/models/FinancialRequestsModel.ts +3 -10
- package/src/models/WorkflowDefinitions.ts +71 -0
- package/src/models/WorkflowHierarchy.ts +67 -0
- package/src/models/WorkflowTask.ts +26 -0
- package/src/models/WorkflowTaskNames.ts +31 -0
package/dist/data-source.js
CHANGED
|
@@ -66,6 +66,10 @@ const FinancialChatsModel_1 = require("./models/FinancialChatsModel");
|
|
|
66
66
|
const FinancialWorkFlowModel_1 = require("./models/FinancialWorkFlowModel");
|
|
67
67
|
const FinancialAttachmentsModel_1 = require("./models/FinancialAttachmentsModel");
|
|
68
68
|
const RequestTypeMasterModel_1 = require("./models/RequestTypeMasterModel");
|
|
69
|
+
const WorkflowTask_1 = require("./models/WorkflowTask");
|
|
70
|
+
const WorkflowTaskNames_1 = require("./models/WorkflowTaskNames");
|
|
71
|
+
const WorkflowDefinitions_1 = require("./models/WorkflowDefinitions");
|
|
72
|
+
const WorkflowHierarchy_1 = require("./models/WorkflowHierarchy");
|
|
69
73
|
exports.AppDataSource = new typeorm_1.DataSource({
|
|
70
74
|
type: 'postgres',
|
|
71
75
|
host: process.env.DB_HOST || 'localhost',
|
|
@@ -137,5 +141,9 @@ exports.AppDataSource = new typeorm_1.DataSource({
|
|
|
137
141
|
FinancialWorkFlowModel_1.FinancialWorkFlow,
|
|
138
142
|
FinancialAttachmentsModel_1.FinancialAttachments,
|
|
139
143
|
RequestTypeMasterModel_1.RequestTypeMaster,
|
|
144
|
+
WorkflowTask_1.WorkflowTask,
|
|
145
|
+
WorkflowTaskNames_1.WorkflowTaskNames,
|
|
146
|
+
WorkflowDefinitions_1.WorkflowDefinitions,
|
|
147
|
+
WorkflowHierarchy_1.WorkflowHierarchy,
|
|
140
148
|
],
|
|
141
149
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -59,3 +59,7 @@ export * from './models/FinancialChatsModel';
|
|
|
59
59
|
export * from './models/FinancialAttachmentsModel';
|
|
60
60
|
export * from './models/FinancialWorkFlowModel';
|
|
61
61
|
export * from './models/RequestTypeMasterModel';
|
|
62
|
+
export * from './models/WorkflowTask';
|
|
63
|
+
export * from './models/WorkflowTaskNames';
|
|
64
|
+
export * from './models/WorkflowDefinitions';
|
|
65
|
+
export * from './models/WorkflowHierarchy';
|
package/dist/index.js
CHANGED
|
@@ -75,3 +75,7 @@ __exportStar(require("./models/FinancialChatsModel"), exports);
|
|
|
75
75
|
__exportStar(require("./models/FinancialAttachmentsModel"), exports);
|
|
76
76
|
__exportStar(require("./models/FinancialWorkFlowModel"), exports);
|
|
77
77
|
__exportStar(require("./models/RequestTypeMasterModel"), exports);
|
|
78
|
+
__exportStar(require("./models/WorkflowTask"), exports);
|
|
79
|
+
__exportStar(require("./models/WorkflowTaskNames"), exports);
|
|
80
|
+
__exportStar(require("./models/WorkflowDefinitions"), exports);
|
|
81
|
+
__exportStar(require("./models/WorkflowHierarchy"), exports);
|
|
@@ -8,7 +8,6 @@ import type { FinancialChats } from './FinancialChatsModel';
|
|
|
8
8
|
import type { FinancialApprovals } from './FinancialApprovalsModel';
|
|
9
9
|
import type { FinancialWorkFlow } from './FinancialWorkFlowModel';
|
|
10
10
|
import type { FinancialAttachments } from './FinancialAttachmentsModel';
|
|
11
|
-
import type { RequestTypeMaster } from './RequestTypeMasterModel';
|
|
12
11
|
export declare enum FinancialRequestStatus {
|
|
13
12
|
DRAFT = "Draft",
|
|
14
13
|
SUBMITTED = "Submitted",
|
|
@@ -28,7 +27,6 @@ export declare class FinancialRequests extends BaseModel {
|
|
|
28
27
|
department_id: number | null;
|
|
29
28
|
email_address: string;
|
|
30
29
|
contact_number: string;
|
|
31
|
-
request_type_id: number;
|
|
32
30
|
request_date: Date;
|
|
33
31
|
request_status: FinancialRequestStatus;
|
|
34
32
|
request_close_date: Date | null;
|
|
@@ -39,6 +37,7 @@ export declare class FinancialRequests extends BaseModel {
|
|
|
39
37
|
sub_service_id: number | null;
|
|
40
38
|
section_id: number | null;
|
|
41
39
|
reporting_manager: number | null;
|
|
40
|
+
workflow_execution_id: string | null;
|
|
42
41
|
payslipRequest?: PayslipRequests;
|
|
43
42
|
salaryCertificateRequest?: SalaryCertificateRequests;
|
|
44
43
|
allowanceRequest?: AllowanceRequests;
|
|
@@ -48,6 +47,5 @@ export declare class FinancialRequests extends BaseModel {
|
|
|
48
47
|
approvals?: FinancialApprovals[];
|
|
49
48
|
workflows?: FinancialWorkFlow[];
|
|
50
49
|
attachments?: FinancialAttachments[];
|
|
51
|
-
|
|
52
|
-
constructor(user_id: number, employee_id: string, employee_name: string, email_address: string, contact_number: string, request_type_id: number, service_id: number | null, sub_service_id: number | null, section_id: number | null, reporting_manager: number | null);
|
|
50
|
+
constructor(user_id: number, employee_id: string, employee_name: string, email_address: string, contact_number: string, service_id: number | null, sub_service_id: number | null, section_id: number | null, reporting_manager: number | null);
|
|
53
51
|
}
|
|
@@ -24,14 +24,13 @@ var FinancialRequestStatus;
|
|
|
24
24
|
FinancialRequestStatus["CANCELLED"] = "Cancelled";
|
|
25
25
|
})(FinancialRequestStatus || (exports.FinancialRequestStatus = FinancialRequestStatus = {}));
|
|
26
26
|
let FinancialRequests = class FinancialRequests extends BaseModel_1.BaseModel {
|
|
27
|
-
constructor(user_id, employee_id, employee_name, email_address, contact_number,
|
|
27
|
+
constructor(user_id, employee_id, employee_name, email_address, contact_number, service_id, sub_service_id, section_id, reporting_manager) {
|
|
28
28
|
super();
|
|
29
29
|
this.user_id = user_id;
|
|
30
30
|
this.employee_id = employee_id;
|
|
31
31
|
this.employee_name = employee_name;
|
|
32
32
|
this.email_address = email_address;
|
|
33
33
|
this.contact_number = contact_number;
|
|
34
|
-
this.request_type_id = request_type_id;
|
|
35
34
|
this.request_date = new Date();
|
|
36
35
|
this.request_status = FinancialRequestStatus.PENDING;
|
|
37
36
|
this.service_id = service_id;
|
|
@@ -73,10 +72,6 @@ __decorate([
|
|
|
73
72
|
(0, typeorm_1.Column)({ type: 'varchar', length: 20 }),
|
|
74
73
|
__metadata("design:type", String)
|
|
75
74
|
], FinancialRequests.prototype, "contact_number", void 0);
|
|
76
|
-
__decorate([
|
|
77
|
-
(0, typeorm_1.Column)({ type: 'int' }),
|
|
78
|
-
__metadata("design:type", Number)
|
|
79
|
-
], FinancialRequests.prototype, "request_type_id", void 0);
|
|
80
75
|
__decorate([
|
|
81
76
|
(0, typeorm_1.Column)({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' }),
|
|
82
77
|
__metadata("design:type", Date)
|
|
@@ -117,6 +112,10 @@ __decorate([
|
|
|
117
112
|
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
118
113
|
__metadata("design:type", Object)
|
|
119
114
|
], FinancialRequests.prototype, "reporting_manager", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
|
|
117
|
+
__metadata("design:type", Object)
|
|
118
|
+
], FinancialRequests.prototype, "workflow_execution_id", void 0);
|
|
120
119
|
__decorate([
|
|
121
120
|
(0, typeorm_1.OneToOne)('PayslipRequests', 'financialRequest', { nullable: true }),
|
|
122
121
|
__metadata("design:type", Function)
|
|
@@ -153,12 +152,7 @@ __decorate([
|
|
|
153
152
|
(0, typeorm_1.OneToMany)('FinancialAttachments', 'financialRequest'),
|
|
154
153
|
__metadata("design:type", Array)
|
|
155
154
|
], FinancialRequests.prototype, "attachments", void 0);
|
|
156
|
-
__decorate([
|
|
157
|
-
(0, typeorm_1.ManyToOne)('RequestTypeMaster'),
|
|
158
|
-
(0, typeorm_1.JoinColumn)({ name: 'request_type_id' }),
|
|
159
|
-
__metadata("design:type", Function)
|
|
160
|
-
], FinancialRequests.prototype, "requestType", void 0);
|
|
161
155
|
exports.FinancialRequests = FinancialRequests = __decorate([
|
|
162
156
|
(0, typeorm_1.Entity)({ name: 'financial_requests' }),
|
|
163
|
-
__metadata("design:paramtypes", [Number, String, String, String, String,
|
|
157
|
+
__metadata("design:paramtypes", [Number, String, String, String, String, Object, Object, Object, Object])
|
|
164
158
|
], FinancialRequests);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseModel } from './BaseModel';
|
|
2
|
+
import { FMServices } from './FMServices';
|
|
3
|
+
import { FMSubServices } from './FMSubservices';
|
|
4
|
+
export declare class WorkflowDefinitions extends BaseModel {
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
version: number;
|
|
8
|
+
is_active: boolean;
|
|
9
|
+
service_type: 'internal' | 'external' | 'none';
|
|
10
|
+
service_id: number | null;
|
|
11
|
+
service: FMServices;
|
|
12
|
+
sub_service_id: number | null;
|
|
13
|
+
sub_service: FMSubServices;
|
|
14
|
+
status: 'draft' | 'published';
|
|
15
|
+
constructor(name: string, description?: string, version?: number, is_active?: boolean, service_id?: number | null, sub_service_id?: number | null, status?: 'draft' | 'published', service_type?: 'internal' | 'external' | 'none');
|
|
16
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
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.WorkflowDefinitions = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
const FMServices_1 = require("./FMServices");
|
|
16
|
+
const FMSubservices_1 = require("./FMSubservices");
|
|
17
|
+
let WorkflowDefinitions = class WorkflowDefinitions extends BaseModel_1.BaseModel {
|
|
18
|
+
constructor(name, description, version, is_active, service_id, sub_service_id, status, service_type) {
|
|
19
|
+
super();
|
|
20
|
+
this.name = name;
|
|
21
|
+
this.description = description || '';
|
|
22
|
+
this.version = version || 1;
|
|
23
|
+
this.is_active = is_active !== undefined ? is_active : true;
|
|
24
|
+
this.service_id = service_id || null;
|
|
25
|
+
this.sub_service_id = sub_service_id || null;
|
|
26
|
+
this.status = status || 'draft';
|
|
27
|
+
this.service_type = service_type || 'none';
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
exports.WorkflowDefinitions = WorkflowDefinitions;
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: false }),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], WorkflowDefinitions.prototype, "name", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], WorkflowDefinitions.prototype, "description", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.Column)({ type: 'integer', default: 1 }),
|
|
41
|
+
__metadata("design:type", Number)
|
|
42
|
+
], WorkflowDefinitions.prototype, "version", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: true }),
|
|
45
|
+
__metadata("design:type", Boolean)
|
|
46
|
+
], WorkflowDefinitions.prototype, "is_active", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.Column)({
|
|
49
|
+
type: 'varchar',
|
|
50
|
+
length: 20,
|
|
51
|
+
nullable: true,
|
|
52
|
+
enum: ['internal', 'external', 'none']
|
|
53
|
+
}),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], WorkflowDefinitions.prototype, "service_type", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.Column)({ type: 'bigint', nullable: true }),
|
|
58
|
+
__metadata("design:type", Object)
|
|
59
|
+
], WorkflowDefinitions.prototype, "service_id", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, typeorm_1.ManyToOne)(() => FMServices_1.FMServices),
|
|
62
|
+
(0, typeorm_1.JoinColumn)({ name: 'service_id' }),
|
|
63
|
+
__metadata("design:type", FMServices_1.FMServices)
|
|
64
|
+
], WorkflowDefinitions.prototype, "service", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, typeorm_1.Column)({ type: 'bigint', nullable: true }),
|
|
67
|
+
__metadata("design:type", Object)
|
|
68
|
+
], WorkflowDefinitions.prototype, "sub_service_id", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, typeorm_1.ManyToOne)(() => FMSubservices_1.FMSubServices),
|
|
71
|
+
(0, typeorm_1.JoinColumn)({ name: 'sub_service_id' }),
|
|
72
|
+
__metadata("design:type", FMSubservices_1.FMSubServices)
|
|
73
|
+
], WorkflowDefinitions.prototype, "sub_service", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, typeorm_1.Column)({
|
|
76
|
+
type: 'varchar',
|
|
77
|
+
length: 20,
|
|
78
|
+
default: 'draft',
|
|
79
|
+
enum: ['draft', 'published']
|
|
80
|
+
}),
|
|
81
|
+
__metadata("design:type", String)
|
|
82
|
+
], WorkflowDefinitions.prototype, "status", void 0);
|
|
83
|
+
exports.WorkflowDefinitions = WorkflowDefinitions = __decorate([
|
|
84
|
+
(0, typeorm_1.Entity)({ name: 'workflow_definitions' }),
|
|
85
|
+
__metadata("design:paramtypes", [String, String, Number, Boolean, Object, Object, String, String])
|
|
86
|
+
], WorkflowDefinitions);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseModel } from './BaseModel';
|
|
2
|
+
import { WorkflowDefinitions } from './WorkflowDefinitions';
|
|
3
|
+
export declare class WorkflowHierarchy extends BaseModel {
|
|
4
|
+
workflow_definition_id: number;
|
|
5
|
+
department_id: number;
|
|
6
|
+
section_id: number;
|
|
7
|
+
approval_role_id: number;
|
|
8
|
+
approval_user_id: number;
|
|
9
|
+
taskname: string | null;
|
|
10
|
+
status: string | null;
|
|
11
|
+
task: any | null;
|
|
12
|
+
step_order: number;
|
|
13
|
+
is_required: boolean;
|
|
14
|
+
workflow_definition: WorkflowDefinitions;
|
|
15
|
+
constructor(workflow_definition_id: number, department_id: number, section_id: number, approval_role_id: number, approval_user_id: number, step_order: number, is_required?: boolean, taskname?: string, status?: string, task?: any);
|
|
16
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
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.WorkflowHierarchy = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
const WorkflowDefinitions_1 = require("./WorkflowDefinitions");
|
|
16
|
+
let WorkflowHierarchy = class WorkflowHierarchy extends BaseModel_1.BaseModel {
|
|
17
|
+
constructor(workflow_definition_id, department_id, section_id, approval_role_id, approval_user_id, step_order, is_required, taskname, status, task) {
|
|
18
|
+
super();
|
|
19
|
+
this.workflow_definition_id = workflow_definition_id;
|
|
20
|
+
this.department_id = department_id;
|
|
21
|
+
this.section_id = section_id;
|
|
22
|
+
this.approval_role_id = approval_role_id;
|
|
23
|
+
this.approval_user_id = approval_user_id;
|
|
24
|
+
this.step_order = step_order;
|
|
25
|
+
this.is_required = is_required !== undefined ? is_required : true;
|
|
26
|
+
this.taskname = taskname || null;
|
|
27
|
+
this.status = status || null;
|
|
28
|
+
this.task = task || null;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
exports.WorkflowHierarchy = WorkflowHierarchy;
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: false }),
|
|
34
|
+
__metadata("design:type", Number)
|
|
35
|
+
], WorkflowHierarchy.prototype, "workflow_definition_id", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: true }),
|
|
38
|
+
__metadata("design:type", Number)
|
|
39
|
+
], WorkflowHierarchy.prototype, "department_id", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: true }),
|
|
42
|
+
__metadata("design:type", Number)
|
|
43
|
+
], WorkflowHierarchy.prototype, "section_id", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: true }),
|
|
46
|
+
__metadata("design:type", Number)
|
|
47
|
+
], WorkflowHierarchy.prototype, "approval_role_id", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: true }),
|
|
50
|
+
__metadata("design:type", Number)
|
|
51
|
+
], WorkflowHierarchy.prototype, "approval_user_id", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
|
|
54
|
+
__metadata("design:type", Object)
|
|
55
|
+
], WorkflowHierarchy.prototype, "taskname", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 50, nullable: true }),
|
|
58
|
+
__metadata("design:type", Object)
|
|
59
|
+
], WorkflowHierarchy.prototype, "status", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
62
|
+
__metadata("design:type", Object)
|
|
63
|
+
], WorkflowHierarchy.prototype, "task", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: false }),
|
|
66
|
+
__metadata("design:type", Number)
|
|
67
|
+
], WorkflowHierarchy.prototype, "step_order", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: true }),
|
|
70
|
+
__metadata("design:type", Boolean)
|
|
71
|
+
], WorkflowHierarchy.prototype, "is_required", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, typeorm_1.ManyToOne)(() => WorkflowDefinitions_1.WorkflowDefinitions, { onDelete: 'CASCADE' }),
|
|
74
|
+
(0, typeorm_1.JoinColumn)({ name: 'workflow_definition_id' }),
|
|
75
|
+
__metadata("design:type", WorkflowDefinitions_1.WorkflowDefinitions)
|
|
76
|
+
], WorkflowHierarchy.prototype, "workflow_definition", void 0);
|
|
77
|
+
exports.WorkflowHierarchy = WorkflowHierarchy = __decorate([
|
|
78
|
+
(0, typeorm_1.Entity)({ name: 'workflow_hierarchy' }),
|
|
79
|
+
(0, typeorm_1.Unique)(['workflow_definition_id', 'step_order']),
|
|
80
|
+
__metadata("design:paramtypes", [Number, Number, Number, Number, Number, Number, Boolean, String, String, Object])
|
|
81
|
+
], WorkflowHierarchy);
|
|
@@ -0,0 +1,39 @@
|
|
|
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.WorkflowTask = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
let WorkflowTask = class WorkflowTask extends BaseModel_1.BaseModel {
|
|
16
|
+
constructor(name, task_id, task_type) {
|
|
17
|
+
super();
|
|
18
|
+
this.name = name;
|
|
19
|
+
this.task_id = task_id || 0;
|
|
20
|
+
this.task_type = task_type || '';
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
exports.WorkflowTask = WorkflowTask;
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
26
|
+
__metadata("design:type", Number)
|
|
27
|
+
], WorkflowTask.prototype, "task_id", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: false }),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], WorkflowTask.prototype, "name", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 200, nullable: true }),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], WorkflowTask.prototype, "task_type", void 0);
|
|
36
|
+
exports.WorkflowTask = WorkflowTask = __decorate([
|
|
37
|
+
(0, typeorm_1.Entity)({ name: 'workflow_tasks' }),
|
|
38
|
+
__metadata("design:paramtypes", [String, Number, String])
|
|
39
|
+
], WorkflowTask);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseModel } from './BaseModel';
|
|
2
|
+
export declare class WorkflowTaskNames extends BaseModel {
|
|
3
|
+
name: string;
|
|
4
|
+
task_id: number;
|
|
5
|
+
description: string;
|
|
6
|
+
task_type: string;
|
|
7
|
+
constructor(name: string, task_id: number, description: string, task_type: string);
|
|
8
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
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.WorkflowTaskNames = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
let WorkflowTaskNames = class WorkflowTaskNames extends BaseModel_1.BaseModel {
|
|
16
|
+
constructor(name, task_id, description, task_type) {
|
|
17
|
+
super();
|
|
18
|
+
this.name = name;
|
|
19
|
+
this.task_id = task_id;
|
|
20
|
+
this.description = description;
|
|
21
|
+
this.task_type = task_type;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.WorkflowTaskNames = WorkflowTaskNames;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: false }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], WorkflowTaskNames.prototype, "name", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: false }),
|
|
31
|
+
__metadata("design:type", Number)
|
|
32
|
+
], WorkflowTaskNames.prototype, "task_id", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 200, nullable: true }),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], WorkflowTaskNames.prototype, "description", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 200, nullable: true }),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], WorkflowTaskNames.prototype, "task_type", void 0);
|
|
41
|
+
exports.WorkflowTaskNames = WorkflowTaskNames = __decorate([
|
|
42
|
+
(0, typeorm_1.Entity)({ name: 'workflow_task_names' }),
|
|
43
|
+
__metadata("design:paramtypes", [String, Number, String, String])
|
|
44
|
+
], WorkflowTaskNames);
|
package/package.json
CHANGED
package/src/data-source.ts
CHANGED
|
@@ -70,6 +70,12 @@ import { FinancialAttachments } from './models/FinancialAttachmentsModel';
|
|
|
70
70
|
import { RequestTypeMaster } from './models/RequestTypeMasterModel';
|
|
71
71
|
|
|
72
72
|
|
|
73
|
+
import { WorkflowTask } from './models/WorkflowTask';
|
|
74
|
+
import { WorkflowTaskNames } from './models/WorkflowTaskNames';
|
|
75
|
+
import { WorkflowDefinitions } from './models/WorkflowDefinitions';
|
|
76
|
+
import { WorkflowHierarchy } from './models/WorkflowHierarchy';
|
|
77
|
+
|
|
78
|
+
|
|
73
79
|
|
|
74
80
|
export const AppDataSource = new DataSource({
|
|
75
81
|
type: 'postgres',
|
|
@@ -142,5 +148,9 @@ export const AppDataSource = new DataSource({
|
|
|
142
148
|
FinancialWorkFlow,
|
|
143
149
|
FinancialAttachments,
|
|
144
150
|
RequestTypeMaster,
|
|
151
|
+
WorkflowTask,
|
|
152
|
+
WorkflowTaskNames,
|
|
153
|
+
WorkflowDefinitions,
|
|
154
|
+
WorkflowHierarchy,
|
|
145
155
|
],
|
|
146
156
|
});
|
package/src/index.ts
CHANGED
|
@@ -59,3 +59,7 @@ export * from './models/FinancialChatsModel';
|
|
|
59
59
|
export * from './models/FinancialAttachmentsModel';
|
|
60
60
|
export * from './models/FinancialWorkFlowModel';
|
|
61
61
|
export * from './models/RequestTypeMasterModel';
|
|
62
|
+
export * from './models/WorkflowTask';
|
|
63
|
+
export * from './models/WorkflowTaskNames';
|
|
64
|
+
export * from './models/WorkflowDefinitions';
|
|
65
|
+
export * from './models/WorkflowHierarchy';
|
|
@@ -11,7 +11,6 @@ import type { FinancialChats } from './FinancialChatsModel';
|
|
|
11
11
|
import type { FinancialApprovals } from './FinancialApprovalsModel';
|
|
12
12
|
import type { FinancialWorkFlow } from './FinancialWorkFlowModel';
|
|
13
13
|
import type { FinancialAttachments } from './FinancialAttachmentsModel';
|
|
14
|
-
import type { RequestTypeMaster } from './RequestTypeMasterModel';
|
|
15
14
|
|
|
16
15
|
export enum FinancialRequestStatus {
|
|
17
16
|
DRAFT = "Draft",
|
|
@@ -50,9 +49,6 @@ export class FinancialRequests extends BaseModel {
|
|
|
50
49
|
@Column({ type: 'varchar', length: 20 })
|
|
51
50
|
contact_number: string;
|
|
52
51
|
|
|
53
|
-
@Column({ type: 'int' })
|
|
54
|
-
request_type_id: number;
|
|
55
|
-
|
|
56
52
|
@Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
|
|
57
53
|
request_date: Date;
|
|
58
54
|
|
|
@@ -83,6 +79,9 @@ export class FinancialRequests extends BaseModel {
|
|
|
83
79
|
@Column({ type: 'int', nullable: true })
|
|
84
80
|
reporting_manager: number | null;
|
|
85
81
|
|
|
82
|
+
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
83
|
+
workflow_execution_id: string | null;
|
|
84
|
+
|
|
86
85
|
@OneToOne('PayslipRequests', 'financialRequest', { nullable: true })
|
|
87
86
|
payslipRequest?: PayslipRequests;
|
|
88
87
|
|
|
@@ -110,17 +109,12 @@ export class FinancialRequests extends BaseModel {
|
|
|
110
109
|
@OneToMany('FinancialAttachments', 'financialRequest')
|
|
111
110
|
attachments?: FinancialAttachments[];
|
|
112
111
|
|
|
113
|
-
@ManyToOne('RequestTypeMaster')
|
|
114
|
-
@JoinColumn({ name: 'request_type_id' })
|
|
115
|
-
requestType?: RequestTypeMaster;
|
|
116
|
-
|
|
117
112
|
constructor(
|
|
118
113
|
user_id: number,
|
|
119
114
|
employee_id: string,
|
|
120
115
|
employee_name: string,
|
|
121
116
|
email_address: string,
|
|
122
117
|
contact_number: string,
|
|
123
|
-
request_type_id: number,
|
|
124
118
|
service_id: number | null,
|
|
125
119
|
sub_service_id: number | null,
|
|
126
120
|
section_id: number | null,
|
|
@@ -132,7 +126,6 @@ export class FinancialRequests extends BaseModel {
|
|
|
132
126
|
this.employee_name = employee_name;
|
|
133
127
|
this.email_address = email_address;
|
|
134
128
|
this.contact_number = contact_number;
|
|
135
|
-
this.request_type_id = request_type_id;
|
|
136
129
|
this.request_date = new Date();
|
|
137
130
|
this.request_status = FinancialRequestStatus.PENDING;
|
|
138
131
|
this.service_id = service_id;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Column, Entity, ManyToOne, JoinColumn } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
import { FMServices } from './FMServices';
|
|
4
|
+
import { FMSubServices } from './FMSubservices';
|
|
5
|
+
|
|
6
|
+
@Entity({ name: 'workflow_definitions' })
|
|
7
|
+
export class WorkflowDefinitions extends BaseModel {
|
|
8
|
+
|
|
9
|
+
@Column({ type: 'varchar', length: 100, nullable: false})
|
|
10
|
+
name: string;
|
|
11
|
+
|
|
12
|
+
@Column({ type: 'text', nullable: true })
|
|
13
|
+
description: string;
|
|
14
|
+
|
|
15
|
+
@Column({ type: 'integer', default: 1 })
|
|
16
|
+
version: number;
|
|
17
|
+
|
|
18
|
+
@Column({ type: 'boolean', default: true })
|
|
19
|
+
is_active: boolean;
|
|
20
|
+
|
|
21
|
+
@Column({
|
|
22
|
+
type: 'varchar',
|
|
23
|
+
length: 20,
|
|
24
|
+
nullable: true,
|
|
25
|
+
enum: ['internal', 'external', 'none']
|
|
26
|
+
})
|
|
27
|
+
service_type: 'internal' | 'external' | 'none';
|
|
28
|
+
|
|
29
|
+
@Column({ type: 'bigint', nullable: true })
|
|
30
|
+
service_id: number | null;
|
|
31
|
+
|
|
32
|
+
@ManyToOne(() => FMServices)
|
|
33
|
+
@JoinColumn({ name: 'service_id' })
|
|
34
|
+
service: FMServices;
|
|
35
|
+
|
|
36
|
+
@Column({ type: 'bigint', nullable: true })
|
|
37
|
+
sub_service_id: number | null;
|
|
38
|
+
|
|
39
|
+
@ManyToOne(() => FMSubServices)
|
|
40
|
+
@JoinColumn({ name: 'sub_service_id' })
|
|
41
|
+
sub_service: FMSubServices;
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@Column({
|
|
45
|
+
type: 'varchar',
|
|
46
|
+
length: 20,
|
|
47
|
+
default: 'draft',
|
|
48
|
+
enum: ['draft', 'published']
|
|
49
|
+
})
|
|
50
|
+
status: 'draft' | 'published' ;
|
|
51
|
+
constructor(
|
|
52
|
+
name: string,
|
|
53
|
+
description?: string,
|
|
54
|
+
version?: number,
|
|
55
|
+
is_active?: boolean,
|
|
56
|
+
service_id?: number | null,
|
|
57
|
+
sub_service_id?: number | null,
|
|
58
|
+
status?: 'draft' | 'published',
|
|
59
|
+
service_type?: 'internal' | 'external' | 'none'
|
|
60
|
+
) {
|
|
61
|
+
super();
|
|
62
|
+
this.name = name;
|
|
63
|
+
this.description = description || '';
|
|
64
|
+
this.version = version || 1;
|
|
65
|
+
this.is_active = is_active !== undefined ? is_active : true;
|
|
66
|
+
this.service_id = service_id || null;
|
|
67
|
+
this.sub_service_id = sub_service_id || null;
|
|
68
|
+
this.status = status || 'draft';
|
|
69
|
+
this.service_type = service_type || 'none';
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Column, Entity, ManyToOne, JoinColumn, Unique } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
import { WorkflowDefinitions } from './WorkflowDefinitions';
|
|
4
|
+
|
|
5
|
+
@Entity({ name: 'workflow_hierarchy' })
|
|
6
|
+
@Unique(['workflow_definition_id', 'step_order'])
|
|
7
|
+
export class WorkflowHierarchy extends BaseModel {
|
|
8
|
+
|
|
9
|
+
@Column({ type: 'integer', nullable: false })
|
|
10
|
+
workflow_definition_id: number;
|
|
11
|
+
|
|
12
|
+
@Column({ type: 'integer', nullable: true })
|
|
13
|
+
department_id: number;
|
|
14
|
+
|
|
15
|
+
@Column({ type: 'integer', nullable: true })
|
|
16
|
+
section_id: number;
|
|
17
|
+
|
|
18
|
+
@Column({ type: 'integer', nullable: true })
|
|
19
|
+
approval_role_id: number;
|
|
20
|
+
|
|
21
|
+
@Column({ type: 'integer', nullable: true })
|
|
22
|
+
approval_user_id: number;
|
|
23
|
+
|
|
24
|
+
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
25
|
+
taskname: string | null;
|
|
26
|
+
|
|
27
|
+
@Column({ type: 'varchar', length: 50, nullable: true })
|
|
28
|
+
status: string | null;
|
|
29
|
+
|
|
30
|
+
@Column({ type: 'jsonb', nullable: true })
|
|
31
|
+
task: any | null;
|
|
32
|
+
|
|
33
|
+
@Column({ type: 'integer', nullable: false })
|
|
34
|
+
step_order: number;
|
|
35
|
+
|
|
36
|
+
@Column({ type: 'boolean', default: true })
|
|
37
|
+
is_required: boolean;
|
|
38
|
+
|
|
39
|
+
@ManyToOne(() => WorkflowDefinitions, { onDelete: 'CASCADE' })
|
|
40
|
+
@JoinColumn({ name: 'workflow_definition_id' })
|
|
41
|
+
workflow_definition: WorkflowDefinitions;
|
|
42
|
+
|
|
43
|
+
constructor(
|
|
44
|
+
workflow_definition_id: number,
|
|
45
|
+
department_id: number,
|
|
46
|
+
section_id: number,
|
|
47
|
+
approval_role_id: number,
|
|
48
|
+
approval_user_id: number,
|
|
49
|
+
step_order: number,
|
|
50
|
+
is_required?: boolean,
|
|
51
|
+
taskname?: string,
|
|
52
|
+
status?: string,
|
|
53
|
+
task?: any
|
|
54
|
+
) {
|
|
55
|
+
super();
|
|
56
|
+
this.workflow_definition_id = workflow_definition_id;
|
|
57
|
+
this.department_id = department_id;
|
|
58
|
+
this.section_id = section_id;
|
|
59
|
+
this.approval_role_id = approval_role_id;
|
|
60
|
+
this.approval_user_id = approval_user_id;
|
|
61
|
+
this.step_order = step_order;
|
|
62
|
+
this.is_required = is_required !== undefined ? is_required : true;
|
|
63
|
+
this.taskname = taskname || null;
|
|
64
|
+
this.status = status || null;
|
|
65
|
+
this.task = task || null;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
@Entity({ name: 'workflow_tasks' })
|
|
5
|
+
export class WorkflowTask extends BaseModel {
|
|
6
|
+
|
|
7
|
+
@PrimaryGeneratedColumn()
|
|
8
|
+
task_id: number;
|
|
9
|
+
|
|
10
|
+
@Column({ type: 'varchar', length: 100, nullable: false })
|
|
11
|
+
name: string;
|
|
12
|
+
|
|
13
|
+
@Column({ type: 'varchar', length: 200, nullable: true })
|
|
14
|
+
task_type: string;
|
|
15
|
+
|
|
16
|
+
constructor(
|
|
17
|
+
name: string,
|
|
18
|
+
task_id?: number,
|
|
19
|
+
task_type?: string
|
|
20
|
+
) {
|
|
21
|
+
super();
|
|
22
|
+
this.name = name;
|
|
23
|
+
this.task_id = task_id || 0;
|
|
24
|
+
this.task_type = task_type || '';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
@Entity({ name: 'workflow_task_names' })
|
|
5
|
+
export class WorkflowTaskNames extends BaseModel {
|
|
6
|
+
|
|
7
|
+
@Column({ type: 'varchar', length: 100, nullable: false })
|
|
8
|
+
name: string;
|
|
9
|
+
|
|
10
|
+
@Column({ type: 'integer', nullable: false })
|
|
11
|
+
task_id: number;
|
|
12
|
+
|
|
13
|
+
@Column({ type: 'varchar', length: 200, nullable: true })
|
|
14
|
+
description: string;
|
|
15
|
+
|
|
16
|
+
@Column({ type: 'varchar', length: 200, nullable: true })
|
|
17
|
+
task_type: string;
|
|
18
|
+
|
|
19
|
+
constructor(
|
|
20
|
+
name: string,
|
|
21
|
+
task_id: number,
|
|
22
|
+
description: string,
|
|
23
|
+
task_type: string
|
|
24
|
+
) {
|
|
25
|
+
super();
|
|
26
|
+
this.name = name;
|
|
27
|
+
this.task_id = task_id;
|
|
28
|
+
this.description = description;
|
|
29
|
+
this.task_type = task_type;
|
|
30
|
+
}
|
|
31
|
+
}
|