@platform-modules/civil-aviation-authority 2.3.155 → 2.3.157

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.
Files changed (57) hide show
  1. package/.env +9 -17
  2. package/dist/models/AccommodationRequestModel.d.ts +7 -4
  3. package/dist/models/AccommodationRequestModel.js +12 -3
  4. package/dist/models/ITApprovalSettings.d.ts +7 -0
  5. package/dist/models/ITApprovalSettings.js +40 -0
  6. package/dist/models/ITServicesTypesMuscatModel.d.ts +6 -0
  7. package/dist/models/ITServicesTypesMuscatModel.js +34 -0
  8. package/dist/models/ITServicesTypesSalalahModel.d.ts +6 -0
  9. package/dist/models/ITServicesTypesSalalahModel.js +34 -0
  10. package/dist/models/Workflows.d.ts +9 -0
  11. package/dist/models/Workflows.js +31 -0
  12. package/package.json +1 -1
  13. package/src/models/AccommodationApprovalModel.ts +8 -8
  14. package/src/models/AccommodationRequestModel.ts +20 -11
  15. package/src/models/AnnualIncrementRequestEmployeeModel.ts +65 -65
  16. package/src/models/AnnualIncrementRequestModel.ts +25 -25
  17. package/src/models/AnnualTrainingPlanRequestModel.ts +153 -153
  18. package/src/models/AppealAgainstAdministrativeDecisionRequestModel.ts +23 -23
  19. package/src/models/CAAServices.ts +33 -33
  20. package/src/models/CAASubServices.ts +33 -33
  21. package/src/models/CAIRatingMasterModel.ts +39 -39
  22. package/src/models/CSRMBusinessImpactRatingMasterModel.ts +25 -25
  23. package/src/models/CSRMLikelihoodMasterModel.ts +25 -25
  24. package/src/models/CashAllowanceLeaveRequestModel.ts +11 -11
  25. package/src/models/CyberSecurityAuditRequestModel.ts +32 -32
  26. package/src/models/DepartmentsModel.ts +25 -25
  27. package/src/models/DocumentDriveModel.ts +28 -28
  28. package/src/models/DocumentFolderModel.ts +45 -45
  29. package/src/models/HousingContractCancelChatModel.ts +56 -56
  30. package/src/models/HousingContractRenewalChatModel.ts +59 -59
  31. package/src/models/HrServiceRequestModel.ts +193 -193
  32. package/src/models/ITRequestChatModel.ts +62 -62
  33. package/src/models/ItApprovalsModel.ts +84 -84
  34. package/src/models/ItWorkflowModel.ts +55 -55
  35. package/src/models/MissionTravelPassportExpiryNotificationConfigModel.ts +36 -36
  36. package/src/models/PerformanceCyclePeriodModel.ts +26 -26
  37. package/src/models/PerformanceGoalMasterModel.ts +27 -27
  38. package/src/models/PerformanceManagementRequestGoalModel.ts +46 -46
  39. package/src/models/PerformanceManagementRequestModel.ts +14 -14
  40. package/src/models/PromotionRequestModel.ts +11 -11
  41. package/src/models/ResidentialUnitRentalChatModel.ts +56 -56
  42. package/src/models/ResidentialUnitRentalRequestModel.ts +218 -218
  43. package/src/models/ServicesNotificationConfigModel.ts +55 -55
  44. package/src/models/StudyLeaveRequestModel.ts +144 -144
  45. package/src/models/TrainingRoomBookingRequestModel.ts +142 -142
  46. package/src/models/TrainingRoomNotificationConfigModel.ts +30 -30
  47. package/src/models/UserSkillModel.ts +56 -56
  48. package/dist/models/DocumentMetadataModel.d.ts +0 -45
  49. package/dist/models/DocumentMetadataModel.js +0 -171
  50. package/dist/models/DocumentationDepartmentsModel.d.ts +0 -13
  51. package/dist/models/DocumentationDepartmentsModel.js +0 -53
  52. package/dist/models/FolderModel.d.ts +0 -16
  53. package/dist/models/FolderModel.js +0 -85
  54. package/dist/models/PermissionModel.d.ts +0 -18
  55. package/dist/models/PermissionModel.js +0 -68
  56. package/dist/models/UUIDBaseModel.d.ts +0 -14
  57. package/dist/models/UUIDBaseModel.js +0 -66
package/.env CHANGED
@@ -1,20 +1,12 @@
1
- DB_HOST=164.52.222.169
2
- DB_PORT=5432
3
- DB_USER=postgres_admin_user
4
- DB_PASS=pg_admin_user_pwd_caa_fa_$%^&OIukhjgcvbn
5
- DB_NAME=CAA
6
-
7
- # DB_HOST=216.48.187.46
1
+ # DB_HOST=164.52.222.169
8
2
  # DB_PORT=5432
9
- # DB_USER=adminuser
10
- # DB_PASS=postgres_caa_fm_qa_34567
11
- # DB_NAME=CAA_QA
12
-
3
+ # DB_USER=postgres_admin_user
4
+ # DB_PASS=pg_admin_user_pwd_caa_fa_$%^&OIukhjgcvbn
5
+ # DB_NAME=CAA
13
6
 
14
7
 
15
-
16
- # DB_HOST=localhost
17
- # DB_PORT=5432
18
- # DB_USER=postgres
19
- # DB_PASS=stevejobs
20
- # DB_NAME=CAA
8
+ DB_HOST=localhost
9
+ DB_PORT=5432
10
+ DB_USER=postgres
11
+ DB_PASS=stevejobs
12
+ DB_NAME=CAA
@@ -15,9 +15,10 @@ export declare enum OfficialPurposeOfTravel {
15
15
  Other = "Other"
16
16
  }
17
17
  export declare enum AccommodationType {
18
- Apartment = "Apartment",
19
- Villa = "Villa",
20
- SharedUnit = "Shared Unit"
18
+ Studio = "Studio",
19
+ OneRoom = "1 Room",
20
+ TwoRooms = "2 Rooms",
21
+ ThreeRooms = "3 Rooms"
21
22
  }
22
23
  export declare class AccommodationRequest extends BaseModel {
23
24
  reference_number: string | null;
@@ -32,6 +33,8 @@ export declare class AccommodationRequest extends BaseModel {
32
33
  other_purpose_specification: string | null;
33
34
  accommodation_type_requested: AccommodationType;
34
35
  start_date_of_stay: Date;
36
+ end_date_of_stay: Date;
37
+ departure_time: string;
35
38
  duration_of_days: number;
36
39
  travel_from: string;
37
40
  travel_to: string;
@@ -42,7 +45,7 @@ export declare class AccommodationRequest extends BaseModel {
42
45
  employee_id: string;
43
46
  employee_name: string;
44
47
  designation: string;
45
- grade: string;
48
+ grade?: string | null;
46
49
  contact_number: string;
47
50
  }>;
48
51
  status: AccommodationRequestStatus;
@@ -31,9 +31,10 @@ var OfficialPurposeOfTravel;
31
31
  })(OfficialPurposeOfTravel || (exports.OfficialPurposeOfTravel = OfficialPurposeOfTravel = {}));
32
32
  var AccommodationType;
33
33
  (function (AccommodationType) {
34
- AccommodationType["Apartment"] = "Apartment";
35
- AccommodationType["Villa"] = "Villa";
36
- AccommodationType["SharedUnit"] = "Shared Unit";
34
+ AccommodationType["Studio"] = "Studio";
35
+ AccommodationType["OneRoom"] = "1 Room";
36
+ AccommodationType["TwoRooms"] = "2 Rooms";
37
+ AccommodationType["ThreeRooms"] = "3 Rooms";
37
38
  })(AccommodationType || (exports.AccommodationType = AccommodationType = {}));
38
39
  let AccommodationRequest = class AccommodationRequest extends BaseModel_1.BaseModel {
39
40
  constructor() {
@@ -97,6 +98,14 @@ __decorate([
97
98
  (0, typeorm_1.Column)({ type: 'date', nullable: false }),
98
99
  __metadata("design:type", Date)
99
100
  ], AccommodationRequest.prototype, "start_date_of_stay", void 0);
101
+ __decorate([
102
+ (0, typeorm_1.Column)({ type: 'date', nullable: true }),
103
+ __metadata("design:type", Date)
104
+ ], AccommodationRequest.prototype, "end_date_of_stay", void 0);
105
+ __decorate([
106
+ (0, typeorm_1.Column)({ type: 'time', nullable: true }),
107
+ __metadata("design:type", String)
108
+ ], AccommodationRequest.prototype, "departure_time", void 0);
100
109
  __decorate([
101
110
  (0, typeorm_1.Column)({ type: 'int', nullable: false }),
102
111
  __metadata("design:type", Number)
@@ -0,0 +1,7 @@
1
+ import { BaseModel } from './BaseModel';
2
+ export declare class ITApprovalSettings extends BaseModel {
3
+ level: number;
4
+ approval_role_id: number;
5
+ workflow_id: number;
6
+ constructor(level: number, approval_role_id: number, workflow_id: number);
7
+ }
@@ -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.ITApprovalSettings = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ let ITApprovalSettings = class ITApprovalSettings extends BaseModel_1.BaseModel {
16
+ constructor(level, approval_role_id, workflow_id) {
17
+ super();
18
+ this.level = level;
19
+ this.approval_role_id = approval_role_id;
20
+ this.workflow_id = workflow_id;
21
+ }
22
+ };
23
+ exports.ITApprovalSettings = ITApprovalSettings;
24
+ __decorate([
25
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
26
+ __metadata("design:type", Number)
27
+ ], ITApprovalSettings.prototype, "level", void 0);
28
+ __decorate([
29
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
30
+ __metadata("design:type", Number)
31
+ ], ITApprovalSettings.prototype, "approval_role_id", void 0);
32
+ __decorate([
33
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
34
+ __metadata("design:type", Number)
35
+ ], ITApprovalSettings.prototype, "workflow_id", void 0);
36
+ exports.ITApprovalSettings = ITApprovalSettings = __decorate([
37
+ (0, typeorm_1.Entity)({ name: 'it_approval_settings' }),
38
+ (0, typeorm_1.Unique)(['workflow_id', 'level']),
39
+ __metadata("design:paramtypes", [Number, Number, Number])
40
+ ], ITApprovalSettings);
@@ -0,0 +1,6 @@
1
+ import { BaseModel } from './BaseModel';
2
+ export declare class ITServicesTypesMuscat extends BaseModel {
3
+ name: string;
4
+ name_in_arabic: string;
5
+ constructor(name: string, name_in_arabic: string);
6
+ }
@@ -0,0 +1,34 @@
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.ITServicesTypesMuscat = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ let ITServicesTypesMuscat = class ITServicesTypesMuscat extends BaseModel_1.BaseModel {
16
+ constructor(name, name_in_arabic) {
17
+ super();
18
+ this.name = name;
19
+ this.name_in_arabic = name_in_arabic;
20
+ }
21
+ };
22
+ exports.ITServicesTypesMuscat = ITServicesTypesMuscat;
23
+ __decorate([
24
+ (0, typeorm_1.Column)({ nullable: false }),
25
+ __metadata("design:type", String)
26
+ ], ITServicesTypesMuscat.prototype, "name", void 0);
27
+ __decorate([
28
+ (0, typeorm_1.Column)({ nullable: false }),
29
+ __metadata("design:type", String)
30
+ ], ITServicesTypesMuscat.prototype, "name_in_arabic", void 0);
31
+ exports.ITServicesTypesMuscat = ITServicesTypesMuscat = __decorate([
32
+ (0, typeorm_1.Entity)({ name: 'it_services_types_muscat' }),
33
+ __metadata("design:paramtypes", [String, String])
34
+ ], ITServicesTypesMuscat);
@@ -0,0 +1,6 @@
1
+ import { BaseModel } from './BaseModel';
2
+ export declare class ITServicesTypesSalalah extends BaseModel {
3
+ name: string;
4
+ name_in_arabic: string;
5
+ constructor(name: string, name_in_arabic: string);
6
+ }
@@ -0,0 +1,34 @@
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.ITServicesTypesSalalah = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ let ITServicesTypesSalalah = class ITServicesTypesSalalah extends BaseModel_1.BaseModel {
16
+ constructor(name, name_in_arabic) {
17
+ super();
18
+ this.name = name;
19
+ this.name_in_arabic = name_in_arabic;
20
+ }
21
+ };
22
+ exports.ITServicesTypesSalalah = ITServicesTypesSalalah;
23
+ __decorate([
24
+ (0, typeorm_1.Column)({ nullable: false }),
25
+ __metadata("design:type", String)
26
+ ], ITServicesTypesSalalah.prototype, "name", void 0);
27
+ __decorate([
28
+ (0, typeorm_1.Column)({ nullable: false }),
29
+ __metadata("design:type", String)
30
+ ], ITServicesTypesSalalah.prototype, "name_in_arabic", void 0);
31
+ exports.ITServicesTypesSalalah = ITServicesTypesSalalah = __decorate([
32
+ (0, typeorm_1.Entity)({ name: 'it_services_types_salalah' }),
33
+ __metadata("design:paramtypes", [String, String])
34
+ ], ITServicesTypesSalalah);
@@ -0,0 +1,9 @@
1
+ import { BaseModel } from './BaseModel';
2
+ export declare class Workflows extends BaseModel {
3
+ name: string;
4
+ service_id: number;
5
+ sub_service_id: number;
6
+ request_for: string;
7
+ levels: number;
8
+ constructor(name: string, service_id: number, sub_service_id: number, request_for: string, levels: number);
9
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ // import { Column, Entity, Unique } from "typeorm";
3
+ // import { BaseModel } from './BaseModel';
4
+ // @Entity({ name: 'workflows' })
5
+ // @Unique(['service_id', 'sub_service_id', 'request_for'])
6
+ // export class Workflows extends BaseModel {
7
+ // @Column({ type: 'varchar', length: 100, nullable: false })
8
+ // name: string;
9
+ // @Column({ type: 'bigint', nullable: false })
10
+ // service_id: number;
11
+ // @Column({ type: 'bigint', nullable: false })
12
+ // sub_service_id: number;
13
+ // @Column({ type: 'varchar', length: 20, nullable: false })
14
+ // request_for: string; // 'Self' | 'Behalf of' | 'Internal'
15
+ // @Column({ type: 'int', nullable: false })
16
+ // levels: number;
17
+ // constructor(
18
+ // name: string,
19
+ // service_id: number,
20
+ // sub_service_id: number,
21
+ // request_for: string,
22
+ // levels: number,
23
+ // ) {
24
+ // super();
25
+ // this.name = name;
26
+ // this.service_id = service_id;
27
+ // this.sub_service_id = sub_service_id;
28
+ // this.request_for = request_for;
29
+ // this.levels = levels;
30
+ // }
31
+ // }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platform-modules/civil-aviation-authority",
3
- "version": "2.3.155",
3
+ "version": "2.3.157",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -35,14 +35,14 @@ export class AccommodationApproval extends BaseModel {
35
35
  @Column({ type: 'int', nullable: true })
36
36
  department_id: number;
37
37
 
38
- @Column({ type: 'int', nullable: true })
39
- section_id: number;
40
-
41
- @Column({ type: 'boolean', nullable: false, default: true })
42
- is_allowed: boolean;
43
-
44
- @Column({ type: 'int', nullable: false })
45
- level: number;
38
+ @Column({ type: 'int', nullable: true })
39
+ section_id: number;
40
+
41
+ @Column({ type: 'boolean', nullable: false, default: true })
42
+ is_allowed: boolean;
43
+
44
+ @Column({ type: 'int', nullable: false })
45
+ level: number;
46
46
 
47
47
  @Column({
48
48
  type: 'enum',
@@ -19,9 +19,10 @@ export enum OfficialPurposeOfTravel {
19
19
  }
20
20
 
21
21
  export enum AccommodationType {
22
- Apartment = 'Apartment',
23
- Villa = 'Villa',
24
- SharedUnit = 'Shared Unit'
22
+ Studio = 'Studio',
23
+ OneRoom = '1 Room',
24
+ TwoRooms = '2 Rooms',
25
+ ThreeRooms = '3 Rooms'
25
26
  }
26
27
 
27
28
  @Entity({ name: 'accommodation_requests' })
@@ -64,7 +65,7 @@ export class AccommodationRequest extends BaseModel {
64
65
  @Column({ type: 'varchar', length: 255, nullable: true })
65
66
  other_purpose_specification: string | null; // If Other is selected
66
67
 
67
- // 3. Accommodation Type Requested (Apartment / Villa / Shared Unit)
68
+ // 3. Accommodation Type Requested (Studio / 1 Room / 2 Rooms / 3 Rooms)
68
69
  @Column({
69
70
  type: 'enum',
70
71
  enum: AccommodationType,
@@ -76,36 +77,44 @@ export class AccommodationRequest extends BaseModel {
76
77
  @Column({ type: 'date', nullable: false })
77
78
  start_date_of_stay: Date;
78
79
 
79
- // 5. Duration of Days (M)
80
+ // 5. End Date of Stay (M)
81
+ @Column({ type: 'date', nullable: true })
82
+ end_date_of_stay: Date;
83
+
84
+ // 6. Departure Time (M)
85
+ @Column({ type: 'time', nullable: true })
86
+ departure_time: string;
87
+
88
+ // 7. Duration of Days (M)
80
89
  @Column({ type: 'int', nullable: false })
81
90
  duration_of_days: number;
82
91
 
83
- // 6. Travel Details (From – To)
92
+ // 8. Travel Details (From – To)
84
93
  @Column({ type: 'varchar', length: 255, nullable: false })
85
94
  travel_from: string;
86
95
 
87
96
  @Column({ type: 'varchar', length: 255, nullable: false })
88
97
  travel_to: string;
89
98
 
90
- // 7. Time of arrival (M)
99
+ // 9. Time of arrival (M)
91
100
  @Column({ type: 'time', nullable: false })
92
101
  time_of_arrival: string; // Format: HH:MM
93
102
 
94
- // 8. Travelling from which region (M)
103
+ // 10. Travelling from which region (M)
95
104
  @Column({ type: 'varchar', length: 255, nullable: false })
96
105
  travelling_from_region: string;
97
106
 
98
- // 9. No. of employees travelling (M)
107
+ // 11. No. of employees travelling (M)
99
108
  @Column({ type: 'int', nullable: false })
100
109
  number_of_employees_travelling: number;
101
110
 
102
- // 10. Details of employee Emp id / Name / Designation/ Grade/ Contact Number
111
+ // 12. Details of employee Emp id / Name / Designation / Grade / Contact Number
103
112
  @Column({ type: 'json', nullable: false })
104
113
  employee_details: Array<{
105
114
  employee_id: string;
106
115
  employee_name: string;
107
116
  designation: string;
108
- grade: string;
117
+ grade?: string | null;
109
118
  contact_number: string;
110
119
  }>;
111
120
 
@@ -1,65 +1,65 @@
1
- import { Column, Entity, JoinColumn, ManyToOne } from "typeorm";
2
- import { BaseModel } from "./BaseModel";
3
- import { AnnualIncrementRequest } from "./AnnualIncrementRequestModel";
4
-
5
- @Entity({ name: "annual_increment_request_employees" })
6
- export class AnnualIncrementRequestEmployee extends BaseModel {
7
- @Column({ type: "integer", nullable: false })
8
- request_id: number;
9
-
10
- @Column({ type: "integer", nullable: true })
11
- service_id: number | null;
12
-
13
- @Column({ type: "integer", nullable: true })
14
- sub_service_id: number | null;
15
-
16
- @Column({ type: "varchar", length: 255, nullable: false })
17
- employee_name: string;
18
-
19
- @Column({ type: "varchar", length: 100, nullable: false })
20
- employee_id: string;
21
-
22
- @Column({ type: "integer", nullable: false })
23
- allowance_year: number;
24
-
25
- @Column({ type: "date", nullable: false })
26
- effective_date: Date;
27
-
28
- @Column({ type: "decimal", precision: 10, scale: 3, nullable: true })
29
- current_basic_salary: number | null;
30
-
31
- @Column({ type: "decimal", precision: 5, scale: 2, nullable: true })
32
- increment_percentage: number | null;
33
-
34
- @Column({ type: "decimal", precision: 10, scale: 3, nullable: true })
35
- new_basic_salary: number | null;
36
-
37
- @ManyToOne(() => AnnualIncrementRequest, { onDelete: "CASCADE" })
38
- @JoinColumn({ name: "request_id", referencedColumnName: "id" })
39
- request: AnnualIncrementRequest;
40
-
41
- constructor(
42
- request_id: number,
43
- employee_name: string,
44
- employee_id: string,
45
- allowance_year: number,
46
- effective_date: Date,
47
- service_id?: number | null,
48
- sub_service_id?: number | null,
49
- current_basic_salary?: number | null,
50
- increment_percentage?: number | null,
51
- new_basic_salary?: number | null
52
- ) {
53
- super();
54
- this.request_id = request_id;
55
- this.service_id = service_id ?? null;
56
- this.sub_service_id = sub_service_id ?? null;
57
- this.employee_name = employee_name;
58
- this.employee_id = employee_id;
59
- this.allowance_year = allowance_year;
60
- this.effective_date = effective_date;
61
- this.current_basic_salary = current_basic_salary ?? null;
62
- this.increment_percentage = increment_percentage ?? null;
63
- this.new_basic_salary = new_basic_salary ?? null;
64
- }
65
- }
1
+ import { Column, Entity, JoinColumn, ManyToOne } from "typeorm";
2
+ import { BaseModel } from "./BaseModel";
3
+ import { AnnualIncrementRequest } from "./AnnualIncrementRequestModel";
4
+
5
+ @Entity({ name: "annual_increment_request_employees" })
6
+ export class AnnualIncrementRequestEmployee extends BaseModel {
7
+ @Column({ type: "integer", nullable: false })
8
+ request_id: number;
9
+
10
+ @Column({ type: "integer", nullable: true })
11
+ service_id: number | null;
12
+
13
+ @Column({ type: "integer", nullable: true })
14
+ sub_service_id: number | null;
15
+
16
+ @Column({ type: "varchar", length: 255, nullable: false })
17
+ employee_name: string;
18
+
19
+ @Column({ type: "varchar", length: 100, nullable: false })
20
+ employee_id: string;
21
+
22
+ @Column({ type: "integer", nullable: false })
23
+ allowance_year: number;
24
+
25
+ @Column({ type: "date", nullable: false })
26
+ effective_date: Date;
27
+
28
+ @Column({ type: "decimal", precision: 10, scale: 3, nullable: true })
29
+ current_basic_salary: number | null;
30
+
31
+ @Column({ type: "decimal", precision: 5, scale: 2, nullable: true })
32
+ increment_percentage: number | null;
33
+
34
+ @Column({ type: "decimal", precision: 10, scale: 3, nullable: true })
35
+ new_basic_salary: number | null;
36
+
37
+ @ManyToOne(() => AnnualIncrementRequest, { onDelete: "CASCADE" })
38
+ @JoinColumn({ name: "request_id", referencedColumnName: "id" })
39
+ request: AnnualIncrementRequest;
40
+
41
+ constructor(
42
+ request_id: number,
43
+ employee_name: string,
44
+ employee_id: string,
45
+ allowance_year: number,
46
+ effective_date: Date,
47
+ service_id?: number | null,
48
+ sub_service_id?: number | null,
49
+ current_basic_salary?: number | null,
50
+ increment_percentage?: number | null,
51
+ new_basic_salary?: number | null
52
+ ) {
53
+ super();
54
+ this.request_id = request_id;
55
+ this.service_id = service_id ?? null;
56
+ this.sub_service_id = sub_service_id ?? null;
57
+ this.employee_name = employee_name;
58
+ this.employee_id = employee_id;
59
+ this.allowance_year = allowance_year;
60
+ this.effective_date = effective_date;
61
+ this.current_basic_salary = current_basic_salary ?? null;
62
+ this.increment_percentage = increment_percentage ?? null;
63
+ this.new_basic_salary = new_basic_salary ?? null;
64
+ }
65
+ }
@@ -45,24 +45,24 @@ export class AnnualIncrementRequest extends BaseModel {
45
45
  @Column({ type: "timestamp", nullable: true })
46
46
  assigned_at: Date | null;
47
47
 
48
- @Column({ type: "varchar", length: 255, nullable: true })
49
- workflow_execution_id: string | null;
50
-
51
- @Column({ type: "varchar", length: 255, nullable: true })
52
- reference_number: string | null;
53
-
48
+ @Column({ type: "varchar", length: 255, nullable: true })
49
+ workflow_execution_id: string | null;
50
+
51
+ @Column({ type: "varchar", length: 255, nullable: true })
52
+ reference_number: string | null;
53
+
54
54
  // Annual Increment specific fields
55
- @Column({ type: "varchar", length: 255, nullable: true })
56
- employee_name: string | null;
57
-
58
- @Column({ type: "varchar", length: 100, nullable: true })
59
- employee_id: string | null;
60
-
61
- @Column({ type: "integer", nullable: true })
62
- allowance_year: number | null;
63
-
64
- @Column({ type: "date", nullable: true })
65
- effective_date: Date | null;
55
+ @Column({ type: "varchar", length: 255, nullable: true })
56
+ employee_name: string | null;
57
+
58
+ @Column({ type: "varchar", length: 100, nullable: true })
59
+ employee_id: string | null;
60
+
61
+ @Column({ type: "integer", nullable: true })
62
+ allowance_year: number | null;
63
+
64
+ @Column({ type: "date", nullable: true })
65
+ effective_date: Date | null;
66
66
 
67
67
  @Column({ type: "decimal", precision: 10, scale: 3, nullable: true })
68
68
  current_basic_salary: number | null;
@@ -104,14 +104,14 @@ export class AnnualIncrementRequest extends BaseModel {
104
104
  this.req_user_position_id = req_user_position_id || null;
105
105
  this.description = description || null;
106
106
  this.reviewer_user_id = reviewer_user_id || null;
107
- this.assigned_to_user_id = assigned_to_user_id || null;
108
- this.assigned_at = assigned_at || null;
109
- this.workflow_execution_id = workflow_execution_id || null;
110
- this.reference_number = null;
111
- this.employee_name = employee_name || null;
112
- this.employee_id = employee_id || null;
113
- this.allowance_year = allowance_year || null;
114
- this.effective_date = effective_date || null;
107
+ this.assigned_to_user_id = assigned_to_user_id || null;
108
+ this.assigned_at = assigned_at || null;
109
+ this.workflow_execution_id = workflow_execution_id || null;
110
+ this.reference_number = null;
111
+ this.employee_name = employee_name || null;
112
+ this.employee_id = employee_id || null;
113
+ this.allowance_year = allowance_year || null;
114
+ this.effective_date = effective_date || null;
115
115
  this.current_basic_salary = current_basic_salary || null;
116
116
  this.increment_percentage = increment_percentage || null;
117
117
  this.new_basic_salary = new_basic_salary || null;