@platform-modules/foreign-ministry 1.0.1 → 1.0.3

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/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
1
  export * from './models/user';
2
2
  export * from './models/role';
3
3
  export * from './models/user-sessions';
4
+ export * from './models/LeaveRequestModel';
5
+ export * from './models/LeaveTypesModel';
package/dist/index.js CHANGED
@@ -17,3 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./models/user"), exports);
18
18
  __exportStar(require("./models/role"), exports);
19
19
  __exportStar(require("./models/user-sessions"), exports);
20
+ __exportStar(require("./models/LeaveRequestModel"), exports);
21
+ __exportStar(require("./models/LeaveTypesModel"), exports);
@@ -1,23 +1,30 @@
1
1
  import { BaseModel } from './BaseModel';
2
- export declare enum ContactFor {
3
- SELF = "Self",
4
- BEHALFOF = "Behalf of"
5
- }
6
2
  export declare enum status {
7
3
  PENDING = "Pending",
8
4
  APPROVED = "Approved",
9
5
  REJECTED = "Rejected"
10
6
  }
11
7
  export declare class LeaveRequests extends BaseModel {
12
- department: string;
13
- leave_type: string;
14
- reason: string;
15
- request_for: ContactFor;
16
- description: string;
17
- from_date: Date;
18
- to_date: Date;
19
- user_id: number;
20
- reporting_manager: number;
21
- status: status;
22
- constructor(department: string, leave_type: string, reason: string, request_for: ContactFor, description: string, from_date: Date, to_date: Date, reporting_manager: number, status: status);
8
+ User_Id: string;
9
+ Leave_Type: number;
10
+ Department: string;
11
+ Status: status;
12
+ Leave_Start_Date: Date;
13
+ Leave_End_Date: Date;
14
+ Leave_Duration: number;
15
+ Remaining_Leave_Balance: number;
16
+ Contact_Number_During_Leave: string;
17
+ Address_During_Leave: string;
18
+ Notes: string;
19
+ Delegated_To: string;
20
+ Number_Of_Escort_Instances_Per_Year: number;
21
+ Accompanying_The_Patient: boolean;
22
+ Treatment_Place: string;
23
+ Emergency_Leaves_Available: number;
24
+ Unpaid_Leave_Type: string;
25
+ Country_Or_State_Being_Visited: string;
26
+ Leave_Balance_Summary: string;
27
+ Representation: string;
28
+ Activity_Title: string;
29
+ Relationship: string;
23
30
  }
@@ -9,14 +9,9 @@ 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 = exports.ContactFor = void 0;
12
+ exports.LeaveRequests = exports.status = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const BaseModel_1 = require("./BaseModel");
15
- var ContactFor;
16
- (function (ContactFor) {
17
- ContactFor["SELF"] = "Self";
18
- ContactFor["BEHALFOF"] = "Behalf of";
19
- })(ContactFor || (exports.ContactFor = ContactFor = {}));
20
15
  var status;
21
16
  (function (status) {
22
17
  status["PENDING"] = "Pending";
@@ -24,72 +19,96 @@ var status;
24
19
  status["REJECTED"] = "Rejected";
25
20
  })(status || (exports.status = status = {}));
26
21
  let LeaveRequests = class LeaveRequests extends BaseModel_1.BaseModel {
27
- constructor(department, leave_type, reason, request_for, description, from_date, to_date, reporting_manager, status) {
28
- super();
29
- this.department = department,
30
- this.leave_type = leave_type,
31
- this.reason = reason,
32
- this.request_for = request_for,
33
- this.description = description,
34
- this.from_date = from_date,
35
- this.to_date = to_date,
36
- this.reporting_manager = reporting_manager,
37
- this.status = status;
38
- }
39
22
  };
40
23
  exports.LeaveRequests = LeaveRequests;
41
24
  __decorate([
42
- (0, typeorm_1.Column)({ nullable: false }),
25
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
43
26
  __metadata("design:type", String)
44
- ], LeaveRequests.prototype, "department", void 0);
27
+ ], LeaveRequests.prototype, "User_Id", void 0);
45
28
  __decorate([
46
- (0, typeorm_1.Column)({ nullable: false }),
47
- __metadata("design:type", String)
48
- ], LeaveRequests.prototype, "leave_type", void 0);
29
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
30
+ __metadata("design:type", Number)
31
+ ], LeaveRequests.prototype, "Leave_Type", void 0);
49
32
  __decorate([
50
- (0, typeorm_1.Column)({ nullable: false }),
33
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
51
34
  __metadata("design:type", String)
52
- ], LeaveRequests.prototype, "reason", void 0);
53
- __decorate([
54
- (0, typeorm_1.Column)({
55
- type: "enum",
56
- enum: ContactFor,
57
- default: ContactFor.SELF,
58
- nullable: false,
59
- }),
60
- __metadata("design:type", String)
61
- ], LeaveRequests.prototype, "request_for", void 0);
35
+ ], LeaveRequests.prototype, "Department", void 0);
62
36
  __decorate([
63
- (0, typeorm_1.Column)({ nullable: false }),
37
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: false }),
64
38
  __metadata("design:type", String)
65
- ], LeaveRequests.prototype, "description", void 0);
39
+ ], LeaveRequests.prototype, "Status", void 0);
66
40
  __decorate([
67
- (0, typeorm_1.Column)({ type: "date", nullable: false }),
41
+ (0, typeorm_1.Column)({ type: 'date', nullable: true }),
68
42
  __metadata("design:type", Date)
69
- ], LeaveRequests.prototype, "from_date", void 0);
43
+ ], LeaveRequests.prototype, "Leave_Start_Date", void 0);
70
44
  __decorate([
71
- (0, typeorm_1.Column)({ type: "date", nullable: false }),
45
+ (0, typeorm_1.Column)({ type: 'date', nullable: true }),
72
46
  __metadata("design:type", Date)
73
- ], LeaveRequests.prototype, "to_date", void 0);
47
+ ], LeaveRequests.prototype, "Leave_End_Date", void 0);
74
48
  __decorate([
75
- (0, typeorm_1.Column)({ nullable: false }),
49
+ (0, typeorm_1.Column)({ type: 'float', nullable: true }),
76
50
  __metadata("design:type", Number)
77
- ], LeaveRequests.prototype, "user_id", void 0);
51
+ ], LeaveRequests.prototype, "Leave_Duration", void 0);
78
52
  __decorate([
79
- (0, typeorm_1.Column)({ nullable: true }),
53
+ (0, typeorm_1.Column)({ type: 'float', nullable: true }),
80
54
  __metadata("design:type", Number)
81
- ], LeaveRequests.prototype, "reporting_manager", void 0);
82
- __decorate([
83
- (0, typeorm_1.Column)({
84
- type: "enum",
85
- enum: status,
86
- default: status.PENDING,
87
- nullable: false,
88
- }),
55
+ ], LeaveRequests.prototype, "Remaining_Leave_Balance", void 0);
56
+ __decorate([
57
+ (0, typeorm_1.Column)({ type: 'varchar', length: 20, nullable: false }),
58
+ __metadata("design:type", String)
59
+ ], LeaveRequests.prototype, "Contact_Number_During_Leave", void 0);
60
+ __decorate([
61
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
62
+ __metadata("design:type", String)
63
+ ], LeaveRequests.prototype, "Address_During_Leave", void 0);
64
+ __decorate([
65
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
66
+ __metadata("design:type", String)
67
+ ], LeaveRequests.prototype, "Notes", void 0);
68
+ __decorate([
69
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
70
+ __metadata("design:type", String)
71
+ ], LeaveRequests.prototype, "Delegated_To", void 0);
72
+ __decorate([
73
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
74
+ __metadata("design:type", Number)
75
+ ], LeaveRequests.prototype, "Number_Of_Escort_Instances_Per_Year", void 0);
76
+ __decorate([
77
+ (0, typeorm_1.Column)({ type: 'boolean', nullable: true }),
78
+ __metadata("design:type", Boolean)
79
+ ], LeaveRequests.prototype, "Accompanying_The_Patient", void 0);
80
+ __decorate([
81
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
82
+ __metadata("design:type", String)
83
+ ], LeaveRequests.prototype, "Treatment_Place", void 0);
84
+ __decorate([
85
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
86
+ __metadata("design:type", Number)
87
+ ], LeaveRequests.prototype, "Emergency_Leaves_Available", void 0);
88
+ __decorate([
89
+ (0, typeorm_1.Column)({ type: 'varchar', length: 50, nullable: true }),
90
+ __metadata("design:type", String)
91
+ ], LeaveRequests.prototype, "Unpaid_Leave_Type", void 0);
92
+ __decorate([
93
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
94
+ __metadata("design:type", String)
95
+ ], LeaveRequests.prototype, "Country_Or_State_Being_Visited", void 0);
96
+ __decorate([
97
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
98
+ __metadata("design:type", String)
99
+ ], LeaveRequests.prototype, "Leave_Balance_Summary", void 0);
100
+ __decorate([
101
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
102
+ __metadata("design:type", String)
103
+ ], LeaveRequests.prototype, "Representation", void 0);
104
+ __decorate([
105
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
106
+ __metadata("design:type", String)
107
+ ], LeaveRequests.prototype, "Activity_Title", void 0);
108
+ __decorate([
109
+ (0, typeorm_1.Column)({ type: 'varchar', length: 50, nullable: true }),
89
110
  __metadata("design:type", String)
90
- ], LeaveRequests.prototype, "status", void 0);
111
+ ], LeaveRequests.prototype, "Relationship", void 0);
91
112
  exports.LeaveRequests = LeaveRequests = __decorate([
92
- (0, typeorm_1.Entity)({ name: 'LeaveRequests' }),
93
- __metadata("design:paramtypes", [String, String, String, String, String, Date,
94
- Date, Number, String])
113
+ (0, typeorm_1.Entity)({ name: 'LeaveRequests' })
95
114
  ], LeaveRequests);
@@ -1,7 +1,6 @@
1
1
  import { BaseModel } from './BaseModel';
2
2
  export declare class LeaveTypes extends BaseModel {
3
3
  name: string;
4
- nameinEnglish: string;
5
- nameinArabic: string;
6
- constructor(name: string, nameinEnglish: string, nameinArabic: string);
4
+ name_in_Arabic: string;
5
+ constructor(name: string, name_in_Arabic: string);
7
6
  }
@@ -13,11 +13,10 @@ exports.LeaveTypes = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const BaseModel_1 = require("./BaseModel");
15
15
  let LeaveTypes = class LeaveTypes extends BaseModel_1.BaseModel {
16
- constructor(name, nameinEnglish, nameinArabic) {
16
+ constructor(name, name_in_Arabic) {
17
17
  super();
18
18
  this.name = name;
19
- this.nameinEnglish = nameinEnglish,
20
- this.nameinArabic = nameinArabic;
19
+ this.name_in_Arabic = name_in_Arabic;
21
20
  }
22
21
  };
23
22
  exports.LeaveTypes = LeaveTypes;
@@ -28,12 +27,8 @@ __decorate([
28
27
  __decorate([
29
28
  (0, typeorm_1.Column)({ nullable: false }),
30
29
  __metadata("design:type", String)
31
- ], LeaveTypes.prototype, "nameinEnglish", void 0);
32
- __decorate([
33
- (0, typeorm_1.Column)({ nullable: false }),
34
- __metadata("design:type", String)
35
- ], LeaveTypes.prototype, "nameinArabic", void 0);
30
+ ], LeaveTypes.prototype, "name_in_Arabic", void 0);
36
31
  exports.LeaveTypes = LeaveTypes = __decorate([
37
32
  (0, typeorm_1.Entity)({ name: 'Leave_Types' }),
38
- __metadata("design:paramtypes", [String, String, String])
33
+ __metadata("design:paramtypes", [String, String])
39
34
  ], LeaveTypes);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platform-modules/foreign-ministry",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -1,3 +1,5 @@
1
1
  export * from './models/user';
2
2
  export * from './models/role';
3
- export * from './models/user-sessions';
3
+ export * from './models/user-sessions';
4
+ export * from './models/LeaveRequestModel';
5
+ export * from './models/LeaveTypesModel';
@@ -1,9 +1,6 @@
1
1
  import { Column, Entity } from "typeorm";
2
2
  import { BaseModel } from './BaseModel';
3
- export enum ContactFor {
4
- SELF = "Self",
5
- BEHALFOF = "Behalf of"
6
- }
3
+
7
4
  export enum status {
8
5
  PENDING = "Pending",
9
6
  APPROVED = "Approved",
@@ -11,67 +8,69 @@ export enum status {
11
8
  }
12
9
  @Entity({ name: 'LeaveRequests' })
13
10
  export class LeaveRequests extends BaseModel {
11
+ @Column({ type: 'varchar', length: 100, nullable: true })
12
+ User_Id: string;
13
+
14
+ @Column({ type: 'int', nullable: true })
15
+ Leave_Type: number;
16
+
17
+ @Column({ type: 'varchar', length: 100, nullable: true })
18
+ Department: string;
19
+
20
+ @Column({ type: 'varchar', length: 100, nullable: false })
21
+ Status: status;
22
+
23
+ @Column({ type: 'date', nullable: true })
24
+ Leave_Start_Date: Date;
25
+
26
+ @Column({ type: 'date', nullable: true })
27
+ Leave_End_Date: Date;
28
+
29
+ @Column({ type: 'float', nullable: true })
30
+ Leave_Duration: number;
31
+
32
+ @Column({ type: 'float', nullable: true })
33
+ Remaining_Leave_Balance: number;
34
+
35
+ @Column({ type: 'varchar', length: 20, nullable: false })
36
+ Contact_Number_During_Leave: string;
37
+
38
+ @Column({ type: 'varchar', length: 255, nullable: true })
39
+ Address_During_Leave: string;
40
+
41
+ @Column({ type: 'text', nullable: true })
42
+ Notes: string;
43
+
44
+ @Column({ type: 'varchar', length: 100, nullable: true })
45
+ Delegated_To: string;
46
+
47
+ @Column({ type: 'int', nullable: true })
48
+ Number_Of_Escort_Instances_Per_Year: number;
49
+
50
+ @Column({ type: 'boolean', nullable: true })
51
+ Accompanying_The_Patient: boolean;
52
+
53
+ @Column({ type: 'varchar', length: 255, nullable: true })
54
+ Treatment_Place: string;
55
+
56
+ @Column({ type: 'int', nullable: true })
57
+ Emergency_Leaves_Available: number;
58
+
59
+ @Column({ type: 'varchar', length: 50, nullable: true })
60
+ Unpaid_Leave_Type: string;
61
+
62
+ @Column({ type: 'varchar', length: 100, nullable: true })
63
+ Country_Or_State_Being_Visited: string;
64
+
65
+ @Column({ type: 'text', nullable: true })
66
+ Leave_Balance_Summary: string;
67
+
68
+ @Column({ type: 'varchar', length: 100, nullable: true })
69
+ Representation: string;
70
+
71
+ @Column({ type: 'varchar', length: 100, nullable: true })
72
+ Activity_Title: string;
14
73
 
15
- @Column({ nullable: false })
16
- department: string;
17
-
18
- @Column({ nullable: false })
19
- leave_type: string;
20
-
21
- @Column({ nullable: false })
22
- reason: string;
23
-
24
- @Column({
25
- type: "enum",
26
- enum: ContactFor,
27
- default: ContactFor.SELF,
28
- nullable: false,
29
- })
30
- request_for: ContactFor;
31
-
32
- @Column({ nullable: false })
33
- description: string;
34
-
35
- @Column({ type: "date", nullable: false })
36
- from_date: Date;
37
-
38
- @Column({ type: "date", nullable: false })
39
- to_date: Date;
40
-
41
- @Column({ nullable: false })
42
- user_id: number;
43
-
44
- @Column({ nullable: true })
45
- reporting_manager: number;
46
-
47
- @Column({
48
- type: "enum",
49
- enum: status,
50
- default: status.PENDING,
51
- nullable: false,
52
- })
53
- status: status;
54
-
55
- constructor(
56
- department: string,
57
- leave_type: string,
58
- reason: string,
59
- request_for: ContactFor,
60
- description: string,
61
- from_date: Date,
62
- to_date: Date,
63
- reporting_manager: number,
64
- status: status,
65
- ) {
66
- super();
67
- this.department = department,
68
- this.leave_type = leave_type,
69
- this.reason = reason,
70
- this.request_for = request_for,
71
- this.description = description,
72
- this.from_date = from_date,
73
- this.to_date = to_date,
74
- this.reporting_manager = reporting_manager,
75
- this.status = status
76
- }
74
+ @Column({ type: 'varchar', length: 50, nullable: true })
75
+ Relationship: string;
77
76
  }
@@ -8,19 +8,14 @@ export class LeaveTypes extends BaseModel {
8
8
  name: string;
9
9
 
10
10
  @Column({ nullable: false })
11
- nameinEnglish: string;
12
-
13
- @Column({ nullable: false })
14
- nameinArabic: string;
11
+ name_in_Arabic: string;
15
12
 
16
13
  constructor(
17
14
  name: string,
18
- nameinEnglish: string,
19
- nameinArabic: string,
15
+ name_in_Arabic: string,
20
16
  ) {
21
17
  super();
22
18
  this.name = name
23
- this.nameinEnglish = nameinEnglish,
24
- this.nameinArabic = nameinArabic
19
+ this.name_in_Arabic = name_in_Arabic
25
20
  }
26
21
  }