@platform-modules/foreign-ministry 1.0.14 → 1.0.16
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 +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/models/LeaveApprovalDetailsModel.d.ts +7 -2
- package/dist/models/LeaveApprovalDetailsModel.js +10 -4
- package/dist/models/LeaveApprovalsModel.d.ts +15 -0
- package/dist/models/LeaveApprovalsModel.js +61 -0
- package/dist/models/LeaveAttachmentsModel.d.ts +7 -0
- package/dist/models/LeaveAttachmentsModel.js +40 -0
- package/dist/models/LeaveChatModel.d.ts +7 -0
- package/dist/models/LeaveChatModel.js +40 -0
- package/dist/models/LeaveSettingsModel.d.ts +7 -0
- package/dist/models/LeaveSettingsModel.js +40 -0
- package/dist/models/LeaveWorkFlowModel.d.ts +12 -0
- package/dist/models/LeaveWorkFlowModel.js +46 -0
- package/package.json +1 -1
- package/src/data-source.ts +3 -3
- package/src/index.ts +2 -2
- package/src/models/LeaveApprovalsModel.ts +41 -0
- package/src/models/LeaveAttachmentsModel.ts +21 -0
- package/src/models/LeaveChatModel.ts +21 -0
- package/src/models/{LeaveApprovalMatrixModel.ts → LeaveSettingsModel.ts} +5 -5
- package/src/models/LeaveWorkFlowModel.ts +28 -0
- package/src/models/LeaveApprovalDetailsModel.ts +0 -25
package/dist/data-source.js
CHANGED
|
@@ -15,8 +15,8 @@ const HajjLeaveDatesModel_1 = require("./models/HajjLeaveDatesModel");
|
|
|
15
15
|
const StudyLeaveDegreesModel_1 = require("./models/StudyLeaveDegreesModel");
|
|
16
16
|
const UnpaidLeaveCatgoriesModel_1 = require("./models/UnpaidLeaveCatgoriesModel");
|
|
17
17
|
const MounringLeaveRelationModel_1 = require("./models/MounringLeaveRelationModel");
|
|
18
|
-
const
|
|
19
|
-
const
|
|
18
|
+
const LeaveSettingsModel_1 = require("./models/LeaveSettingsModel");
|
|
19
|
+
const LeaveApprovalsModel_1 = require("./models/LeaveApprovalsModel");
|
|
20
20
|
exports.AppDataSource = new typeorm_1.DataSource({
|
|
21
21
|
type: 'postgres',
|
|
22
22
|
host: process.env.DB_HOST || 'localhost',
|
|
@@ -26,5 +26,5 @@ exports.AppDataSource = new typeorm_1.DataSource({
|
|
|
26
26
|
database: process.env.DB_NAME || 'common_models',
|
|
27
27
|
synchronize: true, // auto-create tables (disable in prod)
|
|
28
28
|
logging: false,
|
|
29
|
-
entities: [user_1.User, user_sessions_1.userSessions, role_1.Role, LeaveRequestModel_1.LeaveRequests, LeaveTypesModel_1.LeaveTypes, FinancialGradeModel_1.FinancialGrade, HajjLeaveDatesModel_1.HajjLeaveDates, StudyLeaveDegreesModel_1.StudyLeaveDegrees, UnpaidLeaveCatgoriesModel_1.UnpaidLeaveCategories, MounringLeaveRelationModel_1.MounringLeaveRelations,
|
|
29
|
+
entities: [user_1.User, user_sessions_1.userSessions, role_1.Role, LeaveRequestModel_1.LeaveRequests, LeaveTypesModel_1.LeaveTypes, FinancialGradeModel_1.FinancialGrade, HajjLeaveDatesModel_1.HajjLeaveDates, StudyLeaveDegreesModel_1.StudyLeaveDegrees, UnpaidLeaveCatgoriesModel_1.UnpaidLeaveCategories, MounringLeaveRelationModel_1.MounringLeaveRelations, LeaveSettingsModel_1.LeaveSettings, LeaveApprovalsModel_1.LeaveApprovalDetails],
|
|
30
30
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -8,5 +8,5 @@ export * from './models/HajjLeaveDatesModel';
|
|
|
8
8
|
export * from './models/StudyLeaveDegreesModel';
|
|
9
9
|
export * from './models/UnpaidLeaveCatgoriesModel';
|
|
10
10
|
export * from './models/MounringLeaveRelationModel';
|
|
11
|
-
export * from './models/
|
|
12
|
-
export * from './models/
|
|
11
|
+
export * from './models/LeaveSettingsModel';
|
|
12
|
+
export * from './models/LeaveApprovalsModel';
|
package/dist/index.js
CHANGED
|
@@ -24,5 +24,5 @@ __exportStar(require("./models/HajjLeaveDatesModel"), exports);
|
|
|
24
24
|
__exportStar(require("./models/StudyLeaveDegreesModel"), exports);
|
|
25
25
|
__exportStar(require("./models/UnpaidLeaveCatgoriesModel"), exports);
|
|
26
26
|
__exportStar(require("./models/MounringLeaveRelationModel"), exports);
|
|
27
|
-
__exportStar(require("./models/
|
|
28
|
-
__exportStar(require("./models/
|
|
27
|
+
__exportStar(require("./models/LeaveSettingsModel"), exports);
|
|
28
|
+
__exportStar(require("./models/LeaveApprovalsModel"), exports);
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { BaseModel } from './BaseModel';
|
|
2
|
+
export declare enum ApprovalStatus {
|
|
3
|
+
PENDING = "Pending",
|
|
4
|
+
APPROVED = "Approved",
|
|
5
|
+
REJECTED = "Rejected"
|
|
6
|
+
}
|
|
2
7
|
export declare class LeaveApprovalDetails extends BaseModel {
|
|
3
8
|
leave_request_id: number;
|
|
4
9
|
level: number;
|
|
5
10
|
approver_id: number;
|
|
6
|
-
approval_status:
|
|
7
|
-
constructor(leave_request_id: number, approver_id: number, approval_status:
|
|
11
|
+
approval_status: ApprovalStatus;
|
|
12
|
+
constructor(leave_request_id: number, approver_id: number, approval_status: ApprovalStatus, level: number);
|
|
8
13
|
}
|
|
@@ -9,9 +9,15 @@ 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.LeaveApprovalDetails = void 0;
|
|
12
|
+
exports.LeaveApprovalDetails = exports.ApprovalStatus = void 0;
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
14
|
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
var ApprovalStatus;
|
|
16
|
+
(function (ApprovalStatus) {
|
|
17
|
+
ApprovalStatus["PENDING"] = "Pending";
|
|
18
|
+
ApprovalStatus["APPROVED"] = "Approved";
|
|
19
|
+
ApprovalStatus["REJECTED"] = "Rejected";
|
|
20
|
+
})(ApprovalStatus || (exports.ApprovalStatus = ApprovalStatus = {}));
|
|
15
21
|
//This model is used to store the store the leave apporval details of the user for the leave request
|
|
16
22
|
let LeaveApprovalDetails = class LeaveApprovalDetails extends BaseModel_1.BaseModel {
|
|
17
23
|
constructor(leave_request_id, approver_id, approval_status, level) {
|
|
@@ -36,10 +42,10 @@ __decorate([
|
|
|
36
42
|
__metadata("design:type", Number)
|
|
37
43
|
], LeaveApprovalDetails.prototype, "approver_id", void 0);
|
|
38
44
|
__decorate([
|
|
39
|
-
(0, typeorm_1.Column)({ type: '
|
|
40
|
-
__metadata("design:type",
|
|
45
|
+
(0, typeorm_1.Column)({ type: 'enum', enum: ApprovalStatus, default: ApprovalStatus.PENDING, nullable: false }),
|
|
46
|
+
__metadata("design:type", String)
|
|
41
47
|
], LeaveApprovalDetails.prototype, "approval_status", void 0);
|
|
42
48
|
exports.LeaveApprovalDetails = LeaveApprovalDetails = __decorate([
|
|
43
49
|
(0, typeorm_1.Entity)({ name: 'leave_approval_details' }),
|
|
44
|
-
__metadata("design:paramtypes", [Number, Number,
|
|
50
|
+
__metadata("design:paramtypes", [Number, Number, String, Number])
|
|
45
51
|
], LeaveApprovalDetails);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseModel } from './BaseModel';
|
|
2
|
+
export declare enum ApprovalStatus {
|
|
3
|
+
PENDING = "Pending",
|
|
4
|
+
APPROVED = "Approved",
|
|
5
|
+
REJECTED = "Rejected"
|
|
6
|
+
}
|
|
7
|
+
export declare class LeaveApprovalDetails extends BaseModel {
|
|
8
|
+
leave_request_id: number;
|
|
9
|
+
level: number;
|
|
10
|
+
approver_user_id: number;
|
|
11
|
+
approver_role_id: number;
|
|
12
|
+
comment: string;
|
|
13
|
+
approval_status: ApprovalStatus;
|
|
14
|
+
constructor(leave_request_id: number, approver_user_id: number, approver_role_id: number, comment: string, approval_status: ApprovalStatus, level: number);
|
|
15
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
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.LeaveApprovalDetails = exports.ApprovalStatus = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
var ApprovalStatus;
|
|
16
|
+
(function (ApprovalStatus) {
|
|
17
|
+
ApprovalStatus["PENDING"] = "Pending";
|
|
18
|
+
ApprovalStatus["APPROVED"] = "Approved";
|
|
19
|
+
ApprovalStatus["REJECTED"] = "Rejected";
|
|
20
|
+
})(ApprovalStatus || (exports.ApprovalStatus = ApprovalStatus = {}));
|
|
21
|
+
//This model is used to store the store the leave apporval details of the user for the leave request
|
|
22
|
+
let LeaveApprovalDetails = class LeaveApprovalDetails extends BaseModel_1.BaseModel {
|
|
23
|
+
constructor(leave_request_id, approver_user_id, approver_role_id, comment, approval_status, level) {
|
|
24
|
+
super();
|
|
25
|
+
this.leave_request_id = leave_request_id;
|
|
26
|
+
this.approver_user_id = approver_user_id;
|
|
27
|
+
this.approver_role_id = approver_role_id;
|
|
28
|
+
this.comment = comment;
|
|
29
|
+
this.approval_status = approval_status;
|
|
30
|
+
this.level = level;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
exports.LeaveApprovalDetails = LeaveApprovalDetails;
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
36
|
+
__metadata("design:type", Number)
|
|
37
|
+
], LeaveApprovalDetails.prototype, "leave_request_id", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
40
|
+
__metadata("design:type", Number)
|
|
41
|
+
], LeaveApprovalDetails.prototype, "level", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
44
|
+
__metadata("design:type", Number)
|
|
45
|
+
], LeaveApprovalDetails.prototype, "approver_user_id", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
48
|
+
__metadata("design:type", Number)
|
|
49
|
+
], LeaveApprovalDetails.prototype, "approver_role_id", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: false }),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], LeaveApprovalDetails.prototype, "comment", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.Column)({ type: 'enum', enum: ApprovalStatus, default: ApprovalStatus.PENDING, nullable: false }),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], LeaveApprovalDetails.prototype, "approval_status", void 0);
|
|
58
|
+
exports.LeaveApprovalDetails = LeaveApprovalDetails = __decorate([
|
|
59
|
+
(0, typeorm_1.Entity)({ name: 'leave_approvals' }),
|
|
60
|
+
__metadata("design:paramtypes", [Number, Number, Number, String, String, Number])
|
|
61
|
+
], LeaveApprovalDetails);
|
|
@@ -0,0 +1,40 @@
|
|
|
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.LeaveAttachments = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
//This model is used to store the store the leave apporval matrix(HOD, Manager, HR, Director) based on leave type along with the levels
|
|
16
|
+
let LeaveAttachments = class LeaveAttachments extends BaseModel_1.BaseModel {
|
|
17
|
+
constructor(leave_request_id, files, attached_by_user_id) {
|
|
18
|
+
super();
|
|
19
|
+
this.leave_request_id = leave_request_id;
|
|
20
|
+
this.files = files;
|
|
21
|
+
this.attached_by_user_id = attached_by_user_id;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.LeaveAttachments = LeaveAttachments;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
27
|
+
__metadata("design:type", Number)
|
|
28
|
+
], LeaveAttachments.prototype, "leave_request_id", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: false }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], LeaveAttachments.prototype, "files", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
35
|
+
__metadata("design:type", Number)
|
|
36
|
+
], LeaveAttachments.prototype, "attached_by_user_id", void 0);
|
|
37
|
+
exports.LeaveAttachments = LeaveAttachments = __decorate([
|
|
38
|
+
(0, typeorm_1.Entity)({ name: 'leave_attachments' }),
|
|
39
|
+
__metadata("design:paramtypes", [Number, String, Number])
|
|
40
|
+
], LeaveAttachments);
|
|
@@ -0,0 +1,40 @@
|
|
|
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.LeaveChat = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
//This model is used to store the store the leave apporval matrix(HOD, Manager, HR, Director) based on leave type along with the levels
|
|
16
|
+
let LeaveChat = class LeaveChat extends BaseModel_1.BaseModel {
|
|
17
|
+
constructor(leave_request_id, content, sender_user_id) {
|
|
18
|
+
super();
|
|
19
|
+
this.leave_request_id = leave_request_id;
|
|
20
|
+
this.content = content;
|
|
21
|
+
this.sender_user_id = sender_user_id;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.LeaveChat = LeaveChat;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
27
|
+
__metadata("design:type", Number)
|
|
28
|
+
], LeaveChat.prototype, "leave_request_id", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: false }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], LeaveChat.prototype, "content", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
35
|
+
__metadata("design:type", Number)
|
|
36
|
+
], LeaveChat.prototype, "sender_user_id", void 0);
|
|
37
|
+
exports.LeaveChat = LeaveChat = __decorate([
|
|
38
|
+
(0, typeorm_1.Entity)({ name: 'leave_chats' }),
|
|
39
|
+
__metadata("design:paramtypes", [Number, String, Number])
|
|
40
|
+
], LeaveChat);
|
|
@@ -0,0 +1,40 @@
|
|
|
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.LeaveSettings = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
//This model is used to store the store the leave apporval matrix(HOD, Manager, HR, Director) based on leave type along with the levels
|
|
16
|
+
let LeaveSettings = class LeaveSettings extends BaseModel_1.BaseModel {
|
|
17
|
+
constructor(leave_type, level, leave_approval_authority) {
|
|
18
|
+
super();
|
|
19
|
+
this.leave_type = leave_type;
|
|
20
|
+
this.level = level;
|
|
21
|
+
this.leave_approval_authority = leave_approval_authority;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.LeaveSettings = LeaveSettings;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
27
|
+
__metadata("design:type", Number)
|
|
28
|
+
], LeaveSettings.prototype, "leave_type", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
31
|
+
__metadata("design:type", Number)
|
|
32
|
+
], LeaveSettings.prototype, "level", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: false }),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], LeaveSettings.prototype, "leave_approval_authority", void 0);
|
|
37
|
+
exports.LeaveSettings = LeaveSettings = __decorate([
|
|
38
|
+
(0, typeorm_1.Entity)({ name: 'leave_settings' }),
|
|
39
|
+
__metadata("design:paramtypes", [Number, Number, String])
|
|
40
|
+
], LeaveSettings);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseModel } from './BaseModel';
|
|
2
|
+
export declare enum status {
|
|
3
|
+
COMPLETED = "Completed",
|
|
4
|
+
NOT_YET_STARTED = "Not Yet Started",
|
|
5
|
+
PENDING = "Pending"
|
|
6
|
+
}
|
|
7
|
+
export declare class LeaveWorkFlow extends BaseModel {
|
|
8
|
+
leave_request_id: number;
|
|
9
|
+
content: string;
|
|
10
|
+
status: status;
|
|
11
|
+
constructor(leave_request_id: number, content: string, status: status);
|
|
12
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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.LeaveWorkFlow = exports.status = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
var status;
|
|
16
|
+
(function (status) {
|
|
17
|
+
status["COMPLETED"] = "Completed";
|
|
18
|
+
status["NOT_YET_STARTED"] = "Not Yet Started";
|
|
19
|
+
status["PENDING"] = "Pending";
|
|
20
|
+
})(status || (exports.status = status = {}));
|
|
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
|
|
22
|
+
let LeaveWorkFlow = class LeaveWorkFlow extends BaseModel_1.BaseModel {
|
|
23
|
+
constructor(leave_request_id, content, status) {
|
|
24
|
+
super();
|
|
25
|
+
this.leave_request_id = leave_request_id;
|
|
26
|
+
this.content = content;
|
|
27
|
+
this.status = status;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
exports.LeaveWorkFlow = LeaveWorkFlow;
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
33
|
+
__metadata("design:type", Number)
|
|
34
|
+
], LeaveWorkFlow.prototype, "leave_request_id", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: false }),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], LeaveWorkFlow.prototype, "content", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.Column)({ type: 'enum', enum: status, default: status.NOT_YET_STARTED, nullable: false }),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], LeaveWorkFlow.prototype, "status", void 0);
|
|
43
|
+
exports.LeaveWorkFlow = LeaveWorkFlow = __decorate([
|
|
44
|
+
(0, typeorm_1.Entity)({ name: 'leave_work_flows' }),
|
|
45
|
+
__metadata("design:paramtypes", [Number, String, String])
|
|
46
|
+
], LeaveWorkFlow);
|
package/package.json
CHANGED
package/src/data-source.ts
CHANGED
|
@@ -12,8 +12,8 @@ import { HajjLeaveDates } from './models/HajjLeaveDatesModel';
|
|
|
12
12
|
import { StudyLeaveDegrees } from './models/StudyLeaveDegreesModel';
|
|
13
13
|
import { UnpaidLeaveCategories } from './models/UnpaidLeaveCatgoriesModel';
|
|
14
14
|
import { MounringLeaveRelations } from './models/MounringLeaveRelationModel';
|
|
15
|
-
import {
|
|
16
|
-
import { LeaveApprovalDetails } from './models/
|
|
15
|
+
import { LeaveSettings } from './models/LeaveSettingsModel';
|
|
16
|
+
import { LeaveApprovalDetails } from './models/LeaveApprovalsModel';
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
export const AppDataSource = new DataSource({
|
|
@@ -25,5 +25,5 @@ export const AppDataSource = new DataSource({
|
|
|
25
25
|
database: process.env.DB_NAME || 'common_models',
|
|
26
26
|
synchronize: true, // auto-create tables (disable in prod)
|
|
27
27
|
logging: false,
|
|
28
|
-
entities: [User,userSessions,Role,LeaveRequests,LeaveTypes,FinancialGrade,HajjLeaveDates,StudyLeaveDegrees,UnpaidLeaveCategories,MounringLeaveRelations,
|
|
28
|
+
entities: [User,userSessions,Role,LeaveRequests,LeaveTypes,FinancialGrade,HajjLeaveDates,StudyLeaveDegrees,UnpaidLeaveCategories,MounringLeaveRelations,LeaveSettings,LeaveApprovalDetails],
|
|
29
29
|
});
|
package/src/index.ts
CHANGED
|
@@ -8,5 +8,5 @@ export * from './models/HajjLeaveDatesModel';
|
|
|
8
8
|
export * from './models/StudyLeaveDegreesModel';
|
|
9
9
|
export * from './models/UnpaidLeaveCatgoriesModel';
|
|
10
10
|
export * from './models/MounringLeaveRelationModel';
|
|
11
|
-
export * from './models/
|
|
12
|
-
export * from './models/
|
|
11
|
+
export * from './models/LeaveSettingsModel';
|
|
12
|
+
export * from './models/LeaveApprovalsModel';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export enum ApprovalStatus {
|
|
6
|
+
PENDING = "Pending",
|
|
7
|
+
APPROVED = "Approved",
|
|
8
|
+
REJECTED = "Rejected"
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
//This model is used to store the store the leave apporval details of the user for the leave request
|
|
12
|
+
@Entity({ name: 'leave_approvals' })
|
|
13
|
+
export class LeaveApprovalDetails extends BaseModel {
|
|
14
|
+
@Column({ type: 'int', nullable: false })
|
|
15
|
+
leave_request_id: number;
|
|
16
|
+
|
|
17
|
+
@Column({ type: 'int', nullable: false })
|
|
18
|
+
level: number;
|
|
19
|
+
|
|
20
|
+
@Column({ type: 'int', nullable: true })
|
|
21
|
+
approver_user_id: number;
|
|
22
|
+
|
|
23
|
+
@Column({ type: 'int', nullable: false })
|
|
24
|
+
approver_role_id: number;
|
|
25
|
+
|
|
26
|
+
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
27
|
+
comment: string;
|
|
28
|
+
|
|
29
|
+
@Column({ type: 'enum', enum: ApprovalStatus,default: ApprovalStatus.PENDING, nullable: false })
|
|
30
|
+
approval_status: ApprovalStatus;
|
|
31
|
+
|
|
32
|
+
constructor(leave_request_id: number, approver_user_id: number, approver_role_id: number, comment: string, approval_status: ApprovalStatus, level: number) {
|
|
33
|
+
super();
|
|
34
|
+
this.leave_request_id = leave_request_id;
|
|
35
|
+
this.approver_user_id = approver_user_id;
|
|
36
|
+
this.approver_role_id = approver_role_id;
|
|
37
|
+
this.comment = comment;
|
|
38
|
+
this.approval_status = approval_status;
|
|
39
|
+
this.level = level;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
//This model is used to store the store the leave apporval matrix(HOD, Manager, HR, Director) based on leave type along with the levels
|
|
4
|
+
@Entity({ name: 'leave_attachments' })
|
|
5
|
+
export class LeaveAttachments extends BaseModel {
|
|
6
|
+
@Column({ type: 'int', nullable: false })
|
|
7
|
+
leave_request_id: number;
|
|
8
|
+
|
|
9
|
+
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
10
|
+
files: string;
|
|
11
|
+
|
|
12
|
+
@Column({ type: 'int', nullable: false })
|
|
13
|
+
attached_by_user_id: number;
|
|
14
|
+
|
|
15
|
+
constructor(leave_request_id: number, files: string, attached_by_user_id: number) {
|
|
16
|
+
super();
|
|
17
|
+
this.leave_request_id = leave_request_id;
|
|
18
|
+
this.files = files;
|
|
19
|
+
this.attached_by_user_id = attached_by_user_id;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
//This model is used to store the store the leave apporval matrix(HOD, Manager, HR, Director) based on leave type along with the levels
|
|
4
|
+
@Entity({ name: 'leave_chats' })
|
|
5
|
+
export class LeaveChat extends BaseModel {
|
|
6
|
+
@Column({ type: 'int', nullable: false })
|
|
7
|
+
leave_request_id: number;
|
|
8
|
+
|
|
9
|
+
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
10
|
+
content: string;
|
|
11
|
+
|
|
12
|
+
@Column({ type: 'int', nullable: false })
|
|
13
|
+
sender_user_id: number;
|
|
14
|
+
|
|
15
|
+
constructor(leave_request_id: number, content: string, sender_user_id: number) {
|
|
16
|
+
super();
|
|
17
|
+
this.leave_request_id = leave_request_id;
|
|
18
|
+
this.content = content;
|
|
19
|
+
this.sender_user_id = sender_user_id;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Column, Entity } from "typeorm";
|
|
2
2
|
import { BaseModel } from './BaseModel';
|
|
3
3
|
//This model is used to store the store the leave apporval matrix(HOD, Manager, HR, Director) based on leave type along with the levels
|
|
4
|
-
@Entity({ name: '
|
|
5
|
-
export class
|
|
4
|
+
@Entity({ name: 'leave_settings' })
|
|
5
|
+
export class LeaveSettings extends BaseModel {
|
|
6
6
|
@Column({ type: 'int', nullable: false })
|
|
7
7
|
leave_type: number;
|
|
8
8
|
|
|
@@ -10,12 +10,12 @@ export class LeaveApprovalMatrix extends BaseModel {
|
|
|
10
10
|
level: number;
|
|
11
11
|
|
|
12
12
|
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
13
|
-
|
|
13
|
+
leave_approval_authority: string;
|
|
14
14
|
|
|
15
|
-
constructor(leave_type: number, level: number,
|
|
15
|
+
constructor(leave_type: number, level: number, leave_approval_authority: string) {
|
|
16
16
|
super();
|
|
17
17
|
this.leave_type = leave_type;
|
|
18
18
|
this.level = level;
|
|
19
|
-
this.
|
|
19
|
+
this.leave_approval_authority = leave_approval_authority;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
export enum status {
|
|
5
|
+
COMPLETED = "Completed",
|
|
6
|
+
NOT_YET_STARTED = "Not Yet Started",
|
|
7
|
+
PENDING = "Pending"
|
|
8
|
+
}
|
|
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
|
|
11
|
+
@Entity({ name: 'leave_work_flows' })
|
|
12
|
+
export class LeaveWorkFlow extends BaseModel {
|
|
13
|
+
@Column({ type: 'int', nullable: false })
|
|
14
|
+
leave_request_id: number;
|
|
15
|
+
|
|
16
|
+
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
17
|
+
content: string;
|
|
18
|
+
|
|
19
|
+
@Column({ type: 'enum', enum: status, default: status.NOT_YET_STARTED, nullable: false })
|
|
20
|
+
status: status;
|
|
21
|
+
|
|
22
|
+
constructor(leave_request_id: number, content: string, status: status) {
|
|
23
|
+
super();
|
|
24
|
+
this.leave_request_id = leave_request_id;
|
|
25
|
+
this.content = content;
|
|
26
|
+
this.status = status;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Column, Entity } from "typeorm";
|
|
2
|
-
import { BaseModel } from './BaseModel';
|
|
3
|
-
//This model is used to store the store the leave apporval details of the user for the leave request
|
|
4
|
-
@Entity({ name: 'leave_approval_details' })
|
|
5
|
-
export class LeaveApprovalDetails extends BaseModel {
|
|
6
|
-
@Column({ type: 'int', nullable: false })
|
|
7
|
-
leave_request_id: number;
|
|
8
|
-
|
|
9
|
-
@Column({ type: 'int', nullable: false })
|
|
10
|
-
level: number;
|
|
11
|
-
|
|
12
|
-
@Column({ type: 'int', nullable: false })
|
|
13
|
-
approver_id: number;
|
|
14
|
-
|
|
15
|
-
@Column({ type: 'int', nullable: false })
|
|
16
|
-
approval_status: number;
|
|
17
|
-
|
|
18
|
-
constructor(leave_request_id: number, approver_id: number, approval_status: number, level: number) {
|
|
19
|
-
super();
|
|
20
|
-
this.leave_request_id = leave_request_id;
|
|
21
|
-
this.approver_id = approver_id;
|
|
22
|
-
this.approval_status = approval_status;
|
|
23
|
-
this.level = level;
|
|
24
|
-
}
|
|
25
|
-
}
|