@platform-modules/foreign-ministry 1.3.196 → 1.3.199

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 (48) hide show
  1. package/.env +3 -17
  2. package/dist/data-source.js +14 -0
  3. package/dist/index.d.ts +7 -0
  4. package/dist/index.js +7 -0
  5. package/dist/models/ConversationsV2Model.d.ts +2 -0
  6. package/dist/models/ConversationsV2Model.js +10 -0
  7. package/dist/models/EmbassyMasterModel.d.ts +16 -0
  8. package/dist/models/EmbassyMasterModel.js +75 -0
  9. package/dist/models/MessagesV2Model.d.ts +3 -1
  10. package/dist/models/MessagesV2Model.js +5 -0
  11. package/dist/models/PollOptionsModel.d.ts +10 -0
  12. package/dist/models/PollOptionsModel.js +45 -0
  13. package/dist/models/PollVotesModel.d.ts +13 -0
  14. package/dist/models/PollVotesModel.js +58 -0
  15. package/dist/models/PollsModel.d.ts +17 -0
  16. package/dist/models/PollsModel.js +74 -0
  17. package/dist/models/ProjectMilestoneDocumentsModel.d.ts +10 -0
  18. package/dist/models/ProjectMilestoneDocumentsModel.js +54 -0
  19. package/dist/models/ProjectTaskActivityModel.d.ts +9 -0
  20. package/dist/models/ProjectTaskActivityModel.js +49 -0
  21. package/dist/models/ProjectTaskCommentsModel.d.ts +6 -0
  22. package/dist/models/{questionTagsModel.js → ProjectTaskCommentsModel.js} +16 -16
  23. package/dist/models/ProjectTasksModel.d.ts +24 -0
  24. package/dist/models/ProjectTasksModel.js +86 -0
  25. package/dist/models/UserDependentsModel.d.ts +18 -0
  26. package/dist/models/UserDependentsModel.js +94 -0
  27. package/package.json +1 -1
  28. package/src/data-source.ts +14 -0
  29. package/src/index.ts +8 -1
  30. package/src/models/ConversationsV2Model.ts +8 -0
  31. package/src/models/MessagesV2Model.ts +5 -1
  32. package/src/models/PollOptionsModel.ts +26 -0
  33. package/src/models/PollVotesModel.ts +37 -0
  34. package/src/models/PollsModel.ts +49 -0
  35. package/src/models/ProjectMilestoneDocumentsModel.ts +40 -0
  36. package/src/models/ProjectTaskActivityModel.ts +35 -0
  37. package/src/models/ProjectTaskCommentsModel.ts +17 -0
  38. package/src/models/ProjectTasksModel.ts +80 -0
  39. package/src/models/RegisterCandidateRequestModel.ts +183 -183
  40. package/src/models/TelephoneDirectoryModel.ts +20 -20
  41. package/dist/models/HelpContentMappedCategoriesModel.d.ts +0 -6
  42. package/dist/models/HelpContentMappedCategoriesModel.js +0 -34
  43. package/dist/models/HelpContentMappedTagsModel.d.ts +0 -6
  44. package/dist/models/HelpContentMappedTagsModel.js +0 -34
  45. package/dist/models/HelpContentTagsModel.d.ts +0 -5
  46. package/dist/models/HelpContentTagsModel.js +0 -29
  47. package/dist/models/questionTagsModel.d.ts +0 -6
  48. /package/src/models/{LeaveConfigGradesModel.ts → LeaveConfigGradesModel.Ts} +0 -0
@@ -9,26 +9,26 @@ 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.QuestionTags = void 0;
12
+ exports.ProjectTaskComments = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const BaseModel_1 = require("./BaseModel");
15
- let QuestionTags = class QuestionTags extends BaseModel_1.BaseModel {
16
- constructor(name, question_Id) {
15
+ let ProjectTaskComments = class ProjectTaskComments extends BaseModel_1.BaseModel {
16
+ constructor(task_id, comment) {
17
17
  super();
18
- this.name = name,
19
- this.question_Id = question_Id;
18
+ this.task_id = task_id ?? 0;
19
+ this.comment = comment ?? '';
20
20
  }
21
21
  };
22
- exports.QuestionTags = QuestionTags;
22
+ exports.ProjectTaskComments = ProjectTaskComments;
23
23
  __decorate([
24
- (0, typeorm_1.Column)({ nullable: true }),
25
- __metadata("design:type", String)
26
- ], QuestionTags.prototype, "name", void 0);
27
- __decorate([
28
- (0, typeorm_1.Column)({ nullable: true }),
24
+ (0, typeorm_1.Column)({ type: 'int' }),
29
25
  __metadata("design:type", Number)
30
- ], QuestionTags.prototype, "question_Id", void 0);
31
- exports.QuestionTags = QuestionTags = __decorate([
32
- (0, typeorm_1.Entity)({ name: 'question_tags' }),
33
- __metadata("design:paramtypes", [String, Number])
34
- ], QuestionTags);
26
+ ], ProjectTaskComments.prototype, "task_id", void 0);
27
+ __decorate([
28
+ (0, typeorm_1.Column)({ type: 'text' }),
29
+ __metadata("design:type", String)
30
+ ], ProjectTaskComments.prototype, "comment", void 0);
31
+ exports.ProjectTaskComments = ProjectTaskComments = __decorate([
32
+ (0, typeorm_1.Entity)({ name: 'project_task_comments' }),
33
+ __metadata("design:paramtypes", [Number, String])
34
+ ], ProjectTaskComments);
@@ -0,0 +1,24 @@
1
+ import { BaseModel } from './BaseModel';
2
+ export interface TaskAttachmentItem {
3
+ link?: string;
4
+ filename?: string;
5
+ filesize?: number;
6
+ filetype?: string;
7
+ }
8
+ export declare const TASK_PRIORITY: readonly ["low", "medium", "high"];
9
+ export declare const TASK_STATUS: readonly ["Not started", "Pending", "In Progress", "Completed"];
10
+ export declare class ProjectTasks extends BaseModel {
11
+ project_id: number;
12
+ task_title: string;
13
+ task_description: string;
14
+ attachments: TaskAttachmentItem[] | null;
15
+ priority: string;
16
+ status: string;
17
+ milestone_id: number | null;
18
+ phase: number;
19
+ assign_to: number | null;
20
+ manager_id: number | null;
21
+ start_date: Date | null;
22
+ end_date: Date | null;
23
+ constructor(project_id?: number, task_title?: string, task_description?: string, attachments?: TaskAttachmentItem[] | null, priority?: string, status?: string, milestone_id?: number | null, phase?: number, assign_to?: number | null, manager_id?: number | null, start_date?: Date | null, end_date?: Date | null);
24
+ }
@@ -0,0 +1,86 @@
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.ProjectTasks = exports.TASK_STATUS = exports.TASK_PRIORITY = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ exports.TASK_PRIORITY = ['low', 'medium', 'high'];
16
+ exports.TASK_STATUS = ['Not started', 'Pending', 'In Progress', 'Completed'];
17
+ let ProjectTasks = class ProjectTasks extends BaseModel_1.BaseModel {
18
+ constructor(project_id, task_title, task_description, attachments, priority, status, milestone_id, phase, assign_to, manager_id, start_date, end_date) {
19
+ super();
20
+ this.project_id = project_id ?? 0;
21
+ this.task_title = task_title ?? '';
22
+ this.task_description = task_description ?? '';
23
+ this.attachments = attachments ?? null;
24
+ this.priority = priority ?? 'medium';
25
+ this.status = status ?? 'Not started';
26
+ this.milestone_id = milestone_id ?? null;
27
+ this.phase = phase ?? 1;
28
+ this.assign_to = assign_to ?? null;
29
+ this.manager_id = manager_id ?? null;
30
+ this.start_date = start_date ?? null;
31
+ this.end_date = end_date ?? null;
32
+ }
33
+ };
34
+ exports.ProjectTasks = ProjectTasks;
35
+ __decorate([
36
+ (0, typeorm_1.Column)({ type: 'int' }),
37
+ __metadata("design:type", Number)
38
+ ], ProjectTasks.prototype, "project_id", void 0);
39
+ __decorate([
40
+ (0, typeorm_1.Column)({ type: 'varchar', length: 500 }),
41
+ __metadata("design:type", String)
42
+ ], ProjectTasks.prototype, "task_title", void 0);
43
+ __decorate([
44
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
45
+ __metadata("design:type", String)
46
+ ], ProjectTasks.prototype, "task_description", void 0);
47
+ __decorate([
48
+ (0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
49
+ __metadata("design:type", Object)
50
+ ], ProjectTasks.prototype, "attachments", void 0);
51
+ __decorate([
52
+ (0, typeorm_1.Column)({ type: 'varchar', length: 20, default: 'medium' }),
53
+ __metadata("design:type", String)
54
+ ], ProjectTasks.prototype, "priority", void 0);
55
+ __decorate([
56
+ (0, typeorm_1.Column)({ type: 'varchar', length: 50, default: 'Not started' }),
57
+ __metadata("design:type", String)
58
+ ], ProjectTasks.prototype, "status", void 0);
59
+ __decorate([
60
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
61
+ __metadata("design:type", Object)
62
+ ], ProjectTasks.prototype, "milestone_id", void 0);
63
+ __decorate([
64
+ (0, typeorm_1.Column)({ type: 'int', default: 1, nullable: true }),
65
+ __metadata("design:type", Number)
66
+ ], ProjectTasks.prototype, "phase", void 0);
67
+ __decorate([
68
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
69
+ __metadata("design:type", Object)
70
+ ], ProjectTasks.prototype, "assign_to", void 0);
71
+ __decorate([
72
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
73
+ __metadata("design:type", Object)
74
+ ], ProjectTasks.prototype, "manager_id", void 0);
75
+ __decorate([
76
+ (0, typeorm_1.Column)({ type: 'date', nullable: true }),
77
+ __metadata("design:type", Object)
78
+ ], ProjectTasks.prototype, "start_date", void 0);
79
+ __decorate([
80
+ (0, typeorm_1.Column)({ type: 'date', nullable: true }),
81
+ __metadata("design:type", Object)
82
+ ], ProjectTasks.prototype, "end_date", void 0);
83
+ exports.ProjectTasks = ProjectTasks = __decorate([
84
+ (0, typeorm_1.Entity)({ name: 'project_tasks' }),
85
+ __metadata("design:paramtypes", [Number, String, String, Object, String, String, Object, Number, Object, Object, Object, Object])
86
+ ], ProjectTasks);
@@ -0,0 +1,18 @@
1
+ import { BaseModel } from './BaseModel';
2
+ export declare class UserDependents extends BaseModel {
3
+ user_id: number;
4
+ first_name: string | null;
5
+ last_name: string | null;
6
+ family_name: string | null;
7
+ dob: Date | null;
8
+ age: number | null;
9
+ relation_type: string | null;
10
+ passport_available: boolean;
11
+ passport_number: string | null;
12
+ passport_type: string | null;
13
+ passport_issue_date: Date | null;
14
+ passport_place_of_issue: string | null;
15
+ passport_expiry_date: Date | null;
16
+ is_active: boolean;
17
+ constructor(user_id?: number, first_name?: string, last_name?: string, family_name?: string, dob?: Date, age?: number, relation_type?: string, passport_available?: boolean, passport_number?: string, passport_type?: string, passport_issue_date?: Date, passport_place_of_issue?: string, passport_expiry_date?: Date);
18
+ }
@@ -0,0 +1,94 @@
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.UserDependents = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const BaseModel_1 = require("./BaseModel");
15
+ let UserDependents = class UserDependents extends BaseModel_1.BaseModel {
16
+ constructor(user_id, first_name, last_name, family_name, dob, age, relation_type, passport_available, passport_number, passport_type, passport_issue_date, passport_place_of_issue, passport_expiry_date) {
17
+ super();
18
+ this.user_id = user_id || 0;
19
+ this.first_name = first_name || null;
20
+ this.last_name = last_name || null;
21
+ this.family_name = family_name || null;
22
+ this.dob = dob || null;
23
+ this.age = age || null;
24
+ this.relation_type = relation_type || null;
25
+ this.passport_available = passport_available || false;
26
+ this.passport_number = passport_number || null;
27
+ this.passport_type = passport_type || null;
28
+ this.passport_issue_date = passport_issue_date || null;
29
+ this.passport_place_of_issue = passport_place_of_issue || null;
30
+ this.passport_expiry_date = passport_expiry_date || null;
31
+ this.is_active = true;
32
+ }
33
+ };
34
+ exports.UserDependents = UserDependents;
35
+ __decorate([
36
+ (0, typeorm_1.Column)({ type: 'int', nullable: false }),
37
+ __metadata("design:type", Number)
38
+ ], UserDependents.prototype, "user_id", void 0);
39
+ __decorate([
40
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
41
+ __metadata("design:type", Object)
42
+ ], UserDependents.prototype, "first_name", void 0);
43
+ __decorate([
44
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
45
+ __metadata("design:type", Object)
46
+ ], UserDependents.prototype, "last_name", void 0);
47
+ __decorate([
48
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
49
+ __metadata("design:type", Object)
50
+ ], UserDependents.prototype, "family_name", void 0);
51
+ __decorate([
52
+ (0, typeorm_1.Column)({ type: 'date', nullable: true }),
53
+ __metadata("design:type", Object)
54
+ ], UserDependents.prototype, "dob", void 0);
55
+ __decorate([
56
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
57
+ __metadata("design:type", Object)
58
+ ], UserDependents.prototype, "age", void 0);
59
+ __decorate([
60
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
61
+ __metadata("design:type", Object)
62
+ ], UserDependents.prototype, "relation_type", void 0);
63
+ __decorate([
64
+ (0, typeorm_1.Column)({ type: 'boolean', default: false }),
65
+ __metadata("design:type", Boolean)
66
+ ], UserDependents.prototype, "passport_available", void 0);
67
+ __decorate([
68
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
69
+ __metadata("design:type", Object)
70
+ ], UserDependents.prototype, "passport_number", void 0);
71
+ __decorate([
72
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
73
+ __metadata("design:type", Object)
74
+ ], UserDependents.prototype, "passport_type", void 0);
75
+ __decorate([
76
+ (0, typeorm_1.Column)({ type: 'date', nullable: true }),
77
+ __metadata("design:type", Object)
78
+ ], UserDependents.prototype, "passport_issue_date", void 0);
79
+ __decorate([
80
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
81
+ __metadata("design:type", Object)
82
+ ], UserDependents.prototype, "passport_place_of_issue", void 0);
83
+ __decorate([
84
+ (0, typeorm_1.Column)({ type: 'date', nullable: true }),
85
+ __metadata("design:type", Object)
86
+ ], UserDependents.prototype, "passport_expiry_date", void 0);
87
+ __decorate([
88
+ (0, typeorm_1.Column)({ type: 'boolean', default: true }),
89
+ __metadata("design:type", Boolean)
90
+ ], UserDependents.prototype, "is_active", void 0);
91
+ exports.UserDependents = UserDependents = __decorate([
92
+ (0, typeorm_1.Entity)({ name: 'user_dependents' }),
93
+ __metadata("design:paramtypes", [Number, String, String, String, Date, Number, String, Boolean, String, String, Date, String, Date])
94
+ ], UserDependents);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platform-modules/foreign-ministry",
3
- "version": "1.3.196",
3
+ "version": "1.3.199",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -47,6 +47,9 @@ import { ConversationsV2 } from './models/ConversationsV2Model';
47
47
  import { ConversationParticipantsV2 } from './models/ConversationParticipantsV2Model';
48
48
  import { MessagesV2 } from './models/MessagesV2Model';
49
49
  import { MessageReadStatus } from './models/MessageReadStatusModel';
50
+ import { Poll } from './models/PollsModel';
51
+ import { PollOption } from './models/PollOptionsModel';
52
+ import { PollVote } from './models/PollVotesModel';
50
53
  import { ShiftDetails } from './models/ShifttimesModel';
51
54
  import { AttendanceDetails } from './models/AttendanceModel';
52
55
  import { UserShift } from './models/UserShiftModel';
@@ -200,6 +203,10 @@ import { Gifts } from './models/GiftsModel';
200
203
  import { GiftAttachments } from './models/GiftAttachmentModel';
201
204
  import { Projects } from './models/ProjectModel';
202
205
  import { Templates } from './models/TemplateModel';
206
+ import { ProjectMilestoneDocuments } from './models/ProjectMilestoneDocumentsModel';
207
+ import { ProjectTasks } from './models/ProjectTasksModel';
208
+ import { ProjectTaskActivity } from './models/ProjectTaskActivityModel';
209
+ import { ProjectTaskComments } from './models/ProjectTaskCommentsModel';
203
210
  import { UniversalLanguageMaster } from './models/UniversalLanguageMasterModel';
204
211
  import { MeetingAppointmentReminderLog } from './models/MeetingAppointmentReminderLogModel';
205
212
 
@@ -254,6 +261,9 @@ export const AppDataSource = new DataSource({
254
261
  ConversationParticipantsV2,
255
262
  MessagesV2,
256
263
  MessageReadStatus,
264
+ Poll,
265
+ PollOption,
266
+ PollVote,
257
267
  ShiftDetails,
258
268
  AttendanceDetails,
259
269
  UserShift,
@@ -402,6 +412,10 @@ export const AppDataSource = new DataSource({
402
412
  GiftAttachments,
403
413
  Projects,
404
414
  Templates,
415
+ ProjectMilestoneDocuments,
416
+ ProjectTasks,
417
+ ProjectTaskActivity,
418
+ ProjectTaskComments,
405
419
  UniversalLanguageMaster,
406
420
  MeetingAppointmentReminderLog
407
421
  ],
package/src/index.ts CHANGED
@@ -26,6 +26,9 @@ export * from './models/ConversationsV2Model';
26
26
  export * from './models/ConversationParticipantsV2Model';
27
27
  export * from './models/MessagesV2Model';
28
28
  export * from './models/MessageReadStatusModel';
29
+ export * from './models/PollsModel';
30
+ export * from './models/PollOptionsModel';
31
+ export * from './models/PollVotesModel';
29
32
  export * from './models/FMServices';
30
33
  export * from './models/FMSubservices';
31
34
  export * from './models/serviceBookmarksModel';
@@ -310,6 +313,10 @@ export * from './models/ProjectResourceUsersModel';
310
313
  export * from './models/ProjectFaqModel';
311
314
  export * from './models/ProjectFaqReactionsModel';
312
315
  export * from './models/ProjectContactsModel';
316
+ export * from './models/ProjectMilestoneDocumentsModel';
317
+ export * from './models/ProjectTasksModel';
318
+ export * from './models/ProjectTaskActivityModel';
319
+ export * from './models/ProjectTaskCommentsModel';
313
320
 
314
321
  // Employee Milestones Models
315
322
  export * from './models/EmployeeMilestonesModel';
@@ -319,4 +326,4 @@ export * from './models/MissionTravelPassportExpiryNotificationConfigModel';
319
326
  export * from './models/ServicesNotificationConfigsModel';
320
327
  export { ServicesNotificationTriggerType } from './models/ServicesNotificationConfigsModel';
321
328
  // Moodle Users Model
322
- export * from './models/MoodleUsersModel';
329
+ export * from './models/MoodleUsersModel';
@@ -24,6 +24,12 @@ export class ConversationsV2 extends BaseModel {
24
24
  @Column({ type: 'int', nullable: true })
25
25
  meeting_id?: number | null;
26
26
 
27
+ @Column({ type: 'int', nullable: true })
28
+ appointment_id?: number | null;
29
+
30
+ @Column({ type: 'int', nullable: true })
31
+ project_id?: number | null;
32
+
27
33
  @Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
28
34
  last_message_at: Date;
29
35
 
@@ -38,6 +44,8 @@ export class ConversationsV2 extends BaseModel {
38
44
  super();
39
45
  this.conversation_type = ConversationTypeV2.DIRECT;
40
46
  this.meeting_id = null;
47
+ this.appointment_id = null;
48
+ this.project_id = null;
41
49
  this.last_message_at = new Date();
42
50
  }
43
51
  }
@@ -8,7 +8,8 @@ export enum MessageTypeV2 {
8
8
  TEXT = "text",
9
9
  IMAGE = "image",
10
10
  FILE = "file",
11
- VIDEO = "video"
11
+ VIDEO = "video",
12
+ POLL = "poll"
12
13
  }
13
14
 
14
15
  @Entity({ name: 'messages_v2' })
@@ -39,6 +40,9 @@ export class MessagesV2 extends BaseModel {
39
40
  @Column({ type: 'int', nullable: true })
40
41
  reply_to_message_id?: number;
41
42
 
43
+ @Column({ type: 'int', nullable: true })
44
+ reference_id?: number;
45
+
42
46
  // Relations
43
47
  @ManyToOne(() => ConversationsV2, conversation => conversation.messages)
44
48
  @JoinColumn({ name: 'conversation_id' })
@@ -0,0 +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
+ }
@@ -0,0 +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
+ }
@@ -0,0 +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
+ }
@@ -0,0 +1,40 @@
1
+ import { Column, Entity } from 'typeorm';
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ @Entity({ name: 'project_milestone_documents' })
5
+ export class ProjectMilestoneDocuments extends BaseModel {
6
+ @Column({ type: 'int' })
7
+ project_id: number;
8
+
9
+ @Column({ type: 'int' })
10
+ milestone_id: number;
11
+
12
+ @Column({ type: 'text', nullable: true })
13
+ document_link: string;
14
+
15
+ @Column({ type: 'varchar', length: 500, nullable: true })
16
+ filename: string;
17
+
18
+ @Column({ type: 'bigint', nullable: true })
19
+ filesize: number;
20
+
21
+ @Column({ type: 'varchar', length: 100, nullable: true })
22
+ filetype: string;
23
+
24
+ constructor(
25
+ project_id?: number,
26
+ milestone_id?: number,
27
+ document_link?: string,
28
+ filename?: string,
29
+ filesize?: number,
30
+ filetype?: string
31
+ ) {
32
+ super();
33
+ this.project_id = project_id ?? 0;
34
+ this.milestone_id = milestone_id ?? 0;
35
+ this.document_link = document_link ?? '';
36
+ this.filename = filename ?? '';
37
+ this.filesize = filesize ?? 0;
38
+ this.filetype = filetype ?? '';
39
+ }
40
+ }
@@ -0,0 +1,35 @@
1
+ import { Column, Entity } from 'typeorm';
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ @Entity({ name: 'project_task_activity' })
5
+ export class ProjectTaskActivity extends BaseModel {
6
+ @Column({ type: 'int' })
7
+ task_id: number;
8
+
9
+ @Column({ type: 'varchar', length: 100, nullable: true })
10
+ activity_type: string;
11
+
12
+ @Column({ type: 'text', nullable: true })
13
+ description: string;
14
+
15
+ @Column({ type: 'text', nullable: true })
16
+ old_value: string | null;
17
+
18
+ @Column({ type: 'text', nullable: true })
19
+ new_value: string | null;
20
+
21
+ constructor(
22
+ task_id?: number,
23
+ activity_type?: string,
24
+ description?: string,
25
+ old_value?: string | null,
26
+ new_value?: string | null
27
+ ) {
28
+ super();
29
+ this.task_id = task_id ?? 0;
30
+ this.activity_type = activity_type ?? '';
31
+ this.description = description ?? '';
32
+ this.old_value = old_value ?? null;
33
+ this.new_value = new_value ?? null;
34
+ }
35
+ }
@@ -0,0 +1,17 @@
1
+ import { Column, Entity } from 'typeorm';
2
+ import { BaseModel } from './BaseModel';
3
+
4
+ @Entity({ name: 'project_task_comments' })
5
+ export class ProjectTaskComments extends BaseModel {
6
+ @Column({ type: 'int' })
7
+ task_id: number;
8
+
9
+ @Column({ type: 'text' })
10
+ comment: string;
11
+
12
+ constructor(task_id?: number, comment?: string) {
13
+ super();
14
+ this.task_id = task_id ?? 0;
15
+ this.comment = comment ?? '';
16
+ }
17
+ }