@platform-modules/foreign-ministry 1.1.26 → 1.1.27

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 (77) hide show
  1. package/dist/data-source.js +8 -28
  2. package/dist/index.d.ts +4 -14
  3. package/dist/index.js +4 -14
  4. package/dist/models/AttendanceModel.d.ts +2 -1
  5. package/dist/models/AttendanceModel.js +2 -1
  6. package/dist/models/FinancialRequestsModel.d.ts +1 -1
  7. package/dist/models/FinancialRequestsModel.js +3 -3
  8. package/dist/models/LeaveApprovalsModel.d.ts +4 -1
  9. package/dist/models/LeaveApprovalsModel.js +9 -0
  10. package/dist/models/ReimbursementRequestsModel.js +2 -2
  11. package/dist/models/UpdateAttendanceApprovalModel.d.ts +21 -0
  12. package/dist/models/UpdateAttendanceApprovalModel.js +75 -0
  13. package/dist/models/UpdateAttendanceChatModel.d.ts +16 -0
  14. package/dist/models/UpdateAttendanceChatModel.js +52 -0
  15. package/dist/models/UpdateAttendanceRequestModel.d.ts +28 -0
  16. package/dist/models/UpdateAttendanceRequestModel.js +86 -0
  17. package/dist/models/UpdateAttendanceWorkflowModel.d.ts +13 -0
  18. package/dist/models/UpdateAttendanceWorkflowModel.js +46 -0
  19. package/dist/models/WorkflowTask.d.ts +5 -2
  20. package/dist/models/WorkflowTask.js +28 -4
  21. package/dist/models/WorkflowTaskNames.d.ts +12 -3
  22. package/dist/models/WorkflowTaskNames.js +28 -9
  23. package/package.json +1 -1
  24. package/src/data-source.ts +8 -28
  25. package/src/index.ts +4 -14
  26. package/src/models/AttendanceModel.ts +2 -1
  27. package/src/models/FinancialRequestsModel.ts +2 -2
  28. package/src/models/LeaveApprovalsModel.ts +8 -1
  29. package/src/models/ReimbursementRequestsModel.ts +3 -6
  30. package/src/models/UpdateAttendanceApprovalModel.ts +50 -0
  31. package/src/models/UpdateAttendanceChatModel.ts +35 -0
  32. package/src/models/UpdateAttendanceRequestModel.ts +63 -0
  33. package/src/models/UpdateAttendanceWorkflowModel.ts +28 -0
  34. package/src/models/WorkflowTask.ts +31 -4
  35. package/src/models/WorkflowTaskNames.ts +27 -8
  36. package/dist/models/DiplomaticClubCardApprovalModel.d.ts +0 -16
  37. package/dist/models/DiplomaticClubCardApprovalModel.js +0 -58
  38. package/dist/models/DiplomaticClubCardAttachmentModel.d.ts +0 -9
  39. package/dist/models/DiplomaticClubCardAttachmentModel.js +0 -44
  40. package/dist/models/DiplomaticClubCardChatModel.d.ts +0 -7
  41. package/dist/models/DiplomaticClubCardChatModel.js +0 -36
  42. package/dist/models/DiplomaticClubCardMemberModel.d.ts +0 -13
  43. package/dist/models/DiplomaticClubCardMemberModel.js +0 -60
  44. package/dist/models/DiplomaticClubCardRequestModel.d.ts +0 -33
  45. package/dist/models/DiplomaticClubCardRequestModel.js +0 -98
  46. package/dist/models/DiplomaticClubCardWorkFlowModel.d.ts +0 -12
  47. package/dist/models/DiplomaticClubCardWorkFlowModel.js +0 -42
  48. package/dist/models/DiplomaticTitleModel.d.ts +0 -12
  49. package/dist/models/DiplomaticTitleModel.js +0 -45
  50. package/dist/models/PassportRequestApprovalModel.d.ts +0 -22
  51. package/dist/models/PassportRequestApprovalModel.js +0 -91
  52. package/dist/models/PassportRequestAttachmentModel.d.ts +0 -10
  53. package/dist/models/PassportRequestAttachmentModel.js +0 -54
  54. package/dist/models/PassportRequestChatModel.d.ts +0 -8
  55. package/dist/models/PassportRequestChatModel.js +0 -44
  56. package/dist/models/PassportRequestDependentModel.d.ts +0 -20
  57. package/dist/models/PassportRequestDependentModel.js +0 -85
  58. package/dist/models/PassportRequestModel.d.ts +0 -40
  59. package/dist/models/PassportRequestModel.js +0 -128
  60. package/dist/models/PassportRequestWorkFlowModel.d.ts +0 -15
  61. package/dist/models/PassportRequestWorkFlowModel.js +0 -60
  62. package/dist/models/SubscriptionAmountModel.d.ts +0 -10
  63. package/dist/models/SubscriptionAmountModel.js +0 -45
  64. package/src/models/DiplomaticClubCardApprovalModel.ts +0 -37
  65. package/src/models/DiplomaticClubCardAttachmentModel.ts +0 -25
  66. package/src/models/DiplomaticClubCardChatModel.ts +0 -19
  67. package/src/models/DiplomaticClubCardMemberModel.ts +0 -37
  68. package/src/models/DiplomaticClubCardRequestModel.ts +0 -70
  69. package/src/models/DiplomaticClubCardWorkFlowModel.ts +0 -25
  70. package/src/models/DiplomaticTitleModel.ts +0 -27
  71. package/src/models/PassportRequestApprovalModel.ts +0 -79
  72. package/src/models/PassportRequestAttachmentModel.ts +0 -42
  73. package/src/models/PassportRequestChatModel.ts +0 -27
  74. package/src/models/PassportRequestDependentModel.ts +0 -73
  75. package/src/models/PassportRequestModel.ts +0 -116
  76. package/src/models/PassportRequestWorkFlowModel.ts +0 -48
  77. package/src/models/SubscriptionAmountModel.ts +0 -26
@@ -1,8 +1,17 @@
1
1
  import { BaseModel } from './BaseModel';
2
+ export declare enum TaskType {
3
+ SIMPLE = "SIMPLE",
4
+ HUMAN = "HUMAN"
5
+ }
6
+ export declare enum CategoryType {
7
+ CREATE = "CREATE",
8
+ APPROVAL = "APPROVAL",
9
+ NOTIFICATION = "NOTIFICATION"
10
+ }
2
11
  export declare class WorkflowTaskNames extends BaseModel {
3
12
  name: string;
4
- task_id: number;
5
13
  description: string;
6
- task_type: string;
7
- constructor(name: string, task_id: number, description: string, task_type: string);
14
+ task_type: TaskType;
15
+ category: CategoryType;
16
+ constructor(name: string, description: string, task_type: TaskType, category: CategoryType);
8
17
  }
@@ -9,16 +9,27 @@ 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.WorkflowTaskNames = void 0;
12
+ exports.WorkflowTaskNames = exports.CategoryType = exports.TaskType = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const BaseModel_1 = require("./BaseModel");
15
+ var TaskType;
16
+ (function (TaskType) {
17
+ TaskType["SIMPLE"] = "SIMPLE";
18
+ TaskType["HUMAN"] = "HUMAN";
19
+ })(TaskType || (exports.TaskType = TaskType = {}));
20
+ var CategoryType;
21
+ (function (CategoryType) {
22
+ CategoryType["CREATE"] = "CREATE";
23
+ CategoryType["APPROVAL"] = "APPROVAL";
24
+ CategoryType["NOTIFICATION"] = "NOTIFICATION";
25
+ })(CategoryType || (exports.CategoryType = CategoryType = {}));
15
26
  let WorkflowTaskNames = class WorkflowTaskNames extends BaseModel_1.BaseModel {
16
- constructor(name, task_id, description, task_type) {
27
+ constructor(name, description, task_type, category) {
17
28
  super();
18
29
  this.name = name;
19
- this.task_id = task_id;
20
30
  this.description = description;
21
31
  this.task_type = task_type;
32
+ this.category = category;
22
33
  }
23
34
  };
24
35
  exports.WorkflowTaskNames = WorkflowTaskNames;
@@ -26,19 +37,27 @@ __decorate([
26
37
  (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: false }),
27
38
  __metadata("design:type", String)
28
39
  ], WorkflowTaskNames.prototype, "name", void 0);
29
- __decorate([
30
- (0, typeorm_1.Column)({ type: 'integer', nullable: false }),
31
- __metadata("design:type", Number)
32
- ], WorkflowTaskNames.prototype, "task_id", void 0);
33
40
  __decorate([
34
41
  (0, typeorm_1.Column)({ type: 'varchar', length: 200, nullable: true }),
35
42
  __metadata("design:type", String)
36
43
  ], WorkflowTaskNames.prototype, "description", void 0);
37
44
  __decorate([
38
- (0, typeorm_1.Column)({ type: 'varchar', length: 200, nullable: true }),
45
+ (0, typeorm_1.Column)({
46
+ type: 'enum',
47
+ enum: TaskType,
48
+ nullable: true
49
+ }),
39
50
  __metadata("design:type", String)
40
51
  ], WorkflowTaskNames.prototype, "task_type", void 0);
52
+ __decorate([
53
+ (0, typeorm_1.Column)({
54
+ type: 'enum',
55
+ enum: CategoryType,
56
+ nullable: true
57
+ }),
58
+ __metadata("design:type", String)
59
+ ], WorkflowTaskNames.prototype, "category", void 0);
41
60
  exports.WorkflowTaskNames = WorkflowTaskNames = __decorate([
42
61
  (0, typeorm_1.Entity)({ name: 'workflow_task_names' }),
43
- __metadata("design:paramtypes", [String, Number, String, String])
62
+ __metadata("design:paramtypes", [String, String, String, String])
44
63
  ], WorkflowTaskNames);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platform-modules/foreign-ministry",
3
- "version": "1.1.26",
3
+ "version": "1.1.27",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -80,20 +80,6 @@ import { StayAfterHoursApprovalDetails } from './models/StayAfterHoursApprovalMo
80
80
  import { StayAfterHoursRequestAttachment } from './models/StayAfterHoursAttachmentModel';
81
81
  import { StayAfterHoursRequestChat } from './models/StayAfterHoursChatModel';
82
82
  import { StayAfterHoursWorkFlow } from './models/StayAfterHoursWorkflowModel';
83
- import { DiplomaticClubCardRequests } from './models/DiplomaticClubCardRequestModel';
84
- import { DiplomaticClubCardMembers } from './models/DiplomaticClubCardMemberModel';
85
- import { DiplomaticClubCardApprovals } from './models/DiplomaticClubCardApprovalModel';
86
- import { DiplomaticClubCardAttachments } from './models/DiplomaticClubCardAttachmentModel';
87
- import { DiplomaticClubCardWorkFlow } from './models/DiplomaticClubCardWorkFlowModel';
88
- import { DiplomaticClubCardChat } from './models/DiplomaticClubCardChatModel';
89
- import { DiplomaticTitles } from './models/DiplomaticTitleModel';
90
- import { SubscriptionAmounts } from './models/SubscriptionAmountModel';
91
- import { PassportRequests } from './models/PassportRequestModel';
92
- import { PassportRequestChat } from './models/PassportRequestChatModel';
93
- import { PassportRequestAttachments } from './models/PassportRequestAttachmentModel';
94
- import { PassportRequestWorkFlow } from './models/PassportRequestWorkFlowModel';
95
- import { PassportRequestApprovals } from './models/PassportRequestApprovalModel';
96
- import { PassportRequestDependents } from './models/PassportRequestDependentModel';
97
83
 
98
84
 
99
85
  import { WorkflowTask } from './models/WorkflowTask';
@@ -102,6 +88,10 @@ import { WorkflowDefinitions } from './models/WorkflowDefinitions';
102
88
  import { WorkflowHierarchy } from './models/WorkflowHierarchy';
103
89
  import { ImportantLinks } from './models/importantLinksModel';
104
90
  import { DelegateSettings } from './models/DelegateSettingsModel';
91
+ import { UpdateAttendanceRequests } from './models/UpdateAttendanceRequestModel';
92
+ import { UpdateAttendanceApprovalDetails } from './models/UpdateAttendanceApprovalModel';
93
+ import { UpdateAttendanceRequestChat } from './models/UpdateAttendanceChatModel';
94
+ import { UpdateAttendanceWorkFlow } from './models/UpdateAttendanceWorkflowModel';
105
95
 
106
96
 
107
97
  export const AppDataSource = new DataSource({
@@ -193,19 +183,9 @@ export const AppDataSource = new DataSource({
193
183
  ,StayAfterHoursRequestAttachment
194
184
  ,StayAfterHoursRequestChat
195
185
  ,StayAfterHoursWorkFlow
196
- ,DiplomaticClubCardRequests
197
- ,DiplomaticClubCardMembers
198
- ,DiplomaticClubCardApprovals
199
- ,DiplomaticClubCardAttachments
200
- ,DiplomaticClubCardWorkFlow
201
- ,DiplomaticClubCardChat
202
- ,DiplomaticTitles
203
- ,SubscriptionAmounts
204
- ,PassportRequests
205
- ,PassportRequestChat
206
- ,PassportRequestAttachments
207
- ,PassportRequestWorkFlow
208
- ,PassportRequestApprovals
209
- ,PassportRequestDependents
186
+ ,UpdateAttendanceRequests
187
+ ,UpdateAttendanceApprovalDetails
188
+ ,UpdateAttendanceRequestChat
189
+ ,UpdateAttendanceWorkFlow
210
190
  ],
211
191
  });
package/src/index.ts CHANGED
@@ -77,17 +77,7 @@ export * from './models/StayAfterHoursApprovalModel';
77
77
  export * from './models/StayAfterHoursAttachmentModel';
78
78
  export * from './models/StayAfterHoursChatModel';
79
79
  export * from './models/StayAfterHoursWorkflowModel';
80
- export * from './models/DiplomaticClubCardRequestModel';
81
- export * from './models/DiplomaticClubCardMemberModel';
82
- export * from './models/DiplomaticClubCardApprovalModel';
83
- export * from './models/DiplomaticClubCardAttachmentModel';
84
- export * from './models/DiplomaticClubCardWorkFlowModel';
85
- export * from './models/DiplomaticClubCardChatModel';
86
- export * from './models/DiplomaticTitleModel';
87
- export * from './models/SubscriptionAmountModel';
88
- export * from './models/PassportRequestModel';
89
- export * from './models/PassportRequestChatModel';
90
- export * from './models/PassportRequestAttachmentModel';
91
- export * from './models/PassportRequestWorkFlowModel';
92
- export * from './models/PassportRequestApprovalModel';
93
- export * from './models/PassportRequestDependentModel';
80
+ export * from './models/UpdateAttendanceRequestModel';
81
+ export * from './models/UpdateAttendanceApprovalModel';
82
+ export * from './models/UpdateAttendanceChatModel';
83
+ export * from './models/UpdateAttendanceWorkflowModel';
@@ -7,6 +7,7 @@ export enum AttendanceStatus {
7
7
  ABSENT = 'ABSENT',
8
8
  LEAVE = 'LEAVE',
9
9
  HALF_DAY = 'HALF_DAY',
10
+ REGULARISED = 'REGULARISED',
10
11
  }
11
12
 
12
13
  @Entity({ name: 'attendance_details' })
@@ -19,7 +20,7 @@ export class AttendanceDetails extends BaseModel {
19
20
  @Column({ type: 'int', nullable: true })
20
21
  shift_id: number;
21
22
 
22
- @Column({ type: 'date', nullable: true , unique: true})
23
+ @Column({ type: 'date', nullable: true })
23
24
  attendance_date: string;
24
25
 
25
26
  @Column({ type: 'time', nullable: true })
@@ -91,8 +91,8 @@ export class FinancialRequests extends BaseModel {
91
91
  @OneToOne('AllowanceRequests', 'financialRequest', { nullable: true })
92
92
  allowanceRequest?: AllowanceRequests;
93
93
 
94
- @OneToOne('ReimbursementRequests', 'financialRequest', { nullable: true })
95
- reimbursementRequest?: ReimbursementRequests;
94
+ @OneToMany('ReimbursementRequests', 'financialRequest', { nullable: true })
95
+ reimbursementRequests?: ReimbursementRequests[];
96
96
 
97
97
  @OneToOne('BankAccountChangeRequests', 'financialRequest', { nullable: true })
98
98
  bankAccountChangeRequest?: BankAccountChangeRequests;
@@ -5,7 +5,8 @@ import { BaseModel } from './BaseModel';
5
5
  export enum ApprovalStatus {
6
6
  PENDING = "Pending",
7
7
  APPROVED = "Approved",
8
- REJECTED = "Rejected"
8
+ REJECTED = "Rejected",
9
+ IN_PROGRESS = "In Progress"
9
10
  }
10
11
 
11
12
  //This model is used to store the store the leave apporval details of the user for the leave request
@@ -23,6 +24,12 @@ export class LeaveApprovalDetails extends BaseModel {
23
24
  @Column({ type: 'int', nullable: true })
24
25
  approver_role_id: number;
25
26
 
27
+ @Column({ type: 'integer', nullable: true })
28
+ delegate_user_id: number | null;
29
+
30
+ @Column({ type: 'integer', nullable: true })
31
+ approved_by: number | null;
32
+
26
33
  @Column({ type: 'int', nullable: true })
27
34
  department_id: number;
28
35
 
@@ -1,10 +1,10 @@
1
- import { Column, Entity, OneToOne, JoinColumn } from "typeorm";
1
+ import { Column, Entity, ManyToOne, JoinColumn } from "typeorm";
2
2
  import { BaseModel } from './BaseModel';
3
3
  import { FinancialRequests } from "./FinancialRequestsModel";
4
4
 
5
5
  @Entity({ name: 'reimbursement_requests' })
6
6
  export class ReimbursementRequests extends BaseModel {
7
- @Column({ type: 'int', unique: true })
7
+ @Column({ type: 'int' })
8
8
  financial_request_id: number;
9
9
 
10
10
  @Column({ type: 'text' })
@@ -34,10 +34,7 @@ export class ReimbursementRequests extends BaseModel {
34
34
  @Column({ type: 'date', nullable: true })
35
35
  payment_date: Date;
36
36
 
37
- // @OneToOne('FinancialRequests', 'reimbursementRequest')
38
- // financialRequest?: FinancialRequests;
39
-
40
- @OneToOne(() => FinancialRequests, fr => fr.reimbursementRequest)
37
+ @ManyToOne(() => FinancialRequests, fr => fr.reimbursementRequests)
41
38
  @JoinColumn({ name: 'financial_request_id' })
42
39
  financialRequest?: FinancialRequests;
43
40
 
@@ -0,0 +1,50 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum UpdateAttendanceApprovalStatus {
5
+ PENDING = "Pending",
6
+ IN_PROGRESS = "In Progress",
7
+ APPROVED = "Approved",
8
+ REJECTED = "Rejected"
9
+ }
10
+
11
+ @Entity({ name: 'update_attendance_approvals' })
12
+ export class UpdateAttendanceApprovalDetails extends BaseModel {
13
+ @Column({ type: 'integer', nullable: false })
14
+ request_id: number;
15
+
16
+ @Column({ type: 'integer', nullable: true })
17
+ service_id: number | null;
18
+
19
+ @Column({ type: 'integer', nullable: true })
20
+ sub_service_id: number | null;
21
+
22
+ @Column({ type: 'integer', nullable: false })
23
+ level: number;
24
+
25
+ @Column({ type: 'integer', nullable: true })
26
+ approver_role_id: number;
27
+
28
+ @Column({ type: 'integer', nullable: true })
29
+ department_id: number | null;
30
+
31
+ @Column({ type: 'integer', nullable: true })
32
+ section_id: number | null;
33
+
34
+ @Column({ type: 'integer', nullable: true })
35
+ approver_user_id: number | null;
36
+
37
+ @Column({ type: 'integer', nullable: true })
38
+ delegate_user_id: number | null;
39
+
40
+ @Column({ type: 'integer', nullable: true })
41
+ approved_by: number | null;
42
+
43
+ @Column({ type: 'varchar', length: 500, nullable: true, default: '' })
44
+ comment: string;
45
+
46
+ @Column({ type: 'enum', enum: UpdateAttendanceApprovalStatus, default: UpdateAttendanceApprovalStatus.PENDING, nullable: false })
47
+ approval_status: UpdateAttendanceApprovalStatus;
48
+ }
49
+
50
+
@@ -0,0 +1,35 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum UpdateAttendanceMessageType {
5
+ TEXT = "text",
6
+ IMAGE = "image",
7
+ VIDEO = "video",
8
+ FILE = "file",
9
+ LINK = "link"
10
+ }
11
+
12
+ @Entity({ name: 'update_attendance_chats' })
13
+ export class UpdateAttendanceRequestChat extends BaseModel {
14
+
15
+ @Column({ type: 'integer', nullable: false })
16
+ request_id: number;
17
+
18
+ @Column({ type: 'integer', nullable: true })
19
+ service_id: number | null;
20
+
21
+ @Column({ type: 'integer', nullable: true })
22
+ sub_service_id: number | null;
23
+
24
+ @Column({ type: 'integer', nullable: false })
25
+ user_id: number;
26
+
27
+ @Column({ type: 'text', nullable: false })
28
+ message: string;
29
+
30
+
31
+ @Column({ type: 'enum', enum: UpdateAttendanceMessageType, default: UpdateAttendanceMessageType.TEXT, nullable: false })
32
+ messageType: UpdateAttendanceMessageType;
33
+ }
34
+
35
+
@@ -0,0 +1,63 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum UpdateAttendenceStatus {
5
+ PENDING = "Pending",
6
+ ASSIGNED = "Assigned",
7
+ IN_PROGRESS = "In Progress",
8
+ APPROVED = "Approved",
9
+ REJECTED = "Rejected"
10
+ }
11
+
12
+ export enum UpdateAttendenceReason {
13
+ MEETING = "Meeting",
14
+ EARLY_CHECKOUT = "Early Checkout",
15
+ SPECIAL_REASON = "Special Reason"
16
+ }
17
+
18
+ @Entity({ name: 'update_attendence_requests' })
19
+ export class UpdateAttendanceRequests extends BaseModel {
20
+
21
+ @Column({ type: 'int', nullable: true })
22
+ req_user_department_id: number | null;
23
+
24
+ @Column({ type: 'int', nullable: true })
25
+ req_user_section_id: number | null;
26
+
27
+ @Column({ type: 'int', nullable: true })
28
+ service_id: number | null;
29
+
30
+ @Column({ type: 'int', nullable: true })
31
+ sub_service_id: number | null;
32
+
33
+ @Column({ type: 'int', nullable: false })
34
+ user_id: number;
35
+
36
+ @Column({ type: 'date', nullable: true })
37
+ from_date: string | null;
38
+
39
+ @Column({ type: 'date', nullable: true })
40
+ to_date: string | null;
41
+
42
+ @Column({ type: 'time', nullable: true })
43
+ from_time: string | null;
44
+
45
+ @Column({ type: 'time', nullable: true })
46
+ to_time: string | null;
47
+
48
+
49
+ // New columns
50
+ @Column({ type: 'enum', enum: UpdateAttendenceReason, nullable: false })
51
+ reason: UpdateAttendenceReason;
52
+
53
+ @Column({ type: 'varchar', length: 500, nullable: true })
54
+ comments: string | null;
55
+
56
+ @Column({ type: 'enum', enum: UpdateAttendenceStatus, default: UpdateAttendenceStatus.PENDING, nullable: false })
57
+ status: UpdateAttendenceStatus;
58
+
59
+ @Column({ type: 'varchar', nullable: true })
60
+ workflow_execution_id: string | null;
61
+ }
62
+
63
+
@@ -0,0 +1,28 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum UpdateAttendanceWorkFlowStatus {
5
+ COMPLETED = "Completed",
6
+ NOT_YET_STARTED = "Not Yet Started",
7
+ PENDING = "Pending"
8
+ }
9
+
10
+ @Entity({ name: 'update_attendance_workflows' })
11
+ export class UpdateAttendanceWorkFlow extends BaseModel {
12
+ @Column({ type: 'integer', nullable: false })
13
+ request_id: number;
14
+
15
+ @Column({ type: 'integer', nullable: true })
16
+ service_id: number | null;
17
+
18
+ @Column({ type: 'integer', nullable: true })
19
+ sub_service_id: number | null;
20
+
21
+ @Column({ type: 'varchar', length: 500, nullable: false })
22
+ content: string;
23
+
24
+ @Column({ type: 'enum', enum: UpdateAttendanceWorkFlowStatus, default: UpdateAttendanceWorkFlowStatus.NOT_YET_STARTED, nullable: false })
25
+ status: UpdateAttendanceWorkFlowStatus;
26
+ }
27
+
28
+
@@ -1,5 +1,19 @@
1
1
  import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";
2
2
  import { BaseModel } from './BaseModel';
3
+ import { TaskType } from "./WorkflowTaskNames";
4
+ import { CategoryType } from "./WorkflowTaskNames";
5
+
6
+
7
+ // export enum TaskNameType {
8
+ // SIMPLE = 'SIMPLE',
9
+ // HUMAN = 'HUMAN'
10
+ // }
11
+
12
+ // export enum CategoryNameType {
13
+ // CREATE = 'CREATE',
14
+ // APPROVAL = 'APPROVAL',
15
+ // NOTIFICATION = 'NOTIFICATION'
16
+ // }
3
17
 
4
18
  @Entity({ name: 'workflow_tasks' })
5
19
  export class WorkflowTask extends BaseModel {
@@ -10,17 +24,30 @@ export class WorkflowTask extends BaseModel {
10
24
  @Column({ type: 'varchar', length: 100, nullable: false })
11
25
  name: string;
12
26
 
13
- @Column({ type: 'varchar', length: 200, nullable: true })
14
- task_type: string;
27
+ @Column({
28
+ type: 'enum',
29
+ enum: TaskType,
30
+ nullable: true
31
+ })
32
+ task_type: TaskType;
33
+
34
+ @Column({
35
+ type: 'enum',
36
+ enum: CategoryType,
37
+ nullable: true
38
+ })
39
+ category: CategoryType;
15
40
 
16
41
  constructor(
17
42
  name: string,
18
43
  task_id?: number,
19
- task_type?: string
44
+ task_type?: TaskType,
45
+ category?: CategoryType
20
46
  ) {
21
47
  super();
22
48
  this.name = name;
23
49
  this.task_id = task_id || 0;
24
- this.task_type = task_type || '';
50
+ this.task_type = task_type || TaskType.SIMPLE;
51
+ this.category = category || CategoryType.CREATE;
25
52
  }
26
53
  }
@@ -1,31 +1,50 @@
1
1
  import { Column, Entity } from "typeorm";
2
2
  import { BaseModel } from './BaseModel';
3
3
 
4
+ export enum TaskType {
5
+ SIMPLE = 'SIMPLE',
6
+ HUMAN = 'HUMAN'
7
+ }
8
+
9
+ export enum CategoryType {
10
+ CREATE = 'CREATE',
11
+ APPROVAL = 'APPROVAL',
12
+ NOTIFICATION = 'NOTIFICATION'
13
+ }
14
+
4
15
  @Entity({ name: 'workflow_task_names' })
5
16
  export class WorkflowTaskNames extends BaseModel {
6
17
 
7
18
  @Column({ type: 'varchar', length: 100, nullable: false })
8
19
  name: string;
9
-
10
- @Column({ type: 'integer', nullable: false })
11
- task_id: number;
12
20
 
13
21
  @Column({ type: 'varchar', length: 200, nullable: true })
14
22
  description: string;
15
23
 
16
- @Column({ type: 'varchar', length: 200, nullable: true })
17
- task_type: string;
24
+ @Column({
25
+ type: 'enum',
26
+ enum: TaskType,
27
+ nullable: true
28
+ })
29
+ task_type: TaskType;
30
+
31
+ @Column({
32
+ type: 'enum',
33
+ enum: CategoryType,
34
+ nullable: true
35
+ })
36
+ category: CategoryType;
18
37
 
19
38
  constructor(
20
39
  name: string,
21
- task_id: number,
22
40
  description: string,
23
- task_type: string
41
+ task_type: TaskType,
42
+ category: CategoryType
24
43
  ) {
25
44
  super();
26
45
  this.name = name;
27
- this.task_id = task_id;
28
46
  this.description = description;
29
47
  this.task_type = task_type;
48
+ this.category = category;
30
49
  }
31
50
  }
@@ -1,16 +0,0 @@
1
- import { BaseModel } from './BaseModel';
2
- export declare enum DiplomaticClubCardApprovalStatus {
3
- PENDING = "Pending",
4
- APPROVED = "Approved",
5
- REJECTED = "Rejected"
6
- }
7
- export declare class DiplomaticClubCardApprovals extends BaseModel {
8
- request_id: number;
9
- approver_user_id: number;
10
- approver_role_id: number | null;
11
- step_order: number;
12
- status: DiplomaticClubCardApprovalStatus;
13
- comments: string | null;
14
- approved_at: Date | null;
15
- rejected_at: Date | null;
16
- }
@@ -1,58 +0,0 @@
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.DiplomaticClubCardApprovals = exports.DiplomaticClubCardApprovalStatus = void 0;
13
- const typeorm_1 = require("typeorm");
14
- const BaseModel_1 = require("./BaseModel");
15
- var DiplomaticClubCardApprovalStatus;
16
- (function (DiplomaticClubCardApprovalStatus) {
17
- DiplomaticClubCardApprovalStatus["PENDING"] = "Pending";
18
- DiplomaticClubCardApprovalStatus["APPROVED"] = "Approved";
19
- DiplomaticClubCardApprovalStatus["REJECTED"] = "Rejected";
20
- })(DiplomaticClubCardApprovalStatus || (exports.DiplomaticClubCardApprovalStatus = DiplomaticClubCardApprovalStatus = {}));
21
- let DiplomaticClubCardApprovals = class DiplomaticClubCardApprovals extends BaseModel_1.BaseModel {
22
- };
23
- exports.DiplomaticClubCardApprovals = DiplomaticClubCardApprovals;
24
- __decorate([
25
- (0, typeorm_1.Column)({ type: 'int', nullable: false }),
26
- __metadata("design:type", Number)
27
- ], DiplomaticClubCardApprovals.prototype, "request_id", void 0);
28
- __decorate([
29
- (0, typeorm_1.Column)({ type: 'int', nullable: false }),
30
- __metadata("design:type", Number)
31
- ], DiplomaticClubCardApprovals.prototype, "approver_user_id", void 0);
32
- __decorate([
33
- (0, typeorm_1.Column)({ type: 'int', nullable: true }),
34
- __metadata("design:type", Object)
35
- ], DiplomaticClubCardApprovals.prototype, "approver_role_id", void 0);
36
- __decorate([
37
- (0, typeorm_1.Column)({ type: 'int', nullable: false, default: 0 }),
38
- __metadata("design:type", Number)
39
- ], DiplomaticClubCardApprovals.prototype, "step_order", void 0);
40
- __decorate([
41
- (0, typeorm_1.Column)({ type: 'enum', enum: DiplomaticClubCardApprovalStatus, default: DiplomaticClubCardApprovalStatus.PENDING, nullable: false }),
42
- __metadata("design:type", String)
43
- ], DiplomaticClubCardApprovals.prototype, "status", void 0);
44
- __decorate([
45
- (0, typeorm_1.Column)({ type: 'text', nullable: true }),
46
- __metadata("design:type", Object)
47
- ], DiplomaticClubCardApprovals.prototype, "comments", void 0);
48
- __decorate([
49
- (0, typeorm_1.Column)({ type: 'timestamp', nullable: true }),
50
- __metadata("design:type", Object)
51
- ], DiplomaticClubCardApprovals.prototype, "approved_at", void 0);
52
- __decorate([
53
- (0, typeorm_1.Column)({ type: 'timestamp', nullable: true }),
54
- __metadata("design:type", Object)
55
- ], DiplomaticClubCardApprovals.prototype, "rejected_at", void 0);
56
- exports.DiplomaticClubCardApprovals = DiplomaticClubCardApprovals = __decorate([
57
- (0, typeorm_1.Entity)({ name: 'diplomatic_club_card_approvals' })
58
- ], DiplomaticClubCardApprovals);
@@ -1,9 +0,0 @@
1
- import { BaseModel } from './BaseModel';
2
- export declare class DiplomaticClubCardAttachments extends BaseModel {
3
- request_id: number;
4
- member_id: number | null;
5
- file_name: string;
6
- file_path: string;
7
- file_type: string | null;
8
- attachment_type: string | null;
9
- }