@platform-modules/foreign-ministry 1.3.258 → 1.3.259

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 (37) hide show
  1. package/.env +3 -15
  2. package/dist/index.d.ts +6 -0
  3. package/dist/index.js +6 -0
  4. package/dist/models/AnnualTravelTicketRequestModel.d.ts +40 -0
  5. package/dist/models/AnnualTravelTicketRequestModel.js +115 -0
  6. package/dist/models/EmbassyMasterModel.d.ts +16 -0
  7. package/dist/models/EmbassyMasterModel.js +75 -0
  8. package/dist/models/MissionBankAccountApprovalModel.d.ts +22 -0
  9. package/dist/models/MissionBankAccountApprovalModel.js +79 -0
  10. package/dist/models/MissionBankAccountAttachmentModel.d.ts +11 -0
  11. package/dist/models/MissionBankAccountAttachmentModel.js +52 -0
  12. package/dist/models/MissionBankAccountChatModel.d.ts +18 -0
  13. package/dist/models/MissionBankAccountChatModel.js +65 -0
  14. package/dist/models/MissionBankAccountRequestModel.d.ts +29 -0
  15. package/dist/models/MissionBankAccountRequestModel.js +90 -0
  16. package/dist/models/MissionBankAccountWorkflowModel.d.ts +17 -0
  17. package/dist/models/MissionBankAccountWorkflowModel.js +62 -0
  18. package/dist/models/ResignationTerminationRequestModel.d.ts +1 -0
  19. package/dist/models/ResignationTerminationRequestModel.js +4 -0
  20. package/dist/models/UserDependentsModel.d.ts +18 -0
  21. package/dist/models/UserDependentsModel.js +94 -0
  22. package/package.json +1 -1
  23. package/src/index.ts +421 -415
  24. package/src/models/AnnualTravelTicketRequestModel.ts +87 -0
  25. package/src/models/FinancialWorkFlowModel.ts +15 -15
  26. package/src/models/GatePassVisitorsModel.ts +7 -7
  27. package/src/models/MissionBankAccountApprovalModel.ts +51 -0
  28. package/src/models/MissionBankAccountAttachmentModel.ts +30 -0
  29. package/src/models/MissionBankAccountChatModel.ts +43 -0
  30. package/src/models/MissionBankAccountRequestModel.ts +62 -0
  31. package/src/models/MissionBankAccountWorkflowModel.ts +38 -0
  32. package/src/models/PollOptionsModel.ts +26 -26
  33. package/src/models/PollVotesModel.ts +37 -37
  34. package/src/models/PollsModel.ts +49 -49
  35. package/src/models/ResignationTerminationApprovalModel.ts +9 -9
  36. package/src/models/ResignationTerminationRequestModel.ts +17 -14
  37. package/src/models/TelephoneDirectoryModel.ts +20 -20
@@ -0,0 +1,87 @@
1
+ import { Column, Entity } from 'typeorm';
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum AnnualTravelTicketPermanentResidence {
5
+ SALALAH = 'Salalah',
6
+ MUSANDAM = 'Musandam',
7
+ }
8
+
9
+ /** Aligns with mission bank account request lifecycle for shared workflow UI. */
10
+ export enum AnnualTravelTicketRequestStatus {
11
+ PENDING = 'Pending',
12
+ ASSIGNED = 'Assigned',
13
+ IN_PROGRESS = 'In Progress',
14
+ APPROVED = 'Approved',
15
+ REJECTED = 'Rejected',
16
+ }
17
+
18
+ @Entity({ name: 'annual_travel_ticket_requests' })
19
+ export class AnnualTravelTicketRequests extends BaseModel {
20
+ @Column({ type: 'int', nullable: true })
21
+ req_user_department_id: number | null;
22
+
23
+ @Column({ type: 'int', nullable: true })
24
+ req_user_section_id: number | null;
25
+
26
+ @Column({ type: 'int', nullable: true })
27
+ service_id: number | null;
28
+
29
+ @Column({ type: 'int', nullable: true })
30
+ sub_service_id: number | null;
31
+
32
+ @Column({ type: 'int', nullable: false })
33
+ user_id: number;
34
+
35
+ /** Applicant / primary traveler name as entered on the form. */
36
+ @Column({ type: 'varchar', length: 255, nullable: false })
37
+ applicant_name: string;
38
+
39
+ @Column({ type: 'varchar', length: 120, nullable: false })
40
+ civil_id_or_passport_number: string;
41
+
42
+ @Column({ type: 'enum', enum: AnnualTravelTicketPermanentResidence, nullable: false })
43
+ permanent_residence: AnnualTravelTicketPermanentResidence;
44
+
45
+ /** Free-text family context (dependents covered by the request). */
46
+ @Column({ type: 'text', nullable: true })
47
+ family_details: string | null;
48
+
49
+ @Column({ type: 'decimal', precision: 12, scale: 2, nullable: true })
50
+ children_ticket_price: string | number | null;
51
+
52
+ @Column({ type: 'decimal', precision: 12, scale: 2, nullable: true })
53
+ employee_spouse_ticket_price: string | number | null;
54
+
55
+ @Column({ type: 'varchar', length: 100, nullable: false })
56
+ bank_account_number: string;
57
+
58
+ @Column({ type: 'text', nullable: false })
59
+ travel_details: string;
60
+
61
+ /** Calendar year this entitlement applies to (one ticket per person per year). */
62
+ @Column({ type: 'int', nullable: false })
63
+ ticket_entitlement_year: number;
64
+
65
+ /** Optional structured travelers (e.g. children) for age rules; JSON array. */
66
+ @Column({ type: 'jsonb', nullable: true })
67
+ children_travelers_json: Record<string, unknown>[] | null;
68
+
69
+ /** Client confirms dependents match HR/profile before submit. */
70
+ @Column({ type: 'boolean', default: false, nullable: false })
71
+ profile_children_synced_with_profile: boolean;
72
+
73
+ /** Notes on unused ticket carry-forward (max 7 years; children until age 21). */
74
+ @Column({ type: 'text', nullable: true })
75
+ carry_forward_notes: string | null;
76
+
77
+ @Column({
78
+ type: 'enum',
79
+ enum: AnnualTravelTicketRequestStatus,
80
+ default: AnnualTravelTicketRequestStatus.PENDING,
81
+ nullable: false,
82
+ })
83
+ status: AnnualTravelTicketRequestStatus;
84
+
85
+ @Column({ type: 'varchar', nullable: true })
86
+ workflow_execution_id: string | null;
87
+ }
@@ -33,15 +33,15 @@ export class FinancialWorkFlow extends BaseModel {
33
33
  @Column({ type: 'int', nullable: true })
34
34
  approved_by_role_id: number;
35
35
 
36
- @Column({ type: 'int', nullable: true })
37
- step_order: number;
38
-
39
- @Column({ type: 'varchar', length: 50, nullable: true })
40
- action: string | null;
41
-
42
- @ManyToOne(() => FinancialRequests, fr => fr.workflows)
43
- @JoinColumn({ name: 'financial_request_id' })
44
- financialRequest?: FinancialRequests;
36
+ @Column({ type: 'int', nullable: true })
37
+ step_order: number;
38
+
39
+ @Column({ type: 'varchar', length: 50, nullable: true })
40
+ action: string | null;
41
+
42
+ @ManyToOne(() => FinancialRequests, fr => fr.workflows)
43
+ @JoinColumn({ name: 'financial_request_id' })
44
+ financialRequest?: FinancialRequests;
45
45
 
46
46
  constructor(
47
47
  financial_request_id: number,
@@ -55,10 +55,10 @@ export class FinancialWorkFlow extends BaseModel {
55
55
  this.status = status;
56
56
  this.approved_by_user_id = approved_by_user_id;
57
57
  this.content = content;
58
- this.financial_approval_id = 0;
59
- this.activity_date = new Date();
60
- this.step_order = step_order;
61
- this.action = null;
62
- }
63
- }
58
+ this.financial_approval_id = 0;
59
+ this.activity_date = new Date();
60
+ this.step_order = step_order;
61
+ this.action = null;
62
+ }
63
+ }
64
64
 
@@ -85,10 +85,10 @@ export class GatePassVisitors extends BaseModel {
85
85
  @Column({ type: 'varchar', length: 255, nullable: true })
86
86
  visiting_person_in_department: string | null; // زائر في القسم (Visiting Person in Department)
87
87
 
88
- @Column({ type: 'int', nullable: true, unique: true })
89
- serial_number: number | null;
90
-
91
- // QR Code for Gate Pass
88
+ @Column({ type: 'int', nullable: true, unique: true })
89
+ serial_number: number | null;
90
+
91
+ // QR Code for Gate Pass
92
92
  @Column({ type: 'text', nullable: true })
93
93
  qr_code_url: string | null; // QR code URL for this visitor (data URL can be 6000+ characters)
94
94
 
@@ -134,9 +134,9 @@ export class GatePassVisitors extends BaseModel {
134
134
  this.visitor_email_address = visitor_email_address;
135
135
  this.visitor_mobile_number = visitor_mobile_number;
136
136
  this.visitor_photo_url = visitor_photo_url;
137
- this.visitor_photo_file_name = visitor_photo_file_name;
138
- this.serial_number = null;
139
- this.gate_pass_generated = false;
137
+ this.visitor_photo_file_name = visitor_photo_file_name;
138
+ this.serial_number = null;
139
+ this.gate_pass_generated = false;
140
140
  this.email_sent = false;
141
141
  }
142
142
  }
@@ -0,0 +1,51 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum MissionBankAccountApprovalStatus {
5
+ PENDING = "Pending",
6
+ IN_PROGRESS = "In Progress",
7
+ APPROVED = "Approved",
8
+ REJECTED = "Rejected"
9
+ }
10
+
11
+ @Entity({ name: 'mission_bank_account_approvals' })
12
+ export class MissionBankAccountApprovalDetails 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: false })
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: MissionBankAccountApprovalStatus, default: MissionBankAccountApprovalStatus.PENDING, nullable: false })
47
+ approval_status: MissionBankAccountApprovalStatus;
48
+
49
+ @Column({ type: 'boolean', default: true, nullable: false })
50
+ is_allowed: boolean;
51
+ }
@@ -0,0 +1,30 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ @Entity({ name: 'mission_bank_account_attachments' })
5
+ export class MissionBankAccountRequestAttachment extends BaseModel {
6
+
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: 500, nullable: false })
17
+ file_url: string;
18
+
19
+ @Column({ type: 'varchar', length: 255, nullable: true })
20
+ file_name: string;
21
+
22
+ @Column({ type: 'varchar', length: 100, nullable: true })
23
+ file_type: string;
24
+
25
+ @Column({ type: 'bigint', nullable: true })
26
+ file_size: number | null;
27
+
28
+ @Column({ type: 'integer', nullable: true })
29
+ chat_id: number | null;
30
+ }
@@ -0,0 +1,43 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum MissionBankAccountMessageType {
5
+ TEXT = "text",
6
+ IMAGE = "image",
7
+ VIDEO = "video",
8
+ FILE = "file",
9
+ LINK = "link"
10
+ }
11
+
12
+ @Entity({ name: 'mission_bank_account_chats' })
13
+ export class MissionBankAccountRequestChat 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: 'integer', nullable: true })
28
+ role_id: number | null;
29
+
30
+ @Column({ type: 'text', nullable: false })
31
+ message: string;
32
+
33
+ @Column({
34
+ type: 'enum',
35
+ enum: MissionBankAccountMessageType,
36
+ default: MissionBankAccountMessageType.TEXT,
37
+ nullable: false
38
+ })
39
+ messageType: MissionBankAccountMessageType;
40
+
41
+ @Column({ type: 'text', nullable: true })
42
+ status: string;
43
+ }
@@ -0,0 +1,62 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum MissionBankAccountRequestType {
5
+ OPEN = "Open",
6
+ CLOSE = "Close",
7
+ CHANGE = "Change"
8
+ }
9
+
10
+ export enum MissionBankAccountRequestStatus {
11
+ PENDING = "Pending",
12
+ ASSIGNED = "Assigned",
13
+ IN_PROGRESS = "In Progress",
14
+ APPROVED = "Approved",
15
+ REJECTED = "Rejected"
16
+ }
17
+
18
+ @Entity({ name: 'mission_bank_account_requests' })
19
+ export class MissionBankAccountRequests 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: 'enum', enum: MissionBankAccountRequestType, nullable: false })
37
+ request_type: MissionBankAccountRequestType;
38
+
39
+ @Column({ type: 'varchar', length: 255, nullable: false })
40
+ bank_name: string;
41
+
42
+ @Column({ type: 'varchar', length: 255, nullable: true })
43
+ branch: string | null;
44
+
45
+ @Column({ type: 'varchar', length: 500, nullable: true })
46
+ location_of_mc: string | null;
47
+
48
+ @Column({ type: 'varchar', length: 100, nullable: true })
49
+ account_number: string | null;
50
+
51
+ @Column({ type: 'date', nullable: true })
52
+ opening_closing_date: Date | string | null;
53
+
54
+ @Column({ type: 'text', nullable: false })
55
+ reason: string;
56
+
57
+ @Column({ type: 'enum', enum: MissionBankAccountRequestStatus, default: MissionBankAccountRequestStatus.PENDING, nullable: false })
58
+ status: MissionBankAccountRequestStatus;
59
+
60
+ @Column({ type: 'varchar', nullable: true })
61
+ workflow_execution_id: string | null;
62
+ }
@@ -0,0 +1,38 @@
1
+ import { Column, Entity } from "typeorm";
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ export enum MissionBankAccountWorkFlowStatus {
5
+ COMPLETED = "Completed",
6
+ NOT_YET_STARTED = "Not Yet Started",
7
+ PENDING = "Pending"
8
+ }
9
+
10
+ @Entity({ name: 'mission_bank_account_workflows' })
11
+ export class MissionBankAccountWorkFlow 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: MissionBankAccountWorkFlowStatus, default: MissionBankAccountWorkFlowStatus.NOT_YET_STARTED, nullable: false })
25
+ status: MissionBankAccountWorkFlowStatus;
26
+
27
+ @Column({ type: 'integer', nullable: true })
28
+ user_id: number | null;
29
+
30
+ @Column({ type: 'integer', nullable: true })
31
+ role_id: number | null;
32
+
33
+ @Column({ type: 'integer', nullable: true })
34
+ department_id: number | null;
35
+
36
+ @Column({ type: 'integer', nullable: true })
37
+ section_id: number | null;
38
+ }
@@ -1,26 +1,26 @@
1
- import { Column, Entity, JoinColumn, ManyToOne, OneToMany } from "typeorm";
2
- import { BaseModel } from "./BaseModel";
3
- import { Poll } from "./PollsModel";
4
- import { PollVote } from "./PollVotesModel";
5
-
6
- @Entity({ name: "poll_options" })
7
- export class PollOption extends BaseModel {
8
- @Column({ type: "int", nullable: false })
9
- poll_id: number;
10
-
11
- @Column({ type: "varchar", length: 500, nullable: false })
12
- option_text: string;
13
-
14
- @ManyToOne(() => Poll, (poll) => poll.options, { nullable: false })
15
- @JoinColumn({ name: "poll_id" })
16
- poll?: Poll;
17
-
18
- @OneToMany(() => PollVote, (vote) => vote.option)
19
- votes?: PollVote[];
20
-
21
- constructor() {
22
- super();
23
- this.poll_id = 0;
24
- this.option_text = "";
25
- }
26
- }
1
+ import { Column, Entity, JoinColumn, ManyToOne, OneToMany } from "typeorm";
2
+ import { BaseModel } from "./BaseModel";
3
+ import { Poll } from "./PollsModel";
4
+ import { PollVote } from "./PollVotesModel";
5
+
6
+ @Entity({ name: "poll_options" })
7
+ export class PollOption extends BaseModel {
8
+ @Column({ type: "int", nullable: false })
9
+ poll_id: number;
10
+
11
+ @Column({ type: "varchar", length: 500, nullable: false })
12
+ option_text: string;
13
+
14
+ @ManyToOne(() => Poll, (poll) => poll.options, { nullable: false })
15
+ @JoinColumn({ name: "poll_id" })
16
+ poll?: Poll;
17
+
18
+ @OneToMany(() => PollVote, (vote) => vote.option)
19
+ votes?: PollVote[];
20
+
21
+ constructor() {
22
+ super();
23
+ this.poll_id = 0;
24
+ this.option_text = "";
25
+ }
26
+ }
@@ -1,37 +1,37 @@
1
- import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
2
- import { BaseModel } from "./BaseModel";
3
- import { Poll } from "./PollsModel";
4
- import { PollOption } from "./PollOptionsModel";
5
- import { User } from "./user";
6
-
7
- @Entity({ name: "poll_votes" })
8
- @Index("uq_poll_option_user", ["poll_id", "option_id", "user_id"], { unique: true })
9
- export class PollVote extends BaseModel {
10
- @Column({ type: "int", nullable: false })
11
- poll_id: number;
12
-
13
- @Column({ type: "int", nullable: false })
14
- option_id: number;
15
-
16
- @Column({ type: "int", nullable: false })
17
- user_id: number;
18
-
19
- @ManyToOne(() => Poll, (poll) => poll.votes, { nullable: false })
20
- @JoinColumn({ name: "poll_id" })
21
- poll?: Poll;
22
-
23
- @ManyToOne(() => PollOption, (option) => option.votes, { nullable: false })
24
- @JoinColumn({ name: "option_id" })
25
- option?: PollOption;
26
-
27
- @ManyToOne(() => User, { nullable: false })
28
- @JoinColumn({ name: "user_id" })
29
- user?: User;
30
-
31
- constructor() {
32
- super();
33
- this.poll_id = 0;
34
- this.option_id = 0;
35
- this.user_id = 0;
36
- }
37
- }
1
+ import { Column, Entity, Index, JoinColumn, ManyToOne } from "typeorm";
2
+ import { BaseModel } from "./BaseModel";
3
+ import { Poll } from "./PollsModel";
4
+ import { PollOption } from "./PollOptionsModel";
5
+ import { User } from "./user";
6
+
7
+ @Entity({ name: "poll_votes" })
8
+ @Index("uq_poll_option_user", ["poll_id", "option_id", "user_id"], { unique: true })
9
+ export class PollVote extends BaseModel {
10
+ @Column({ type: "int", nullable: false })
11
+ poll_id: number;
12
+
13
+ @Column({ type: "int", nullable: false })
14
+ option_id: number;
15
+
16
+ @Column({ type: "int", nullable: false })
17
+ user_id: number;
18
+
19
+ @ManyToOne(() => Poll, (poll) => poll.votes, { nullable: false })
20
+ @JoinColumn({ name: "poll_id" })
21
+ poll?: Poll;
22
+
23
+ @ManyToOne(() => PollOption, (option) => option.votes, { nullable: false })
24
+ @JoinColumn({ name: "option_id" })
25
+ option?: PollOption;
26
+
27
+ @ManyToOne(() => User, { nullable: false })
28
+ @JoinColumn({ name: "user_id" })
29
+ user?: User;
30
+
31
+ constructor() {
32
+ super();
33
+ this.poll_id = 0;
34
+ this.option_id = 0;
35
+ this.user_id = 0;
36
+ }
37
+ }
@@ -1,49 +1,49 @@
1
- import { Column, Entity, JoinColumn, ManyToOne, OneToMany } from "typeorm";
2
- import { BaseModel } from "./BaseModel";
3
- import { ConversationsV2 } from "./ConversationsV2Model";
4
- import { PollOption } from "./PollOptionsModel";
5
- import { PollVote } from "./PollVotesModel";
6
-
7
- @Entity({ name: "poll" })
8
- export class Poll extends BaseModel {
9
- @Column({ type: "int", nullable: false })
10
- group_id: number;
11
-
12
- @Column({ type: "int", nullable: true })
13
- meeting_id?: number | null;
14
-
15
- @Column({ type: "int", nullable: false })
16
- conversation_id: number;
17
-
18
- @Column({ type: "varchar", length: 255, nullable: false })
19
- title: string;
20
-
21
- @Column({ type: "text", nullable: false })
22
- question: string;
23
-
24
- @Column({ type: "timestamptz", nullable: true })
25
- expires_at?: Date | null;
26
-
27
- @Column({ type: "boolean", default: false })
28
- allow_multiple: boolean;
29
-
30
- @ManyToOne(() => ConversationsV2, { nullable: false })
31
- @JoinColumn({ name: "conversation_id" })
32
- conversation?: ConversationsV2;
33
-
34
- @OneToMany(() => PollOption, (option) => option.poll)
35
- options?: PollOption[];
36
-
37
- @OneToMany(() => PollVote, (vote) => vote.poll)
38
- votes?: PollVote[];
39
-
40
- constructor() {
41
- super();
42
- this.group_id = 0;
43
- this.meeting_id = null;
44
- this.conversation_id = 0;
45
- this.title = "";
46
- this.question = "";
47
- this.allow_multiple = false;
48
- }
49
- }
1
+ import { Column, Entity, JoinColumn, ManyToOne, OneToMany } from "typeorm";
2
+ import { BaseModel } from "./BaseModel";
3
+ import { ConversationsV2 } from "./ConversationsV2Model";
4
+ import { PollOption } from "./PollOptionsModel";
5
+ import { PollVote } from "./PollVotesModel";
6
+
7
+ @Entity({ name: "poll" })
8
+ export class Poll extends BaseModel {
9
+ @Column({ type: "int", nullable: false })
10
+ group_id: number;
11
+
12
+ @Column({ type: "int", nullable: true })
13
+ meeting_id?: number | null;
14
+
15
+ @Column({ type: "int", nullable: false })
16
+ conversation_id: number;
17
+
18
+ @Column({ type: "varchar", length: 255, nullable: false })
19
+ title: string;
20
+
21
+ @Column({ type: "text", nullable: false })
22
+ question: string;
23
+
24
+ @Column({ type: "timestamptz", nullable: true })
25
+ expires_at?: Date | null;
26
+
27
+ @Column({ type: "boolean", default: false })
28
+ allow_multiple: boolean;
29
+
30
+ @ManyToOne(() => ConversationsV2, { nullable: false })
31
+ @JoinColumn({ name: "conversation_id" })
32
+ conversation?: ConversationsV2;
33
+
34
+ @OneToMany(() => PollOption, (option) => option.poll)
35
+ options?: PollOption[];
36
+
37
+ @OneToMany(() => PollVote, (vote) => vote.poll)
38
+ votes?: PollVote[];
39
+
40
+ constructor() {
41
+ super();
42
+ this.group_id = 0;
43
+ this.meeting_id = null;
44
+ this.conversation_id = 0;
45
+ this.title = "";
46
+ this.question = "";
47
+ this.allow_multiple = false;
48
+ }
49
+ }
@@ -43,12 +43,12 @@ export class ResignationTerminationApprovalDetails extends BaseModel {
43
43
  @Column({ type: 'varchar', length: 500, nullable: true, default: '' })
44
44
  comment: string;
45
45
 
46
- @Column({ type: 'enum', enum: ResignationTerminationApprovalStatus, default: ResignationTerminationApprovalStatus.PENDING, nullable: false })
47
- approval_status: ResignationTerminationApprovalStatus;
48
-
49
- @Column({ type: 'boolean', default: false, nullable: false })
50
- is_edit: boolean;
51
-
52
- @Column({ type: 'boolean', default: true, nullable: false })
53
- is_allowed: boolean;
54
- }
46
+ @Column({ type: 'enum', enum: ResignationTerminationApprovalStatus, default: ResignationTerminationApprovalStatus.PENDING, nullable: false })
47
+ approval_status: ResignationTerminationApprovalStatus;
48
+
49
+ @Column({ type: 'boolean', default: false, nullable: false })
50
+ is_edit: boolean;
51
+
52
+ @Column({ type: 'boolean', default: true, nullable: false })
53
+ is_allowed: boolean;
54
+ }
@@ -16,24 +16,27 @@ export class ResignationTerminationRequests extends BaseModel {
16
16
  @Column({ type: 'int', nullable: true })
17
17
  req_user_department_id: number | null;
18
18
 
19
- @Column({ type: 'int', nullable: true })
20
- req_user_section_id: number | null;
21
-
22
- @Column({ type: 'int', nullable: true })
23
- service_id: number | null;
19
+ @Column({ type: 'int', nullable: true })
20
+ req_user_section_id: number | null;
21
+
22
+ @Column({ type: 'int', nullable: true })
23
+ department_id: number | null;
24
+
25
+ @Column({ type: 'int', nullable: true })
26
+ service_id: number | null;
24
27
 
25
28
  @Column({ type: 'int', nullable: true })
26
29
  sub_service_id: number | null;
27
30
 
28
- @Column({ type: 'int', nullable: false })
29
- user_id: number;
30
-
31
- @Column({ type: 'int', nullable: true })
32
- employee_id: number | null; // Target employee user ID
33
-
34
- // Resignation/Termination specific fields
35
- @Column({ type: 'varchar', length: 50, nullable: true })
36
- employee_type: string | null; // FM / M&C
31
+ @Column({ type: 'int', nullable: false })
32
+ user_id: number;
33
+
34
+ @Column({ type: 'int', nullable: true })
35
+ employee_id: number | null; // Target employee user ID
36
+
37
+ // Resignation/Termination specific fields
38
+ @Column({ type: 'varchar', length: 50, nullable: true })
39
+ employee_type: string | null; // FM / M&C
37
40
 
38
41
  @Column({ type: 'varchar', length: 255, nullable: true })
39
42
  employee_name: string | null;