@platform-modules/foreign-ministry 1.0.8 → 1.0.9

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.
@@ -11,6 +11,10 @@ const role_1 = require("./models/role");
11
11
  const LeaveRequestModel_1 = require("./models/LeaveRequestModel");
12
12
  const LeaveTypesModel_1 = require("./models/LeaveTypesModel");
13
13
  const FinancialGradeModel_1 = require("./models/FinancialGradeModel");
14
+ const HajjLeaveDatesModel_1 = require("./models/HajjLeaveDatesModel");
15
+ const StudyLeaveDegreesModel_1 = require("./models/StudyLeaveDegreesModel");
16
+ const UnpaidLeaveCatgoriesModel_1 = require("./models/UnpaidLeaveCatgoriesModel");
17
+ const MounringLeaveRelationModel_1 = require("./models/MounringLeaveRelationModel");
14
18
  exports.AppDataSource = new typeorm_1.DataSource({
15
19
  type: 'postgres',
16
20
  host: process.env.DB_HOST || 'localhost',
@@ -20,5 +24,5 @@ exports.AppDataSource = new typeorm_1.DataSource({
20
24
  database: process.env.DB_NAME || 'common_models',
21
25
  synchronize: true, // auto-create tables (disable in prod)
22
26
  logging: false,
23
- entities: [user_1.User, user_sessions_1.userSessions, role_1.Role, LeaveRequestModel_1.LeaveRequests, LeaveTypesModel_1.LeaveTypes, FinancialGradeModel_1.FinancialGrade],
27
+ 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],
24
28
  });
package/dist/index.d.ts CHANGED
@@ -4,3 +4,6 @@ export * from './models/user-sessions';
4
4
  export * from './models/LeaveRequestModel';
5
5
  export * from './models/LeaveTypesModel';
6
6
  export * from './models/FinancialGradeModel';
7
+ export * from './models/HajjLeaveDatesModel';
8
+ export * from './models/StudyLeaveDegreesModel';
9
+ export * from './models/UnpaidLeaveCatgoriesModel';
package/dist/index.js CHANGED
@@ -20,3 +20,6 @@ __exportStar(require("./models/user-sessions"), exports);
20
20
  __exportStar(require("./models/LeaveRequestModel"), exports);
21
21
  __exportStar(require("./models/LeaveTypesModel"), exports);
22
22
  __exportStar(require("./models/FinancialGradeModel"), exports);
23
+ __exportStar(require("./models/HajjLeaveDatesModel"), exports);
24
+ __exportStar(require("./models/StudyLeaveDegreesModel"), exports);
25
+ __exportStar(require("./models/UnpaidLeaveCatgoriesModel"), exports);
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.FinancialGrade = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const BaseModel_1 = require("./BaseModel");
15
+ //This model is used to store the Financial Grade declaration on the Admin Side
15
16
  let FinancialGrade = class FinancialGrade extends BaseModel_1.BaseModel {
16
17
  constructor(diplomatic_title, financial_grade, annual_leave) {
17
18
  super();
@@ -0,0 +1,5 @@
1
+ import { BaseModel } from './BaseModel';
2
+ export declare class HajjLeaveDates extends BaseModel {
3
+ Hajj_Leave_Start_Date: Date;
4
+ Hajj_Leave_End_Date: Date;
5
+ }
@@ -0,0 +1,29 @@
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.HajjLeaveDates = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ //This model is used to store the Hajj Leave Dates declaration on the Admin Side
16
+ let HajjLeaveDates = class HajjLeaveDates extends BaseModel_1.BaseModel {
17
+ };
18
+ exports.HajjLeaveDates = HajjLeaveDates;
19
+ __decorate([
20
+ (0, typeorm_1.Column)({ type: 'date', nullable: false }),
21
+ __metadata("design:type", Date)
22
+ ], HajjLeaveDates.prototype, "Hajj_Leave_Start_Date", void 0);
23
+ __decorate([
24
+ (0, typeorm_1.Column)({ type: 'date', nullable: false }),
25
+ __metadata("design:type", Date)
26
+ ], HajjLeaveDates.prototype, "Hajj_Leave_End_Date", void 0);
27
+ exports.HajjLeaveDates = HajjLeaveDates = __decorate([
28
+ (0, typeorm_1.Entity)({ name: 'Hajj_Leave_Dates' })
29
+ ], HajjLeaveDates);
@@ -1,4 +1,8 @@
1
1
  import { BaseModel } from './BaseModel';
2
+ export declare enum Leave_For {
3
+ SELF = "Self",
4
+ BEHALFOF = "Behalf of"
5
+ }
2
6
  export declare enum status {
3
7
  PENDING = "Pending",
4
8
  APPROVED = "Approved",
@@ -6,6 +10,7 @@ export declare enum status {
6
10
  }
7
11
  export declare class LeaveRequests extends BaseModel {
8
12
  User_Id: string;
13
+ Leave_For: Leave_For;
9
14
  Leave_Type: number;
10
15
  Department: string;
11
16
  Status: status;
@@ -27,4 +32,5 @@ export declare class LeaveRequests extends BaseModel {
27
32
  Representation: string;
28
33
  Activity_Title: string;
29
34
  Relationship: string;
35
+ Mounring_Leave_Relation: number;
30
36
  }
@@ -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.LeaveRequests = exports.status = void 0;
12
+ exports.LeaveRequests = exports.status = exports.Leave_For = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const BaseModel_1 = require("./BaseModel");
15
+ //This model is used to store the Leave Request
16
+ var Leave_For;
17
+ (function (Leave_For) {
18
+ Leave_For["SELF"] = "Self";
19
+ Leave_For["BEHALFOF"] = "Behalf of";
20
+ })(Leave_For || (exports.Leave_For = Leave_For = {}));
15
21
  var status;
16
22
  (function (status) {
17
23
  status["PENDING"] = "Pending";
@@ -25,6 +31,10 @@ __decorate([
25
31
  (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
26
32
  __metadata("design:type", String)
27
33
  ], LeaveRequests.prototype, "User_Id", void 0);
34
+ __decorate([
35
+ (0, typeorm_1.Column)({ type: "enum", enum: Leave_For, default: Leave_For.SELF, nullable: true }),
36
+ __metadata("design:type", String)
37
+ ], LeaveRequests.prototype, "Leave_For", void 0);
28
38
  __decorate([
29
39
  (0, typeorm_1.Column)({ type: 'int', nullable: true }),
30
40
  __metadata("design:type", Number)
@@ -109,6 +119,10 @@ __decorate([
109
119
  (0, typeorm_1.Column)({ type: 'varchar', length: 50, nullable: true }),
110
120
  __metadata("design:type", String)
111
121
  ], LeaveRequests.prototype, "Relationship", void 0);
122
+ __decorate([
123
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
124
+ __metadata("design:type", Number)
125
+ ], LeaveRequests.prototype, "Mounring_Leave_Relation", void 0);
112
126
  exports.LeaveRequests = LeaveRequests = __decorate([
113
127
  (0, typeorm_1.Entity)({ name: 'LeaveRequests' })
114
128
  ], LeaveRequests);
@@ -0,0 +1,4 @@
1
+ import { BaseModel } from './BaseModel';
2
+ export declare class MounringLeaveRelations extends BaseModel {
3
+ Mounring_Leave_Relation: string;
4
+ }
@@ -0,0 +1,24 @@
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.MounringLeaveRelations = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ let MounringLeaveRelations = class MounringLeaveRelations extends BaseModel_1.BaseModel {
16
+ };
17
+ exports.MounringLeaveRelations = MounringLeaveRelations;
18
+ __decorate([
19
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: false }),
20
+ __metadata("design:type", String)
21
+ ], MounringLeaveRelations.prototype, "Mounring_Leave_Relation", void 0);
22
+ exports.MounringLeaveRelations = MounringLeaveRelations = __decorate([
23
+ (0, typeorm_1.Entity)({ name: 'Mounring_Leave_Relations' })
24
+ ], MounringLeaveRelations);
@@ -0,0 +1,4 @@
1
+ import { BaseModel } from './BaseModel';
2
+ export declare class StudyLeaveDegrees extends BaseModel {
3
+ Study_Leave_Degree: string;
4
+ }
@@ -0,0 +1,25 @@
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.StudyLeaveDegrees = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ //This model is used to store the Study Leave Degrees Master Data
16
+ let StudyLeaveDegrees = class StudyLeaveDegrees extends BaseModel_1.BaseModel {
17
+ };
18
+ exports.StudyLeaveDegrees = StudyLeaveDegrees;
19
+ __decorate([
20
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: false }),
21
+ __metadata("design:type", String)
22
+ ], StudyLeaveDegrees.prototype, "Study_Leave_Degree", void 0);
23
+ exports.StudyLeaveDegrees = StudyLeaveDegrees = __decorate([
24
+ (0, typeorm_1.Entity)({ name: 'Study_Leave_Degrees' })
25
+ ], StudyLeaveDegrees);
@@ -0,0 +1,4 @@
1
+ import { BaseModel } from './BaseModel';
2
+ export declare class UnpaidLeaveCategories extends BaseModel {
3
+ Unpaid_Leave_Category: string;
4
+ }
@@ -0,0 +1,25 @@
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.UnpaidLeaveCategories = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ //This model is used to store the Unpaid Leave Categories Master Data
16
+ let UnpaidLeaveCategories = class UnpaidLeaveCategories extends BaseModel_1.BaseModel {
17
+ };
18
+ exports.UnpaidLeaveCategories = UnpaidLeaveCategories;
19
+ __decorate([
20
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: false }),
21
+ __metadata("design:type", String)
22
+ ], UnpaidLeaveCategories.prototype, "Unpaid_Leave_Category", void 0);
23
+ exports.UnpaidLeaveCategories = UnpaidLeaveCategories = __decorate([
24
+ (0, typeorm_1.Entity)({ name: 'Unpaid_Leave_Categories' })
25
+ ], UnpaidLeaveCategories);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platform-modules/foreign-ministry",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -8,6 +8,11 @@ import { Role } from './models/role';
8
8
  import { LeaveRequests } from './models/LeaveRequestModel';
9
9
  import { LeaveTypes } from './models/LeaveTypesModel';
10
10
  import { FinancialGrade } from './models/FinancialGradeModel';
11
+ import { HajjLeaveDates } from './models/HajjLeaveDatesModel';
12
+ import { StudyLeaveDegrees } from './models/StudyLeaveDegreesModel';
13
+ import { UnpaidLeaveCategories } from './models/UnpaidLeaveCatgoriesModel';
14
+ import { MounringLeaveRelations } from './models/MounringLeaveRelationModel';
15
+
11
16
 
12
17
  export const AppDataSource = new DataSource({
13
18
  type: 'postgres',
@@ -18,5 +23,5 @@ export const AppDataSource = new DataSource({
18
23
  database: process.env.DB_NAME || 'common_models',
19
24
  synchronize: true, // auto-create tables (disable in prod)
20
25
  logging: false,
21
- entities: [User,userSessions,Role,LeaveRequests,LeaveTypes,FinancialGrade],
26
+ entities: [User,userSessions,Role,LeaveRequests,LeaveTypes,FinancialGrade,HajjLeaveDates,StudyLeaveDegrees,UnpaidLeaveCategories,MounringLeaveRelations],
22
27
  });
package/src/index.ts CHANGED
@@ -3,4 +3,7 @@ export * from './models/role';
3
3
  export * from './models/user-sessions';
4
4
  export * from './models/LeaveRequestModel';
5
5
  export * from './models/LeaveTypesModel';
6
- export * from './models/FinancialGradeModel';
6
+ export * from './models/FinancialGradeModel';
7
+ export * from './models/HajjLeaveDatesModel';
8
+ export * from './models/StudyLeaveDegreesModel';
9
+ export * from './models/UnpaidLeaveCatgoriesModel';
@@ -1,6 +1,6 @@
1
1
  import { Column, Entity } from "typeorm";
2
2
  import { BaseModel } from './BaseModel';
3
-
3
+ //This model is used to store the Financial Grade declaration on the Admin Side
4
4
  @Entity({ name: 'Financial_Grade' })
5
5
  export class FinancialGrade extends BaseModel {
6
6
 
@@ -0,0 +1,11 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+ //This model is used to store the Hajj Leave Dates declaration on the Admin Side
4
+ @Entity({ name: 'Hajj_Leave_Dates' })
5
+ export class HajjLeaveDates extends BaseModel {
6
+ @Column({ type: 'date', nullable: false })
7
+ Hajj_Leave_Start_Date: Date;
8
+
9
+ @Column({ type: 'date', nullable: false })
10
+ Hajj_Leave_End_Date: Date;
11
+ }
@@ -1,5 +1,10 @@
1
1
  import { Column, Entity } from "typeorm";
2
2
  import { BaseModel } from './BaseModel';
3
+ //This model is used to store the Leave Request
4
+ export enum Leave_For {
5
+ SELF = "Self",
6
+ BEHALFOF = "Behalf of"
7
+ }
3
8
 
4
9
  export enum status {
5
10
  PENDING = "Pending",
@@ -11,6 +16,9 @@ export class LeaveRequests extends BaseModel {
11
16
  @Column({ type: 'varchar', length: 100, nullable: true })
12
17
  User_Id: string;
13
18
 
19
+ @Column({ type: "enum", enum: Leave_For, default: Leave_For.SELF, nullable: true })
20
+ Leave_For: Leave_For;
21
+
14
22
  @Column({ type: 'int', nullable: true })
15
23
  Leave_Type: number;
16
24
 
@@ -73,4 +81,7 @@ export class LeaveRequests extends BaseModel {
73
81
 
74
82
  @Column({ type: 'varchar', length: 50, nullable: true })
75
83
  Relationship: string;
84
+
85
+ @Column({ type: 'int', nullable: true })
86
+ Mounring_Leave_Relation: number;
76
87
  }
@@ -0,0 +1,9 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ @Entity({ name: 'Mounring_Leave_Relations' })
5
+
6
+ export class MounringLeaveRelations extends BaseModel {
7
+ @Column({ type: 'varchar', length: 100, nullable: false })
8
+ Mounring_Leave_Relation: string;
9
+ }
@@ -0,0 +1,8 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+ //This model is used to store the Study Leave Degrees Master Data
4
+ @Entity({ name: 'Study_Leave_Degrees' })
5
+ export class StudyLeaveDegrees extends BaseModel {
6
+ @Column({ type: 'varchar', length: 100, nullable: false })
7
+ Study_Leave_Degree: string;
8
+ }
@@ -0,0 +1,8 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+ //This model is used to store the Unpaid Leave Categories Master Data
4
+ @Entity({ name: 'Unpaid_Leave_Categories' })
5
+ export class UnpaidLeaveCategories extends BaseModel {
6
+ @Column({ type: 'varchar', length: 100, nullable: false })
7
+ Unpaid_Leave_Category: string;
8
+ }
package/tsconfig.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "target": "ES2020",
3
+ "target": "ES2022",
4
4
  "module": "CommonJS",
5
5
  "declaration": true,
6
6
  "outDir": "./dist",
@@ -9,7 +9,8 @@
9
9
  "skipLibCheck": true,
10
10
  "strictPropertyInitialization": false,
11
11
  "experimentalDecorators": true,
12
- "emitDecoratorMetadata": true
12
+ "emitDecoratorMetadata": true,
13
+ "useDefineForClassFields": false
13
14
  },
14
15
  "include": ["src"],
15
16
  "exclude": ["node_modules", "dist"]