@platform-modules/foreign-ministry 1.0.86 → 1.0.88
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 +12 -2
- package/dist/index.d.ts +5 -13
- package/dist/index.js +5 -13
- package/dist/models/FMServices.js +1 -1
- package/dist/models/FinancialApprovalsModel.d.ts +4 -1
- package/dist/models/FinancialApprovalsModel.js +17 -2
- package/dist/models/FinancialRequestsModel.d.ts +5 -1
- package/dist/models/FinancialRequestsModel.js +22 -2
- package/dist/models/HolidaysModel.d.ts +11 -0
- package/dist/models/HolidaysModel.js +59 -0
- package/dist/models/NotificationModel.d.ts +18 -0
- package/dist/models/NotificationModel.js +79 -0
- package/dist/models/PortalFeedbackModel.d.ts +8 -0
- package/dist/models/PortalFeedbackModel.js +44 -0
- package/dist/models/role.d.ts +1 -7
- package/dist/models/role.js +2 -2
- package/dist/models/roleRightsModel.d.ts +16 -0
- package/dist/models/roleRightsModel.js +44 -0
- package/dist/models/user.d.ts +5 -1
- package/dist/models/user.js +22 -2
- package/dist/models/userRolesModel.d.ts +19 -0
- package/dist/models/userRolesModel.js +59 -0
- package/package.json +1 -1
- package/src/data-source.ts +12 -2
- package/src/index.ts +5 -13
- package/src/models/FMServices.ts +1 -1
- package/src/models/FinancialApprovalsModel.ts +16 -1
- package/src/models/FinancialRequestsModel.ts +21 -1
- package/src/models/HolidaysModel.ts +46 -0
- package/src/models/NotificationModel.ts +68 -0
- package/src/models/PortalFeedbackModel.ts +33 -0
- package/src/models/role.ts +1 -7
- package/src/models/roleRightsModel.ts +31 -0
- package/src/models/user.ts +21 -0
- package/src/models/userRolesModel.ts +42 -0
package/dist/data-source.js
CHANGED
|
@@ -49,6 +49,11 @@ const MessageReadStatusModel_1 = require("./models/MessageReadStatusModel");
|
|
|
49
49
|
const ShifttimesModel_1 = require("./models/ShifttimesModel");
|
|
50
50
|
const AttendanceModel_1 = require("./models/AttendanceModel");
|
|
51
51
|
const UserShiftModel_1 = require("./models/UserShiftModel");
|
|
52
|
+
const HolidaysModel_1 = require("./models/HolidaysModel");
|
|
53
|
+
const userRolesModel_1 = require("./models/userRolesModel");
|
|
54
|
+
const roleRightsModel_1 = require("./models/roleRightsModel");
|
|
55
|
+
const PortalFeedbackModel_1 = require("./models/PortalFeedbackModel");
|
|
56
|
+
const NotificationModel_1 = require("./models/NotificationModel");
|
|
52
57
|
exports.AppDataSource = new typeorm_1.DataSource({
|
|
53
58
|
type: 'postgres',
|
|
54
59
|
host: process.env.DB_HOST || 'localhost',
|
|
@@ -56,7 +61,7 @@ exports.AppDataSource = new typeorm_1.DataSource({
|
|
|
56
61
|
username: process.env.DB_USER || 'postgres',
|
|
57
62
|
password: process.env.DB_PASS || 'postgres',
|
|
58
63
|
database: process.env.DB_NAME || 'common_models',
|
|
59
|
-
synchronize:
|
|
64
|
+
synchronize: true, // auto-create tables (disable in prod)
|
|
60
65
|
logging: false,
|
|
61
66
|
entities: [
|
|
62
67
|
user_1.User,
|
|
@@ -102,6 +107,11 @@ exports.AppDataSource = new typeorm_1.DataSource({
|
|
|
102
107
|
MessageReadStatusModel_1.MessageReadStatus,
|
|
103
108
|
ShifttimesModel_1.ShiftDetails,
|
|
104
109
|
AttendanceModel_1.AttendanceDetails,
|
|
105
|
-
UserShiftModel_1.UserShift
|
|
110
|
+
UserShiftModel_1.UserShift,
|
|
111
|
+
HolidaysModel_1.Holidays,
|
|
112
|
+
userRolesModel_1.UserRole,
|
|
113
|
+
roleRightsModel_1.RoleRights,
|
|
114
|
+
PortalFeedbackModel_1.PortalFeedback,
|
|
115
|
+
NotificationModel_1.Notification
|
|
106
116
|
],
|
|
107
117
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -42,16 +42,8 @@ export * from './models/ShifttimesModel';
|
|
|
42
42
|
export * from './models/AttendanceModel';
|
|
43
43
|
export * from './models/contactInfoModel';
|
|
44
44
|
export * from './models/UserShiftModel';
|
|
45
|
-
export * from './models/
|
|
46
|
-
export * from './models/
|
|
47
|
-
export * from './models/
|
|
48
|
-
export * from './models/
|
|
49
|
-
export * from './models/
|
|
50
|
-
export * from './models/BankAccountChangeRequestsModel';
|
|
51
|
-
export * from './models/FinancialChatsModel';
|
|
52
|
-
export * from './models/FinancialApprovalsModel';
|
|
53
|
-
export * from './models/FinancialWorkFlowModel';
|
|
54
|
-
export * from './models/FinancialAttachmentsModel';
|
|
55
|
-
export * from './models/RequestTypeMasterModel';
|
|
56
|
-
export * from './models/FinancialSettingsModel';
|
|
57
|
-
export * from './models/AllowanceTypesModel';
|
|
45
|
+
export * from './models/HolidaysModel';
|
|
46
|
+
export * from './models/userRolesModel';
|
|
47
|
+
export * from './models/roleRightsModel';
|
|
48
|
+
export * from './models/PortalFeedbackModel';
|
|
49
|
+
export * from './models/NotificationModel';
|
package/dist/index.js
CHANGED
|
@@ -58,16 +58,8 @@ __exportStar(require("./models/ShifttimesModel"), exports);
|
|
|
58
58
|
__exportStar(require("./models/AttendanceModel"), exports);
|
|
59
59
|
__exportStar(require("./models/contactInfoModel"), exports);
|
|
60
60
|
__exportStar(require("./models/UserShiftModel"), exports);
|
|
61
|
-
__exportStar(require("./models/
|
|
62
|
-
__exportStar(require("./models/
|
|
63
|
-
__exportStar(require("./models/
|
|
64
|
-
__exportStar(require("./models/
|
|
65
|
-
__exportStar(require("./models/
|
|
66
|
-
__exportStar(require("./models/BankAccountChangeRequestsModel"), exports);
|
|
67
|
-
__exportStar(require("./models/FinancialChatsModel"), exports);
|
|
68
|
-
__exportStar(require("./models/FinancialApprovalsModel"), exports);
|
|
69
|
-
__exportStar(require("./models/FinancialWorkFlowModel"), exports);
|
|
70
|
-
__exportStar(require("./models/FinancialAttachmentsModel"), exports);
|
|
71
|
-
__exportStar(require("./models/RequestTypeMasterModel"), exports);
|
|
72
|
-
__exportStar(require("./models/FinancialSettingsModel"), exports);
|
|
73
|
-
__exportStar(require("./models/AllowanceTypesModel"), exports);
|
|
61
|
+
__exportStar(require("./models/HolidaysModel"), exports);
|
|
62
|
+
__exportStar(require("./models/userRolesModel"), exports);
|
|
63
|
+
__exportStar(require("./models/roleRightsModel"), exports);
|
|
64
|
+
__exportStar(require("./models/PortalFeedbackModel"), exports);
|
|
65
|
+
__exportStar(require("./models/NotificationModel"), exports);
|
|
@@ -35,7 +35,7 @@ __decorate([
|
|
|
35
35
|
__metadata("design:type", String)
|
|
36
36
|
], FMServices.prototype, "description", void 0);
|
|
37
37
|
__decorate([
|
|
38
|
-
(0, typeorm_1.Column)({ nullable:
|
|
38
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
39
39
|
__metadata("design:type", String)
|
|
40
40
|
], FMServices.prototype, "logo_url", void 0);
|
|
41
41
|
exports.FMServices = FMServices = __decorate([
|
|
@@ -14,6 +14,9 @@ export declare class FinancialApprovals extends BaseModel {
|
|
|
14
14
|
comment: string;
|
|
15
15
|
approval_status: FinancialApprovalStatus;
|
|
16
16
|
action_date: Date;
|
|
17
|
+
department_id: number;
|
|
18
|
+
section_id: number;
|
|
19
|
+
approved_by: number;
|
|
17
20
|
financialRequest?: FinancialRequests;
|
|
18
|
-
constructor(financial_request_id: number, level: number, approver_role_id: number, approval_status: FinancialApprovalStatus);
|
|
21
|
+
constructor(financial_request_id: number, level: number, approver_role_id: number, approval_status: FinancialApprovalStatus, department_id: number, section_id: number, approved_by: number);
|
|
19
22
|
}
|
|
@@ -21,12 +21,15 @@ var FinancialApprovalStatus;
|
|
|
21
21
|
FinancialApprovalStatus["SKIPPED"] = "Skipped";
|
|
22
22
|
})(FinancialApprovalStatus || (exports.FinancialApprovalStatus = FinancialApprovalStatus = {}));
|
|
23
23
|
let FinancialApprovals = class FinancialApprovals extends BaseModel_1.BaseModel {
|
|
24
|
-
constructor(financial_request_id, level, approver_role_id, approval_status) {
|
|
24
|
+
constructor(financial_request_id, level, approver_role_id, approval_status, department_id, section_id, approved_by) {
|
|
25
25
|
super();
|
|
26
26
|
this.financial_request_id = financial_request_id;
|
|
27
27
|
this.level = level;
|
|
28
28
|
this.approver_role_id = approver_role_id;
|
|
29
29
|
this.approval_status = approval_status;
|
|
30
|
+
this.department_id = department_id;
|
|
31
|
+
this.section_id = section_id;
|
|
32
|
+
this.approved_by = approved_by;
|
|
30
33
|
}
|
|
31
34
|
};
|
|
32
35
|
exports.FinancialApprovals = FinancialApprovals;
|
|
@@ -58,6 +61,18 @@ __decorate([
|
|
|
58
61
|
(0, typeorm_1.Column)({ type: 'timestamp', nullable: true }),
|
|
59
62
|
__metadata("design:type", Date)
|
|
60
63
|
], FinancialApprovals.prototype, "action_date", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
66
|
+
__metadata("design:type", Number)
|
|
67
|
+
], FinancialApprovals.prototype, "department_id", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
70
|
+
__metadata("design:type", Number)
|
|
71
|
+
], FinancialApprovals.prototype, "section_id", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
74
|
+
__metadata("design:type", Number)
|
|
75
|
+
], FinancialApprovals.prototype, "approved_by", void 0);
|
|
61
76
|
__decorate([
|
|
62
77
|
(0, typeorm_1.ManyToOne)(() => FinancialRequestsModel_1.FinancialRequests, fr => fr.approvals),
|
|
63
78
|
(0, typeorm_1.JoinColumn)({ name: 'financial_request_id' }),
|
|
@@ -65,5 +80,5 @@ __decorate([
|
|
|
65
80
|
], FinancialApprovals.prototype, "financialRequest", void 0);
|
|
66
81
|
exports.FinancialApprovals = FinancialApprovals = __decorate([
|
|
67
82
|
(0, typeorm_1.Entity)({ name: 'financial_approvals' }),
|
|
68
|
-
__metadata("design:paramtypes", [Number, Number, Number, String])
|
|
83
|
+
__metadata("design:paramtypes", [Number, Number, Number, String, Number, Number, Number])
|
|
69
84
|
], FinancialApprovals);
|
|
@@ -35,6 +35,10 @@ export declare class FinancialRequests extends BaseModel {
|
|
|
35
35
|
remarks: string;
|
|
36
36
|
current_approval_level: number;
|
|
37
37
|
current_approver_id: number;
|
|
38
|
+
service_id: number;
|
|
39
|
+
sub_service_id: number;
|
|
40
|
+
section_id: number;
|
|
41
|
+
reporting_manager: number;
|
|
38
42
|
payslipRequest?: PayslipRequests;
|
|
39
43
|
salaryCertificateRequest?: SalaryCertificateRequests;
|
|
40
44
|
allowanceRequest?: AllowanceRequests;
|
|
@@ -45,5 +49,5 @@ export declare class FinancialRequests extends BaseModel {
|
|
|
45
49
|
workflows?: FinancialWorkFlow[];
|
|
46
50
|
attachments?: FinancialAttachments[];
|
|
47
51
|
requestType?: RequestTypeMaster;
|
|
48
|
-
constructor(user_id: number, employee_id: string, employee_name: string, email_address: string, contact_number: string, request_type_id: number);
|
|
52
|
+
constructor(user_id: number, employee_id: string, employee_name: string, email_address: string, contact_number: string, request_type_id: number, service_id: number, sub_service_id: number, section_id: number, reporting_manager: number);
|
|
49
53
|
}
|
|
@@ -24,7 +24,7 @@ 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, request_type_id) {
|
|
27
|
+
constructor(user_id, employee_id, employee_name, email_address, contact_number, request_type_id, 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;
|
|
@@ -34,6 +34,10 @@ let FinancialRequests = class FinancialRequests extends BaseModel_1.BaseModel {
|
|
|
34
34
|
this.request_type_id = request_type_id;
|
|
35
35
|
this.request_date = new Date();
|
|
36
36
|
this.request_status = FinancialRequestStatus.PENDING;
|
|
37
|
+
this.service_id = service_id;
|
|
38
|
+
this.sub_service_id = sub_service_id;
|
|
39
|
+
this.section_id = section_id;
|
|
40
|
+
this.reporting_manager = reporting_manager;
|
|
37
41
|
}
|
|
38
42
|
};
|
|
39
43
|
exports.FinancialRequests = FinancialRequests;
|
|
@@ -97,6 +101,22 @@ __decorate([
|
|
|
97
101
|
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
98
102
|
__metadata("design:type", Number)
|
|
99
103
|
], FinancialRequests.prototype, "current_approver_id", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
106
|
+
__metadata("design:type", Number)
|
|
107
|
+
], FinancialRequests.prototype, "service_id", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
110
|
+
__metadata("design:type", Number)
|
|
111
|
+
], FinancialRequests.prototype, "sub_service_id", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
114
|
+
__metadata("design:type", Number)
|
|
115
|
+
], FinancialRequests.prototype, "section_id", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
118
|
+
__metadata("design:type", Number)
|
|
119
|
+
], FinancialRequests.prototype, "reporting_manager", void 0);
|
|
100
120
|
__decorate([
|
|
101
121
|
(0, typeorm_1.OneToOne)('PayslipRequests', 'financialRequest', { nullable: true }),
|
|
102
122
|
__metadata("design:type", Function)
|
|
@@ -140,5 +160,5 @@ __decorate([
|
|
|
140
160
|
], FinancialRequests.prototype, "requestType", void 0);
|
|
141
161
|
exports.FinancialRequests = FinancialRequests = __decorate([
|
|
142
162
|
(0, typeorm_1.Entity)({ name: 'financial_requests' }),
|
|
143
|
-
__metadata("design:paramtypes", [Number, String, String, String, String, Number])
|
|
163
|
+
__metadata("design:paramtypes", [Number, String, String, String, String, Number, Number, Number, Number, Number])
|
|
144
164
|
], FinancialRequests);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseModel } from './BaseModel';
|
|
2
|
+
export declare class Holidays extends BaseModel {
|
|
3
|
+
title: string;
|
|
4
|
+
holiday_date: Date;
|
|
5
|
+
description?: string;
|
|
6
|
+
region?: string;
|
|
7
|
+
is_optional: boolean;
|
|
8
|
+
holiday_type: string;
|
|
9
|
+
year?: number;
|
|
10
|
+
constructor(title: string, holiday_date: Date, description?: string, region?: string, is_optional?: boolean, holiday_type?: string, year?: number);
|
|
11
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
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.Holidays = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
let Holidays = class Holidays extends BaseModel_1.BaseModel {
|
|
16
|
+
constructor(title, holiday_date, description, region, is_optional = false, holiday_type = 'Public', year) {
|
|
17
|
+
super();
|
|
18
|
+
this.title = title;
|
|
19
|
+
this.holiday_date = holiday_date;
|
|
20
|
+
this.description = description;
|
|
21
|
+
this.region = region;
|
|
22
|
+
this.is_optional = is_optional;
|
|
23
|
+
this.holiday_type = holiday_type;
|
|
24
|
+
this.year = year;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports.Holidays = Holidays;
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 200 }),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], Holidays.prototype, "title", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.Column)({ type: 'date', name: 'holiday_date' }),
|
|
34
|
+
__metadata("design:type", Date)
|
|
35
|
+
], Holidays.prototype, "holiday_date", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], Holidays.prototype, "description", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 200, nullable: true }),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], Holidays.prototype, "region", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({ type: 'boolean', name: 'is_optional', default: false }),
|
|
46
|
+
__metadata("design:type", Boolean)
|
|
47
|
+
], Holidays.prototype, "is_optional", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 30, name: 'holiday_type', default: 'Public' }),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], Holidays.prototype, "holiday_type", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
54
|
+
__metadata("design:type", Number)
|
|
55
|
+
], Holidays.prototype, "year", void 0);
|
|
56
|
+
exports.Holidays = Holidays = __decorate([
|
|
57
|
+
(0, typeorm_1.Entity)({ name: 'holidays' }),
|
|
58
|
+
__metadata("design:paramtypes", [String, Date, String, String, Boolean, String, Number])
|
|
59
|
+
], Holidays);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseModel } from './BaseModel';
|
|
2
|
+
export declare enum NotificationType {
|
|
3
|
+
REQUEST_RAISED = "request raised",
|
|
4
|
+
REMINDER = "reminder",
|
|
5
|
+
IMPORT = "import"
|
|
6
|
+
}
|
|
7
|
+
export declare class Notification extends BaseModel {
|
|
8
|
+
type: NotificationType;
|
|
9
|
+
user_id: number;
|
|
10
|
+
role_id: number;
|
|
11
|
+
department_id: number;
|
|
12
|
+
section_id: number;
|
|
13
|
+
content: any;
|
|
14
|
+
is_read: boolean;
|
|
15
|
+
request_id: number;
|
|
16
|
+
route_path: string;
|
|
17
|
+
constructor(type: NotificationType, user_id: number, role_id: number, department_id: number, section_id: number, content: any, is_read: boolean, request_id: number, route_path: string);
|
|
18
|
+
}
|
|
@@ -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.Notification = exports.NotificationType = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
var NotificationType;
|
|
16
|
+
(function (NotificationType) {
|
|
17
|
+
NotificationType["REQUEST_RAISED"] = "request raised";
|
|
18
|
+
NotificationType["REMINDER"] = "reminder";
|
|
19
|
+
NotificationType["IMPORT"] = "import";
|
|
20
|
+
})(NotificationType || (exports.NotificationType = NotificationType = {}));
|
|
21
|
+
let Notification = class Notification extends BaseModel_1.BaseModel {
|
|
22
|
+
constructor(type, user_id, role_id, department_id, section_id, content, is_read, request_id, route_path) {
|
|
23
|
+
super();
|
|
24
|
+
this.type = type;
|
|
25
|
+
this.user_id = user_id;
|
|
26
|
+
this.role_id = role_id;
|
|
27
|
+
this.department_id = department_id;
|
|
28
|
+
this.section_id = section_id;
|
|
29
|
+
this.content = content;
|
|
30
|
+
this.is_read = is_read;
|
|
31
|
+
this.request_id = request_id;
|
|
32
|
+
this.route_path = route_path;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
exports.Notification = Notification;
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({
|
|
38
|
+
type: "enum",
|
|
39
|
+
enum: NotificationType,
|
|
40
|
+
nullable: false,
|
|
41
|
+
}),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], Notification.prototype, "type", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({ type: 'bigint', nullable: false }),
|
|
46
|
+
__metadata("design:type", Number)
|
|
47
|
+
], Notification.prototype, "user_id", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({ type: 'bigint', nullable: true }),
|
|
50
|
+
__metadata("design:type", Number)
|
|
51
|
+
], Notification.prototype, "role_id", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Column)({ type: 'bigint', nullable: true }),
|
|
54
|
+
__metadata("design:type", Number)
|
|
55
|
+
], Notification.prototype, "department_id", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.Column)({ type: 'bigint', nullable: true }),
|
|
58
|
+
__metadata("design:type", Number)
|
|
59
|
+
], Notification.prototype, "section_id", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
62
|
+
__metadata("design:type", Object)
|
|
63
|
+
], Notification.prototype, "content", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: false }),
|
|
66
|
+
__metadata("design:type", Boolean)
|
|
67
|
+
], Notification.prototype, "is_read", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, typeorm_1.Column)({ type: 'bigint', nullable: true }),
|
|
70
|
+
__metadata("design:type", Number)
|
|
71
|
+
], Notification.prototype, "request_id", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 500, nullable: true }),
|
|
74
|
+
__metadata("design:type", String)
|
|
75
|
+
], Notification.prototype, "route_path", void 0);
|
|
76
|
+
exports.Notification = Notification = __decorate([
|
|
77
|
+
(0, typeorm_1.Entity)({ name: 'notification' }),
|
|
78
|
+
__metadata("design:paramtypes", [String, Number, Number, Number, Number, Object, Boolean, Number, String])
|
|
79
|
+
], Notification);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseModel } from './BaseModel';
|
|
2
|
+
import { Rating } from './feedbackModel';
|
|
3
|
+
export declare class PortalFeedback extends BaseModel {
|
|
4
|
+
comment: string;
|
|
5
|
+
rating: Rating;
|
|
6
|
+
user_Id: number;
|
|
7
|
+
constructor(comment: string, rating: Rating, user_Id: number);
|
|
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.PortalFeedback = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
const feedbackModel_1 = require("./feedbackModel");
|
|
16
|
+
let PortalFeedback = class PortalFeedback extends BaseModel_1.BaseModel {
|
|
17
|
+
constructor(comment, rating, user_Id) {
|
|
18
|
+
super();
|
|
19
|
+
this.comment = comment,
|
|
20
|
+
this.rating = rating,
|
|
21
|
+
this.user_Id = user_Id;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.PortalFeedback = PortalFeedback;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], PortalFeedback.prototype, "comment", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({
|
|
31
|
+
type: "enum",
|
|
32
|
+
enum: feedbackModel_1.Rating,
|
|
33
|
+
nullable: true,
|
|
34
|
+
}),
|
|
35
|
+
__metadata("design:type", Number)
|
|
36
|
+
], PortalFeedback.prototype, "rating", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
39
|
+
__metadata("design:type", Number)
|
|
40
|
+
], PortalFeedback.prototype, "user_Id", void 0);
|
|
41
|
+
exports.PortalFeedback = PortalFeedback = __decorate([
|
|
42
|
+
(0, typeorm_1.Entity)({ name: 'portal_feedback' }),
|
|
43
|
+
__metadata("design:paramtypes", [String, Number, Number])
|
|
44
|
+
], PortalFeedback);
|
package/dist/models/role.d.ts
CHANGED
|
@@ -9,14 +9,8 @@ Role
|
|
|
9
9
|
Userrole Information will store
|
|
10
10
|
*/
|
|
11
11
|
import { BaseModel } from './BaseModel';
|
|
12
|
-
export interface Irole {
|
|
13
|
-
name: string;
|
|
14
|
-
id?: number;
|
|
15
|
-
is_deleted?: boolean;
|
|
16
|
-
created_by?: number;
|
|
17
|
-
}
|
|
18
12
|
export declare class Role extends BaseModel {
|
|
19
13
|
name: string;
|
|
20
14
|
is_deleted?: boolean;
|
|
21
|
-
constructor(name: string, is_deleted: boolean
|
|
15
|
+
constructor(name: string, is_deleted: boolean);
|
|
22
16
|
}
|
package/dist/models/role.js
CHANGED
|
@@ -23,7 +23,7 @@ exports.Role = void 0;
|
|
|
23
23
|
const typeorm_1 = require("typeorm");
|
|
24
24
|
const BaseModel_1 = require("./BaseModel");
|
|
25
25
|
let Role = class Role extends BaseModel_1.BaseModel {
|
|
26
|
-
constructor(name, is_deleted
|
|
26
|
+
constructor(name, is_deleted) {
|
|
27
27
|
super();
|
|
28
28
|
this.name = name;
|
|
29
29
|
this.is_deleted = is_deleted;
|
|
@@ -40,5 +40,5 @@ __decorate([
|
|
|
40
40
|
], Role.prototype, "is_deleted", void 0);
|
|
41
41
|
exports.Role = Role = __decorate([
|
|
42
42
|
(0, typeorm_1.Entity)({ name: 'role' }),
|
|
43
|
-
__metadata("design:paramtypes", [String, Boolean
|
|
43
|
+
__metadata("design:paramtypes", [String, Boolean])
|
|
44
44
|
], Role);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** *
|
|
2
|
+
@author
|
|
3
|
+
Amnet Digital
|
|
4
|
+
@date
|
|
5
|
+
2024-05-20
|
|
6
|
+
@Model
|
|
7
|
+
Role
|
|
8
|
+
@usage
|
|
9
|
+
Userrole Information will store
|
|
10
|
+
*/
|
|
11
|
+
import { BaseModel } from './BaseModel';
|
|
12
|
+
export declare class RoleRights extends BaseModel {
|
|
13
|
+
user_role_id: number;
|
|
14
|
+
service_id: number;
|
|
15
|
+
constructor(user_role_id: number, service_id: number);
|
|
16
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/** *
|
|
3
|
+
@author
|
|
4
|
+
Amnet Digital
|
|
5
|
+
@date
|
|
6
|
+
2024-05-20
|
|
7
|
+
@Model
|
|
8
|
+
Role
|
|
9
|
+
@usage
|
|
10
|
+
Userrole Information will store
|
|
11
|
+
*/
|
|
12
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
13
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
14
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
15
|
+
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;
|
|
16
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
17
|
+
};
|
|
18
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.RoleRights = void 0;
|
|
23
|
+
const typeorm_1 = require("typeorm");
|
|
24
|
+
const BaseModel_1 = require("./BaseModel");
|
|
25
|
+
let RoleRights = class RoleRights extends BaseModel_1.BaseModel {
|
|
26
|
+
constructor(user_role_id, service_id) {
|
|
27
|
+
super();
|
|
28
|
+
this.user_role_id = user_role_id;
|
|
29
|
+
this.service_id = service_id;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
exports.RoleRights = RoleRights;
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({ type: 'bigint', nullable: true }),
|
|
35
|
+
__metadata("design:type", Number)
|
|
36
|
+
], RoleRights.prototype, "user_role_id", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ type: 'bigint', nullable: false }),
|
|
39
|
+
__metadata("design:type", Number)
|
|
40
|
+
], RoleRights.prototype, "service_id", void 0);
|
|
41
|
+
exports.RoleRights = RoleRights = __decorate([
|
|
42
|
+
(0, typeorm_1.Entity)({ name: 'role_rights' }),
|
|
43
|
+
__metadata("design:paramtypes", [Number, Number])
|
|
44
|
+
], RoleRights);
|
package/dist/models/user.d.ts
CHANGED
|
@@ -34,5 +34,9 @@ export declare class User extends BaseModel {
|
|
|
34
34
|
diplomatic_name?: string;
|
|
35
35
|
civil_employee_id?: number;
|
|
36
36
|
qualification?: string;
|
|
37
|
-
|
|
37
|
+
father_name?: string;
|
|
38
|
+
spouse_name?: string;
|
|
39
|
+
children1_name?: string;
|
|
40
|
+
children2_name?: string;
|
|
41
|
+
constructor(employee_id?: number, employee_name?: string, employee_arabic_name?: string, date_of_birth?: string, region_of_birth?: string, country_of_birth?: string, date_of_joining?: string, last_promotion_date?: string, gender?: string, marital_status?: string, nationality?: string, email?: string, blood_group?: string, national_id?: number, mobile?: string, department?: number, section?: number, grade?: number, location?: string, country?: string, is_admin?: boolean, division?: number, reporting_to?: number, address?: string, residential_status?: string, religion?: string, designation?: number, avatar?: string, passport_number?: string, personal_email?: string, extension_number?: number, diplomatic_name?: string, civil_employee_id?: number, qualification?: string, father_name?: string, spouse_name?: string, children1_name?: string, children2_name?: string);
|
|
38
42
|
}
|
package/dist/models/user.js
CHANGED
|
@@ -13,7 +13,7 @@ exports.User = void 0;
|
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
14
|
const BaseModel_1 = require("./BaseModel");
|
|
15
15
|
let User = class User extends BaseModel_1.BaseModel {
|
|
16
|
-
constructor(employee_id, employee_name, employee_arabic_name, date_of_birth, region_of_birth, country_of_birth, date_of_joining, last_promotion_date, gender, marital_status, nationality, email, blood_group, national_id, mobile, department, section, grade, location, country, is_admin, division, reporting_to, address, residential_status, religion, designation, avatar, passport_number, personal_email, extension_number, diplomatic_name, civil_employee_id, qualification) {
|
|
16
|
+
constructor(employee_id, employee_name, employee_arabic_name, date_of_birth, region_of_birth, country_of_birth, date_of_joining, last_promotion_date, gender, marital_status, nationality, email, blood_group, national_id, mobile, department, section, grade, location, country, is_admin, division, reporting_to, address, residential_status, religion, designation, avatar, passport_number, personal_email, extension_number, diplomatic_name, civil_employee_id, qualification, father_name, spouse_name, children1_name, children2_name) {
|
|
17
17
|
super();
|
|
18
18
|
this.employee_id = employee_id;
|
|
19
19
|
this.employee_name = employee_name;
|
|
@@ -49,6 +49,10 @@ let User = class User extends BaseModel_1.BaseModel {
|
|
|
49
49
|
this.diplomatic_name = diplomatic_name;
|
|
50
50
|
this.civil_employee_id = civil_employee_id;
|
|
51
51
|
this.qualification = qualification;
|
|
52
|
+
this.father_name = father_name;
|
|
53
|
+
this.spouse_name = spouse_name;
|
|
54
|
+
this.children1_name = children1_name;
|
|
55
|
+
this.children2_name = children2_name;
|
|
52
56
|
}
|
|
53
57
|
};
|
|
54
58
|
exports.User = User;
|
|
@@ -188,7 +192,23 @@ __decorate([
|
|
|
188
192
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
189
193
|
__metadata("design:type", String)
|
|
190
194
|
], User.prototype, "qualification", void 0);
|
|
195
|
+
__decorate([
|
|
196
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
197
|
+
__metadata("design:type", String)
|
|
198
|
+
], User.prototype, "father_name", void 0);
|
|
199
|
+
__decorate([
|
|
200
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
201
|
+
__metadata("design:type", String)
|
|
202
|
+
], User.prototype, "spouse_name", void 0);
|
|
203
|
+
__decorate([
|
|
204
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
205
|
+
__metadata("design:type", String)
|
|
206
|
+
], User.prototype, "children1_name", void 0);
|
|
207
|
+
__decorate([
|
|
208
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
209
|
+
__metadata("design:type", String)
|
|
210
|
+
], User.prototype, "children2_name", void 0);
|
|
191
211
|
exports.User = User = __decorate([
|
|
192
212
|
(0, typeorm_1.Entity)({ name: 'users' }),
|
|
193
|
-
__metadata("design:paramtypes", [Number, String, String, String, String, String, String, String, String, String, String, String, String, Number, String, Number, Number, Number, String, String, Boolean, Number, Number, String, String, String, Number, String, String, String, Number, String, Number, String])
|
|
213
|
+
__metadata("design:paramtypes", [Number, String, String, String, String, String, String, String, String, String, String, String, String, Number, String, Number, Number, Number, String, String, Boolean, Number, Number, String, String, String, Number, String, String, String, Number, String, Number, String, String, String, String, String])
|
|
194
214
|
], User);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** *
|
|
2
|
+
@author
|
|
3
|
+
Amnet Digital
|
|
4
|
+
@date
|
|
5
|
+
2024-05-20
|
|
6
|
+
@Model
|
|
7
|
+
Role
|
|
8
|
+
@usage
|
|
9
|
+
Userrole Information will store
|
|
10
|
+
*/
|
|
11
|
+
import { BaseModel } from './BaseModel';
|
|
12
|
+
export declare class UserRole extends BaseModel {
|
|
13
|
+
role_id: number;
|
|
14
|
+
user_id: number;
|
|
15
|
+
department_id: number;
|
|
16
|
+
section_id: number;
|
|
17
|
+
is_active: boolean;
|
|
18
|
+
constructor(role_id: number, user_id: number, department_id: number, section_id: number, is_active?: boolean);
|
|
19
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/** *
|
|
3
|
+
@author
|
|
4
|
+
Amnet Digital
|
|
5
|
+
@date
|
|
6
|
+
2024-05-20
|
|
7
|
+
@Model
|
|
8
|
+
Role
|
|
9
|
+
@usage
|
|
10
|
+
Userrole Information will store
|
|
11
|
+
*/
|
|
12
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
13
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
14
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
15
|
+
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;
|
|
16
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
17
|
+
};
|
|
18
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.UserRole = void 0;
|
|
23
|
+
const typeorm_1 = require("typeorm");
|
|
24
|
+
const BaseModel_1 = require("./BaseModel");
|
|
25
|
+
let UserRole = class UserRole extends BaseModel_1.BaseModel {
|
|
26
|
+
constructor(role_id, user_id, department_id, section_id, is_active = false) {
|
|
27
|
+
super();
|
|
28
|
+
this.role_id = role_id;
|
|
29
|
+
this.user_id = user_id;
|
|
30
|
+
this.department_id = department_id;
|
|
31
|
+
this.section_id = section_id;
|
|
32
|
+
this.is_active = is_active;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
exports.UserRole = UserRole;
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({ type: 'bigint', nullable: false }),
|
|
38
|
+
__metadata("design:type", Number)
|
|
39
|
+
], UserRole.prototype, "role_id", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.Column)({ type: 'bigint', nullable: false }),
|
|
42
|
+
__metadata("design:type", Number)
|
|
43
|
+
], UserRole.prototype, "user_id", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({ type: 'bigint', nullable: true }),
|
|
46
|
+
__metadata("design:type", Number)
|
|
47
|
+
], UserRole.prototype, "department_id", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({ type: 'bigint', nullable: true }),
|
|
50
|
+
__metadata("design:type", Number)
|
|
51
|
+
], UserRole.prototype, "section_id", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: false }),
|
|
54
|
+
__metadata("design:type", Boolean)
|
|
55
|
+
], UserRole.prototype, "is_active", void 0);
|
|
56
|
+
exports.UserRole = UserRole = __decorate([
|
|
57
|
+
(0, typeorm_1.Entity)({ name: 'user_role' }),
|
|
58
|
+
__metadata("design:paramtypes", [Number, Number, Number, Number, Boolean])
|
|
59
|
+
], UserRole);
|
package/package.json
CHANGED
package/src/data-source.ts
CHANGED
|
@@ -50,6 +50,11 @@ import { MessageReadStatus } from './models/MessageReadStatusModel';
|
|
|
50
50
|
import { ShiftDetails } from './models/ShifttimesModel';
|
|
51
51
|
import { AttendanceDetails } from './models/AttendanceModel';
|
|
52
52
|
import { UserShift } from './models/UserShiftModel';
|
|
53
|
+
import { Holidays } from './models/HolidaysModel';
|
|
54
|
+
import { UserRole } from './models/userRolesModel';
|
|
55
|
+
import { RoleRights } from './models/roleRightsModel';
|
|
56
|
+
import { PortalFeedback } from './models/PortalFeedbackModel';
|
|
57
|
+
import { Notification } from './models/NotificationModel';
|
|
53
58
|
|
|
54
59
|
|
|
55
60
|
export const AppDataSource = new DataSource({
|
|
@@ -59,7 +64,7 @@ export const AppDataSource = new DataSource({
|
|
|
59
64
|
username: process.env.DB_USER || 'postgres',
|
|
60
65
|
password: process.env.DB_PASS || 'postgres',
|
|
61
66
|
database: process.env.DB_NAME || 'common_models',
|
|
62
|
-
synchronize:
|
|
67
|
+
synchronize: true, // auto-create tables (disable in prod)
|
|
63
68
|
logging: false,
|
|
64
69
|
entities: [
|
|
65
70
|
User,
|
|
@@ -105,6 +110,11 @@ export const AppDataSource = new DataSource({
|
|
|
105
110
|
MessageReadStatus,
|
|
106
111
|
ShiftDetails,
|
|
107
112
|
AttendanceDetails,
|
|
108
|
-
UserShift
|
|
113
|
+
UserShift,
|
|
114
|
+
Holidays,
|
|
115
|
+
UserRole,
|
|
116
|
+
RoleRights,
|
|
117
|
+
PortalFeedback,
|
|
118
|
+
Notification
|
|
109
119
|
],
|
|
110
120
|
});
|
package/src/index.ts
CHANGED
|
@@ -42,16 +42,8 @@ export * from './models/ShifttimesModel';
|
|
|
42
42
|
export * from './models/AttendanceModel';
|
|
43
43
|
export * from './models/contactInfoModel';
|
|
44
44
|
export * from './models/UserShiftModel';
|
|
45
|
-
export * from './models/
|
|
46
|
-
export * from './models/
|
|
47
|
-
export * from './models/
|
|
48
|
-
export * from './models/
|
|
49
|
-
export * from './models/
|
|
50
|
-
export * from './models/BankAccountChangeRequestsModel';
|
|
51
|
-
export * from './models/FinancialChatsModel';
|
|
52
|
-
export * from './models/FinancialApprovalsModel';
|
|
53
|
-
export * from './models/FinancialWorkFlowModel';
|
|
54
|
-
export * from './models/FinancialAttachmentsModel';
|
|
55
|
-
export * from './models/RequestTypeMasterModel';
|
|
56
|
-
export * from './models/FinancialSettingsModel';
|
|
57
|
-
export * from './models/AllowanceTypesModel';
|
|
45
|
+
export * from './models/HolidaysModel';
|
|
46
|
+
export * from './models/userRolesModel';
|
|
47
|
+
export * from './models/roleRightsModel';
|
|
48
|
+
export * from './models/PortalFeedbackModel';
|
|
49
|
+
export * from './models/NotificationModel';
|
package/src/models/FMServices.ts
CHANGED
|
@@ -32,6 +32,15 @@ export class FinancialApprovals extends BaseModel {
|
|
|
32
32
|
@Column({ type: 'timestamp', nullable: true })
|
|
33
33
|
action_date: Date;
|
|
34
34
|
|
|
35
|
+
@Column({ type: 'int', nullable: true })
|
|
36
|
+
department_id: number;
|
|
37
|
+
|
|
38
|
+
@Column({ type: 'int', nullable: true })
|
|
39
|
+
section_id: number;
|
|
40
|
+
|
|
41
|
+
@Column({ type: 'int', nullable: true })
|
|
42
|
+
approved_by: number;
|
|
43
|
+
|
|
35
44
|
@ManyToOne(() => FinancialRequests, fr => fr.approvals)
|
|
36
45
|
@JoinColumn({ name: 'financial_request_id' })
|
|
37
46
|
financialRequest?: FinancialRequests;
|
|
@@ -40,13 +49,19 @@ export class FinancialApprovals extends BaseModel {
|
|
|
40
49
|
financial_request_id: number,
|
|
41
50
|
level: number,
|
|
42
51
|
approver_role_id: number,
|
|
43
|
-
approval_status: FinancialApprovalStatus
|
|
52
|
+
approval_status: FinancialApprovalStatus,
|
|
53
|
+
department_id: number,
|
|
54
|
+
section_id: number,
|
|
55
|
+
approved_by: number
|
|
44
56
|
) {
|
|
45
57
|
super();
|
|
46
58
|
this.financial_request_id = financial_request_id;
|
|
47
59
|
this.level = level;
|
|
48
60
|
this.approver_role_id = approver_role_id;
|
|
49
61
|
this.approval_status = approval_status;
|
|
62
|
+
this.department_id = department_id;
|
|
63
|
+
this.section_id = section_id;
|
|
64
|
+
this.approved_by = approved_by;
|
|
50
65
|
}
|
|
51
66
|
}
|
|
52
67
|
|
|
@@ -71,6 +71,18 @@ export class FinancialRequests extends BaseModel {
|
|
|
71
71
|
@Column({ type: 'int', nullable: true })
|
|
72
72
|
current_approver_id: number;
|
|
73
73
|
|
|
74
|
+
@Column({ type: 'int', nullable: true })
|
|
75
|
+
service_id: number;
|
|
76
|
+
|
|
77
|
+
@Column({ type: 'int', nullable: true })
|
|
78
|
+
sub_service_id: number;
|
|
79
|
+
|
|
80
|
+
@Column({ type: 'int', nullable: true })
|
|
81
|
+
section_id: number;
|
|
82
|
+
|
|
83
|
+
@Column({ type: 'int', nullable: true })
|
|
84
|
+
reporting_manager: number;
|
|
85
|
+
|
|
74
86
|
@OneToOne('PayslipRequests', 'financialRequest', { nullable: true })
|
|
75
87
|
payslipRequest?: PayslipRequests;
|
|
76
88
|
|
|
@@ -108,7 +120,11 @@ export class FinancialRequests extends BaseModel {
|
|
|
108
120
|
employee_name: string,
|
|
109
121
|
email_address: string,
|
|
110
122
|
contact_number: string,
|
|
111
|
-
request_type_id: number
|
|
123
|
+
request_type_id: number,
|
|
124
|
+
service_id: number,
|
|
125
|
+
sub_service_id: number,
|
|
126
|
+
section_id: number,
|
|
127
|
+
reporting_manager: number
|
|
112
128
|
) {
|
|
113
129
|
super();
|
|
114
130
|
this.user_id = user_id;
|
|
@@ -119,6 +135,10 @@ export class FinancialRequests extends BaseModel {
|
|
|
119
135
|
this.request_type_id = request_type_id;
|
|
120
136
|
this.request_date = new Date();
|
|
121
137
|
this.request_status = FinancialRequestStatus.PENDING;
|
|
138
|
+
this.service_id = service_id;
|
|
139
|
+
this.sub_service_id = sub_service_id;
|
|
140
|
+
this.section_id = section_id;
|
|
141
|
+
this.reporting_manager = reporting_manager;
|
|
122
142
|
}
|
|
123
143
|
}
|
|
124
144
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
@Entity({ name: 'holidays' })
|
|
5
|
+
export class Holidays extends BaseModel {
|
|
6
|
+
|
|
7
|
+
@Column({ type: 'varchar', length: 200 })
|
|
8
|
+
title: string;
|
|
9
|
+
|
|
10
|
+
@Column({ type: 'date', name: 'holiday_date' })
|
|
11
|
+
holiday_date: Date;
|
|
12
|
+
|
|
13
|
+
@Column({ type: 'text', nullable: true })
|
|
14
|
+
description?: string;
|
|
15
|
+
|
|
16
|
+
@Column({ type: 'varchar', length: 200, nullable: true })
|
|
17
|
+
region?: string;
|
|
18
|
+
|
|
19
|
+
@Column({ type: 'boolean', name: 'is_optional', default: false })
|
|
20
|
+
is_optional: boolean;
|
|
21
|
+
|
|
22
|
+
@Column({ type: 'varchar', length: 30, name: 'holiday_type', default: 'Public' })
|
|
23
|
+
holiday_type: string;
|
|
24
|
+
|
|
25
|
+
@Column({ type: 'int', nullable: true })
|
|
26
|
+
year?: number;
|
|
27
|
+
|
|
28
|
+
constructor(
|
|
29
|
+
title: string,
|
|
30
|
+
holiday_date: Date,
|
|
31
|
+
description?: string,
|
|
32
|
+
region?: string,
|
|
33
|
+
is_optional: boolean = false,
|
|
34
|
+
holiday_type: string = 'Public',
|
|
35
|
+
year?: number
|
|
36
|
+
) {
|
|
37
|
+
super();
|
|
38
|
+
this.title = title;
|
|
39
|
+
this.holiday_date = holiday_date;
|
|
40
|
+
this.description = description;
|
|
41
|
+
this.region = region;
|
|
42
|
+
this.is_optional = is_optional;
|
|
43
|
+
this.holiday_type = holiday_type;
|
|
44
|
+
this.year = year;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
|
|
2
|
+
import { Column, Entity } from "typeorm";
|
|
3
|
+
import { BaseModel } from './BaseModel';
|
|
4
|
+
|
|
5
|
+
export enum NotificationType {
|
|
6
|
+
REQUEST_RAISED = 'request raised',
|
|
7
|
+
REMINDER = 'reminder',
|
|
8
|
+
IMPORT = 'import',
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@Entity({ name: 'notification' })
|
|
12
|
+
export class Notification extends BaseModel {
|
|
13
|
+
|
|
14
|
+
@Column({
|
|
15
|
+
type: "enum",
|
|
16
|
+
enum: NotificationType,
|
|
17
|
+
nullable: false,
|
|
18
|
+
})
|
|
19
|
+
type: NotificationType;
|
|
20
|
+
|
|
21
|
+
@Column({ type: 'bigint', nullable: false })
|
|
22
|
+
user_id: number;
|
|
23
|
+
|
|
24
|
+
@Column({ type: 'bigint', nullable: true })
|
|
25
|
+
role_id: number;
|
|
26
|
+
|
|
27
|
+
@Column({ type: 'bigint', nullable: true })
|
|
28
|
+
department_id: number;
|
|
29
|
+
|
|
30
|
+
@Column({ type: 'bigint', nullable: true })
|
|
31
|
+
section_id: number;
|
|
32
|
+
|
|
33
|
+
@Column({ type: 'jsonb', nullable: true })
|
|
34
|
+
content: any;
|
|
35
|
+
|
|
36
|
+
@Column({ type: 'boolean', default: false })
|
|
37
|
+
is_read: boolean;
|
|
38
|
+
|
|
39
|
+
@Column({ type: 'bigint', nullable: true })
|
|
40
|
+
request_id: number;
|
|
41
|
+
|
|
42
|
+
@Column({ type: 'varchar', length: 500, nullable: true })
|
|
43
|
+
route_path: string;
|
|
44
|
+
|
|
45
|
+
constructor(
|
|
46
|
+
type: NotificationType,
|
|
47
|
+
user_id: number,
|
|
48
|
+
role_id: number,
|
|
49
|
+
department_id: number,
|
|
50
|
+
section_id: number,
|
|
51
|
+
content: any,
|
|
52
|
+
is_read: boolean,
|
|
53
|
+
request_id: number,
|
|
54
|
+
route_path: string
|
|
55
|
+
) {
|
|
56
|
+
super();
|
|
57
|
+
this.type = type;
|
|
58
|
+
this.user_id = user_id;
|
|
59
|
+
this.role_id = role_id;
|
|
60
|
+
this.department_id = department_id;
|
|
61
|
+
this.section_id = section_id;
|
|
62
|
+
this.content = content;
|
|
63
|
+
this.is_read = is_read;
|
|
64
|
+
this.request_id = request_id;
|
|
65
|
+
this.route_path = route_path;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
|
|
2
|
+
import { Column, Entity } from "typeorm";
|
|
3
|
+
import { BaseModel } from './BaseModel';
|
|
4
|
+
import { Rating } from './feedbackModel';
|
|
5
|
+
|
|
6
|
+
@Entity({ name: 'portal_feedback' })
|
|
7
|
+
export class PortalFeedback extends BaseModel {
|
|
8
|
+
|
|
9
|
+
@Column({ nullable: true })
|
|
10
|
+
comment: string;
|
|
11
|
+
|
|
12
|
+
@Column({
|
|
13
|
+
type: "enum",
|
|
14
|
+
enum: Rating,
|
|
15
|
+
nullable: true,
|
|
16
|
+
})
|
|
17
|
+
rating: Rating;
|
|
18
|
+
|
|
19
|
+
@Column({ nullable: true })
|
|
20
|
+
user_Id: number;
|
|
21
|
+
|
|
22
|
+
constructor(
|
|
23
|
+
comment: string,
|
|
24
|
+
rating: Rating,
|
|
25
|
+
user_Id: number,
|
|
26
|
+
) {
|
|
27
|
+
super();
|
|
28
|
+
this.comment = comment,
|
|
29
|
+
this.rating = rating,
|
|
30
|
+
this.user_Id = user_Id
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
package/src/models/role.ts
CHANGED
|
@@ -12,12 +12,6 @@ Userrole Information will store
|
|
|
12
12
|
import { Column, Entity } from "typeorm";
|
|
13
13
|
import { BaseModel } from './BaseModel';
|
|
14
14
|
|
|
15
|
-
export interface Irole {
|
|
16
|
-
name: string;
|
|
17
|
-
id?: number;
|
|
18
|
-
is_deleted?: boolean;
|
|
19
|
-
created_by?: number;
|
|
20
|
-
}
|
|
21
15
|
@Entity({ name: 'role' })
|
|
22
16
|
export class Role extends BaseModel {
|
|
23
17
|
|
|
@@ -28,7 +22,7 @@ export class Role extends BaseModel {
|
|
|
28
22
|
is_deleted?: boolean;
|
|
29
23
|
|
|
30
24
|
|
|
31
|
-
constructor(name: string,is_deleted:boolean
|
|
25
|
+
constructor(name: string, is_deleted:boolean) {
|
|
32
26
|
super();
|
|
33
27
|
this.name = name
|
|
34
28
|
this.is_deleted = is_deleted
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** *
|
|
2
|
+
@author
|
|
3
|
+
Amnet Digital
|
|
4
|
+
@date
|
|
5
|
+
2024-05-20
|
|
6
|
+
@Model
|
|
7
|
+
Role
|
|
8
|
+
@usage
|
|
9
|
+
Userrole Information will store
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { Column, Entity } from "typeorm";
|
|
13
|
+
import { BaseModel } from './BaseModel';
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@Entity({ name: 'role_rights' })
|
|
17
|
+
export class RoleRights extends BaseModel {
|
|
18
|
+
|
|
19
|
+
@Column({ type: 'bigint', nullable: true })
|
|
20
|
+
user_role_id: number;
|
|
21
|
+
|
|
22
|
+
@Column({ type: 'bigint', nullable: false })
|
|
23
|
+
service_id: number;
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
constructor(user_role_id: number, service_id: number) {
|
|
27
|
+
super();
|
|
28
|
+
this.user_role_id = user_role_id
|
|
29
|
+
this.service_id = service_id
|
|
30
|
+
}
|
|
31
|
+
}
|
package/src/models/user.ts
CHANGED
|
@@ -106,6 +106,19 @@ export class User extends BaseModel {
|
|
|
106
106
|
@Column({ nullable: true })
|
|
107
107
|
qualification?: string;
|
|
108
108
|
|
|
109
|
+
|
|
110
|
+
@Column({ nullable: true })
|
|
111
|
+
father_name?: string;
|
|
112
|
+
|
|
113
|
+
@Column({ nullable: true })
|
|
114
|
+
spouse_name?: string;
|
|
115
|
+
|
|
116
|
+
@Column({ nullable: true })
|
|
117
|
+
children1_name?: string;
|
|
118
|
+
|
|
119
|
+
@Column({ nullable: true })
|
|
120
|
+
children2_name?: string;
|
|
121
|
+
|
|
109
122
|
constructor(
|
|
110
123
|
employee_id?: number,
|
|
111
124
|
employee_name?: string,
|
|
@@ -141,6 +154,10 @@ export class User extends BaseModel {
|
|
|
141
154
|
diplomatic_name?: string,
|
|
142
155
|
civil_employee_id?: number,
|
|
143
156
|
qualification?: string,
|
|
157
|
+
father_name?: string,
|
|
158
|
+
spouse_name?: string,
|
|
159
|
+
children1_name?: string,
|
|
160
|
+
children2_name?: string,
|
|
144
161
|
) {
|
|
145
162
|
super();
|
|
146
163
|
this.employee_id = employee_id;
|
|
@@ -177,5 +194,9 @@ export class User extends BaseModel {
|
|
|
177
194
|
this.diplomatic_name = diplomatic_name;
|
|
178
195
|
this.civil_employee_id = civil_employee_id;
|
|
179
196
|
this.qualification = qualification;
|
|
197
|
+
this.father_name = father_name;
|
|
198
|
+
this.spouse_name = spouse_name;
|
|
199
|
+
this.children1_name = children1_name;
|
|
200
|
+
this.children2_name = children2_name;
|
|
180
201
|
}
|
|
181
202
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/** *
|
|
2
|
+
@author
|
|
3
|
+
Amnet Digital
|
|
4
|
+
@date
|
|
5
|
+
2024-05-20
|
|
6
|
+
@Model
|
|
7
|
+
Role
|
|
8
|
+
@usage
|
|
9
|
+
Userrole Information will store
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { Column, Entity } from "typeorm";
|
|
13
|
+
import { BaseModel } from './BaseModel';
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@Entity({ name: 'user_role' })
|
|
17
|
+
export class UserRole extends BaseModel {
|
|
18
|
+
|
|
19
|
+
@Column({ type: 'bigint', nullable: false })
|
|
20
|
+
role_id: number;
|
|
21
|
+
|
|
22
|
+
@Column({ type: 'bigint', nullable: false })
|
|
23
|
+
user_id: number;
|
|
24
|
+
|
|
25
|
+
@Column({ type: 'bigint', nullable: true })
|
|
26
|
+
department_id: number;
|
|
27
|
+
|
|
28
|
+
@Column({ type: 'bigint', nullable: true })
|
|
29
|
+
section_id: number;
|
|
30
|
+
|
|
31
|
+
@Column({ type: 'boolean', default: false })
|
|
32
|
+
is_active: boolean;
|
|
33
|
+
|
|
34
|
+
constructor(role_id: number, user_id: number, department_id: number, section_id: number, is_active: boolean = false) {
|
|
35
|
+
super();
|
|
36
|
+
this.role_id = role_id
|
|
37
|
+
this.user_id = user_id
|
|
38
|
+
this.department_id = department_id
|
|
39
|
+
this.section_id = section_id
|
|
40
|
+
this.is_active = is_active
|
|
41
|
+
}
|
|
42
|
+
}
|