@platform-modules/foreign-ministry 1.2.21 → 1.2.23

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 (32) hide show
  1. package/.env +1 -1
  2. package/dist/index.d.ts +14 -0
  3. package/dist/index.js +28 -1
  4. package/dist/models/MissionTravelApprovalModel.d.ts +3 -0
  5. package/dist/models/MissionTravelApprovalModel.js +28 -1
  6. package/dist/models/MissionTravelAttachmentModel.d.ts +5 -3
  7. package/dist/models/MissionTravelAttachmentModel.js +29 -12
  8. package/dist/models/MissionTravelChatModel.d.ts +4 -1
  9. package/dist/models/MissionTravelChatModel.js +23 -3
  10. package/dist/models/MissionTravelPersonModel.d.ts +2 -8
  11. package/dist/models/MissionTravelPersonModel.js +4 -15
  12. package/dist/models/MissionTravelRequestModel.d.ts +2 -6
  13. package/dist/models/MissionTravelRequestModel.js +7 -27
  14. package/dist/models/MissionTravelWorkflowModel.d.ts +9 -3
  15. package/dist/models/MissionTravelWorkflowModel.js +37 -17
  16. package/package.json +1 -1
  17. package/src/data-source.ts +11 -1
  18. package/src/index.ts +7 -1
  19. package/src/models/EmployeeCardApprovalsModel.ts +87 -0
  20. package/src/models/EmployeeCardAttachmentsModel.ts +56 -0
  21. package/src/models/EmployeeCardChatsModel.ts +66 -0
  22. package/src/models/EmployeeCardRequestsModel.ts +115 -0
  23. package/src/models/EmployeeCardWorkFlowModel.ts +90 -0
  24. package/src/models/MissionTravelApprovalModel.ts +41 -0
  25. package/src/models/MissionTravelAttachmentModel.ts +56 -32
  26. package/src/models/MissionTravelChatModel.ts +52 -26
  27. package/src/models/MissionTravelPersonModel.ts +105 -116
  28. package/src/models/MissionTravelRequestModel.ts +6 -25
  29. package/src/models/MissionTravelWorkflowModel.ts +55 -38
  30. package/src/models/MissionTravelClassConfigModel.ts +0 -39
  31. package/src/models/MissionTravelCostModel.ts +0 -64
  32. package/src/models/MissionTravelPerdiemModel.ts +0 -43
@@ -1,116 +1,105 @@
1
- import { Column, Entity } from "typeorm";
2
- import { BaseModel } from './BaseModel';
3
-
4
- export enum TravelClass {
5
- ECONOMY = "Economy",
6
- BUSINESS = "Business",
7
- FIRST = "First"
8
- }
9
-
10
- export enum AllowanceRatio {
11
- RATIO_100 = "100",
12
- RATIO_75 = "75",
13
- RATIO_50 = "50"
14
- }
15
-
16
- @Entity({ name: 'mission_travel_persons' })
17
- export class MissionTravelPersons extends BaseModel {
18
-
19
- @Column({ type: 'int', nullable: false })
20
- request_id: number;
21
-
22
- @Column({ type: 'int', nullable: true })
23
- service_id: number | null;
24
-
25
- @Column({ type: 'int', nullable: true })
26
- sub_service_id: number | null;
27
-
28
- @Column({ type: 'varchar', length: 255, nullable: false })
29
- travel_person_name: string;
30
-
31
- @Column({ type: 'int', nullable: true })
32
- user_id: number | null; // If employee, link to user table
33
-
34
- @Column({ type: 'int', nullable: true })
35
- country_id: number | null;
36
-
37
- @Column({ type: 'varchar', length: 10, nullable: true })
38
- allowance_ratio: AllowanceRatio | null; // 100, 75, or 50
39
-
40
- @Column({ type: 'date', nullable: true })
41
- travel_from_date: Date | null;
42
-
43
- @Column({ type: 'date', nullable: true })
44
- travel_to_date: Date | null;
45
-
46
- @Column({ type: 'enum', enum: TravelClass, nullable: true })
47
- travel_class: TravelClass | null;
48
-
49
- @Column({ type: 'int', nullable: true })
50
- number_of_days: number | null;
51
-
52
- @Column({ type: 'varchar', length: 255, nullable: true })
53
- hotel_name: string | null;
54
-
55
- @Column({ type: 'int', nullable: true })
56
- hotel_rating: number | null;
57
-
58
- @Column({ type: 'decimal', precision: 10, scale: 2, nullable: true })
59
- hotel_price: number | null;
60
-
61
- @Column({ type: 'varchar', length: 255, nullable: true })
62
- travel_agent_name: string | null;
63
-
64
- @Column({ type: 'decimal', precision: 10, scale: 2, nullable: true })
65
- allowance_amount: number | null; // Auto-calculated based on ratio & perdiem
66
-
67
- @Column({ type: 'int', nullable: true })
68
- grade: number | null; // Employee grade for perdiem calculation
69
-
70
- @Column({ type: 'varchar', length: 100, nullable: true })
71
- position: string | null; // Employee position for travel class
72
-
73
- constructor(
74
- request_id: number,
75
- service_id: number | null,
76
- sub_service_id: number | null,
77
- travel_person_name: string,
78
- user_id: number | null,
79
- country_id: number | null,
80
- allowance_ratio: AllowanceRatio | null,
81
- travel_from_date: Date | null,
82
- travel_to_date: Date | null,
83
- travel_class: TravelClass | null,
84
- number_of_days: number | null,
85
- hotel_name: string | null,
86
- hotel_rating: number | null,
87
- hotel_price: number | null,
88
- travel_agent_name: string | null,
89
- allowance_amount: number | null,
90
- grade: number | null,
91
- position: string | null
92
- ) {
93
- super();
94
- this.request_id = request_id;
95
- this.service_id = service_id;
96
- this.sub_service_id = sub_service_id;
97
- this.travel_person_name = travel_person_name;
98
- this.user_id = user_id;
99
- this.country_id = country_id;
100
- this.allowance_ratio = allowance_ratio;
101
- this.travel_from_date = travel_from_date;
102
- this.travel_to_date = travel_to_date;
103
- this.travel_class = travel_class;
104
- this.number_of_days = number_of_days;
105
- this.hotel_name = hotel_name;
106
- this.hotel_rating = hotel_rating;
107
- this.hotel_price = hotel_price;
108
- this.travel_agent_name = travel_agent_name;
109
- this.allowance_amount = allowance_amount;
110
- this.grade = grade;
111
- this.position = position;
112
- }
113
- }
114
-
115
-
116
-
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum AllowanceRatio {
5
+ RATIO_100 = "100",
6
+ RATIO_75 = "75",
7
+ RATIO_50 = "50"
8
+ }
9
+
10
+ @Entity({ name: 'mission_travel_persons' })
11
+ export class MissionTravelPersons extends BaseModel {
12
+
13
+ @Column({ type: 'int', nullable: false })
14
+ request_id: number;
15
+
16
+ @Column({ type: 'int', nullable: true })
17
+ service_id: number | null;
18
+
19
+ @Column({ type: 'int', nullable: true })
20
+ sub_service_id: number | null;
21
+
22
+ @Column({ type: 'varchar', length: 255, nullable: false })
23
+ travel_person_name: string;
24
+
25
+ @Column({ type: 'int', nullable: true })
26
+ user_id: number | null; // If employee, link to user table
27
+
28
+ @Column({ type: 'int', nullable: true })
29
+ country_id: number | null;
30
+
31
+ @Column({ type: 'varchar', length: 10, nullable: true })
32
+ allowance_ratio: AllowanceRatio | null; // 100, 75, or 50
33
+
34
+ @Column({ type: 'date', nullable: true })
35
+ travel_from_date: Date | null;
36
+
37
+ @Column({ type: 'date', nullable: true })
38
+ travel_to_date: Date | null;
39
+
40
+ @Column({ type: 'varchar', nullable: true })
41
+ travel_class: string | null;
42
+
43
+ @Column({ type: 'int', nullable: true })
44
+ number_of_days: number | null;
45
+
46
+ @Column({ type: 'varchar', length: 255, nullable: true })
47
+ hotel_name: string | null;
48
+
49
+ @Column({ type: 'int', nullable: true })
50
+ hotel_rating: number | null;
51
+
52
+ @Column({ type: 'decimal', precision: 10, scale: 2, nullable: true })
53
+ hotel_price: number | null;
54
+
55
+ @Column({ type: 'varchar', length: 255, nullable: true })
56
+ travel_agent_name: string | null;
57
+
58
+ @Column({ type: 'decimal', precision: 10, scale: 2, nullable: true })
59
+ allowance_amount: number | null; // Auto-calculated based on ratio & perdiem
60
+
61
+ @Column({ type: 'int', nullable: true })
62
+ grade: number | null; // Employee grade for perdiem calculation
63
+
64
+ constructor(
65
+ request_id: number,
66
+ service_id: number | null,
67
+ sub_service_id: number | null,
68
+ travel_person_name: string,
69
+ user_id: number | null,
70
+ country_id: number | null,
71
+ allowance_ratio: AllowanceRatio | null,
72
+ travel_from_date: Date | null,
73
+ travel_to_date: Date | null,
74
+ travel_class: string | null,
75
+ number_of_days: number | null,
76
+ hotel_name: string | null,
77
+ hotel_rating: number | null,
78
+ hotel_price: number | null,
79
+ travel_agent_name: string | null,
80
+ allowance_amount: number | null,
81
+ grade: number | null
82
+ ) {
83
+ super();
84
+ this.request_id = request_id;
85
+ this.service_id = service_id;
86
+ this.sub_service_id = sub_service_id;
87
+ this.travel_person_name = travel_person_name;
88
+ this.user_id = user_id;
89
+ this.country_id = country_id;
90
+ this.allowance_ratio = allowance_ratio;
91
+ this.travel_from_date = travel_from_date;
92
+ this.travel_to_date = travel_to_date;
93
+ this.travel_class = travel_class;
94
+ this.number_of_days = number_of_days;
95
+ this.hotel_name = hotel_name;
96
+ this.hotel_rating = hotel_rating;
97
+ this.hotel_price = hotel_price;
98
+ this.travel_agent_name = travel_agent_name;
99
+ this.allowance_amount = allowance_amount;
100
+ this.grade = grade;
101
+ }
102
+ }
103
+
104
+
105
+
@@ -42,9 +42,6 @@ export class MissionTravelRequests extends BaseModel {
42
42
  @Column({ type: 'enum', enum: DecisionType, nullable: true })
43
43
  decision_type: DecisionType | null;
44
44
 
45
- @Column({ type: 'int', nullable: true })
46
- country_id: number | null;
47
-
48
45
  @Column({ type: 'date', nullable: true })
49
46
  from_date: Date | null;
50
47
 
@@ -63,24 +60,15 @@ export class MissionTravelRequests extends BaseModel {
63
60
  @Column({ type: 'decimal', precision: 10, scale: 2, nullable: true })
64
61
  mission_allowance_cost: number | null;
65
62
 
66
- @Column({ type: 'varchar', length: 255, nullable: true })
67
- hotel_name: string | null;
68
-
69
- @Column({ type: 'int', nullable: true })
70
- hotel_rating: number | null;
71
-
72
- @Column({ type: 'decimal', precision: 10, scale: 2, nullable: true })
73
- hotel_price: number | null;
74
-
75
- @Column({ type: 'varchar', length: 255, nullable: true })
76
- travelling_agent: string | null;
77
-
78
63
  @Column({ type: 'enum', enum: MissionTravelStatus, default: MissionTravelStatus.PENDING, nullable: false })
79
64
  status: MissionTravelStatus;
80
65
 
81
66
  @Column({ type: 'varchar', nullable: true })
82
67
  workflow_execution_id: string | null;
83
68
 
69
+ @Column({ type: 'varchar', nullable: true })
70
+ request_type: string | null;
71
+
84
72
  constructor(
85
73
  user_id: number,
86
74
  service_id: number | null,
@@ -88,17 +76,13 @@ export class MissionTravelRequests extends BaseModel {
88
76
  department_participation: boolean,
89
77
  mission_type: MissionType | null,
90
78
  decision_type: DecisionType | null,
91
- country_id: number | null,
92
79
  from_date: Date | null,
93
80
  to_date: Date | null,
94
81
  purpose_of_mission: string | null,
95
82
  exchange_ratio: string | null,
96
83
  number_of_days: number | null,
97
84
  mission_allowance_cost: number | null,
98
- hotel_name: string | null,
99
- hotel_rating: number | null,
100
- hotel_price: number | null,
101
- travelling_agent: string | null
85
+ request_type: string | null
102
86
  ) {
103
87
  super();
104
88
  this.user_id = user_id;
@@ -107,18 +91,15 @@ export class MissionTravelRequests extends BaseModel {
107
91
  this.department_participation = department_participation;
108
92
  this.mission_type = mission_type;
109
93
  this.decision_type = decision_type;
110
- this.country_id = country_id;
111
94
  this.from_date = from_date;
112
95
  this.to_date = to_date;
113
96
  this.purpose_of_mission = purpose_of_mission;
114
97
  this.exchange_ratio = exchange_ratio;
115
98
  this.number_of_days = number_of_days;
116
99
  this.mission_allowance_cost = mission_allowance_cost;
117
- this.hotel_name = hotel_name;
118
- this.hotel_rating = hotel_rating;
119
- this.hotel_price = hotel_price;
120
- this.travelling_agent = travelling_agent;
121
100
  this.status = MissionTravelStatus.PENDING;
101
+ this.request_type = request_type;
102
+
122
103
  }
123
104
  }
124
105
 
@@ -1,38 +1,55 @@
1
- import { Column, Entity } from "typeorm";
2
- import { BaseModel } from './BaseModel';
3
-
4
- @Entity({ name: 'mission_travel_workflows' })
5
- export class MissionTravelWorkFlow extends BaseModel {
6
- @Column({ type: 'integer', nullable: false })
7
- request_id: number;
8
-
9
- @Column({ type: 'integer', nullable: true })
10
- service_id: number | null;
11
-
12
- @Column({ type: 'integer', nullable: true })
13
- sub_service_id: number | null;
14
-
15
- @Column({ type: 'integer', nullable: true })
16
- user_id: number | null;
17
-
18
- @Column({ type: 'integer', nullable: true })
19
- role_id: number | null;
20
-
21
- @Column({ type: 'integer', nullable: true })
22
- department_id: number | null;
23
-
24
- @Column({ type: 'integer', nullable: true })
25
- section_id: number | null;
26
-
27
- @Column({ type: 'varchar', length: 255, nullable: true })
28
- action: string | null;
29
-
30
- @Column({ type: 'text', nullable: true })
31
- comment: string | null;
32
-
33
- @Column({ type: 'timestamp', nullable: true })
34
- action_date: Date | null;
35
- }
36
-
37
-
38
-
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum workFlowStatus {
5
+ COMPLETED = "Completed",
6
+ NOT_YET_STARTED = "Not Yet Started",
7
+ PENDING = "Pending"
8
+ }
9
+
10
+ @Entity({ name: 'mission_travel_workflows' })
11
+ export class MissionTravelWorkFlow extends BaseModel {
12
+ @Column({ type: 'int', nullable: false })
13
+ request_id: number;
14
+
15
+ @Column({ type: 'int', nullable: true })
16
+ service_id: number | null;
17
+
18
+ @Column({ type: 'int', nullable: true })
19
+ sub_service_id: number | null;
20
+
21
+ @Column({ type: 'int', nullable: true })
22
+ order: number | null;
23
+
24
+ @Column({ type: 'varchar', length: 255, nullable: false })
25
+ content: string;
26
+
27
+ @Column({ type: 'enum', enum: workFlowStatus, default: workFlowStatus.NOT_YET_STARTED, nullable: false })
28
+ status: workFlowStatus;
29
+
30
+ @Column({ type: 'integer', nullable: true })
31
+ user_id: number | null;
32
+
33
+ @Column({ type: 'integer', nullable: true })
34
+ role_id: number | null;
35
+
36
+ @Column({ type: 'integer', nullable: true })
37
+ department_id: number | null;
38
+
39
+ @Column({ type: 'integer', nullable: true })
40
+ section_id: number | null;
41
+
42
+ constructor(request_id: number, content: string, status: workFlowStatus, order?: number, service_id?: number | null, sub_service_id?: number | null, user_id?: number | null, role_id?: number | null, department_id?: number | null, section_id?: number | null) {
43
+ super();
44
+ this.request_id = request_id;
45
+ this.content = content;
46
+ this.status = status;
47
+ this.order = order || null;
48
+ this.service_id = service_id ?? null;
49
+ this.sub_service_id = sub_service_id ?? null;
50
+ this.user_id = user_id || null;
51
+ this.role_id = role_id || null;
52
+ this.department_id = department_id || null;
53
+ this.section_id = section_id || null;
54
+ }
55
+ }
@@ -1,39 +0,0 @@
1
- import { Column, Entity } from "typeorm";
2
- import { BaseModel } from './BaseModel';
3
- import { TravelClass } from './MissionTravelPersonModel';
4
-
5
- @Entity({ name: 'mission_travel_class_config' })
6
- export class MissionTravelClassConfig extends BaseModel {
7
-
8
- @Column({ type: 'int', nullable: true })
9
- grade: number | null;
10
-
11
- @Column({ type: 'varchar', length: 255, nullable: true })
12
- position: string | null;
13
-
14
- @Column({ type: 'enum', enum: TravelClass, nullable: false })
15
- travel_class: TravelClass;
16
-
17
- @Column({ type: 'boolean', default: true })
18
- is_active: boolean;
19
-
20
- @Column({ type: 'text', nullable: true })
21
- description: string | null;
22
-
23
- constructor(
24
- grade: number | null,
25
- position: string | null,
26
- travel_class: TravelClass,
27
- description: string | null
28
- ) {
29
- super();
30
- this.grade = grade;
31
- this.position = position;
32
- this.travel_class = travel_class;
33
- this.description = description;
34
- this.is_active = true;
35
- }
36
- }
37
-
38
-
39
-
@@ -1,64 +0,0 @@
1
- import { Column, Entity } from "typeorm";
2
- import { BaseModel } from './BaseModel';
3
-
4
- @Entity({ name: 'mission_travel_costs' })
5
- export class MissionTravelCosts extends BaseModel {
6
-
7
- @Column({ type: 'int', nullable: false })
8
- request_id: number;
9
-
10
- @Column({ type: 'int', nullable: true })
11
- service_id: number | null;
12
-
13
- @Column({ type: 'int', nullable: true })
14
- sub_service_id: number | null;
15
-
16
- @Column({ type: 'int', nullable: false })
17
- person_id: number; // Reference to mission_travel_persons.id
18
-
19
- @Column({ type: 'varchar', length: 255, nullable: false })
20
- person_name: string;
21
-
22
- @Column({ type: 'decimal', precision: 10, scale: 2, nullable: true })
23
- allowance_amount: number | null; // Pulled from calculated allowance
24
-
25
- @Column({ type: 'decimal', precision: 10, scale: 2, nullable: true })
26
- ticket_charges: number | null;
27
-
28
- @Column({ type: 'decimal', precision: 10, scale: 2, nullable: true })
29
- hotel_charges: number | null;
30
-
31
- @Column({ type: 'decimal', precision: 10, scale: 2, nullable: true })
32
- others: number | null;
33
-
34
- @Column({ type: 'decimal', precision: 10, scale: 2, nullable: true })
35
- sub_total: number | null; // Auto-calculated: allowance + ticket + hotel + others
36
-
37
- constructor(
38
- request_id: number,
39
- service_id: number | null,
40
- sub_service_id: number | null,
41
- person_id: number,
42
- person_name: string,
43
- allowance_amount: number | null,
44
- ticket_charges: number | null,
45
- hotel_charges: number | null,
46
- others: number | null,
47
- sub_total: number | null
48
- ) {
49
- super();
50
- this.request_id = request_id;
51
- this.service_id = service_id;
52
- this.sub_service_id = sub_service_id;
53
- this.person_id = person_id;
54
- this.person_name = person_name;
55
- this.allowance_amount = allowance_amount;
56
- this.ticket_charges = ticket_charges;
57
- this.hotel_charges = hotel_charges;
58
- this.others = others;
59
- this.sub_total = sub_total;
60
- }
61
- }
62
-
63
-
64
-
@@ -1,43 +0,0 @@
1
- import { Column, Entity } from "typeorm";
2
- import { BaseModel } from './BaseModel';
3
-
4
- @Entity({ name: 'mission_travel_perdiem' })
5
- export class MissionTravelPerdiem extends BaseModel {
6
-
7
- @Column({ type: 'int', nullable: false })
8
- grade: number;
9
-
10
- @Column({ type: 'decimal', precision: 10, scale: 2, nullable: false })
11
- perdiem_amount: number;
12
-
13
- @Column({ type: 'varchar', length: 50, nullable: true })
14
- currency: string | null;
15
-
16
- @Column({ type: 'date', nullable: true })
17
- effective_from: Date | null;
18
-
19
- @Column({ type: 'date', nullable: true })
20
- effective_to: Date | null;
21
-
22
- @Column({ type: 'boolean', default: true })
23
- is_active: boolean;
24
-
25
- constructor(
26
- grade: number,
27
- perdiem_amount: number,
28
- currency: string | null,
29
- effective_from: Date | null,
30
- effective_to: Date | null
31
- ) {
32
- super();
33
- this.grade = grade;
34
- this.perdiem_amount = perdiem_amount;
35
- this.currency = currency;
36
- this.effective_from = effective_from;
37
- this.effective_to = effective_to;
38
- this.is_active = true;
39
- }
40
- }
41
-
42
-
43
-