@platform-modules/foreign-ministry 1.3.248 → 1.3.249
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/data-source.js +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/models/ProjectTaskUsersModel.d.ts +9 -0
- package/dist/models/ProjectTaskUsersModel.js +32 -0
- package/dist/models/ProjectTasksModel.d.ts +1 -2
- package/dist/models/ProjectTasksModel.js +2 -7
- package/package.json +1 -1
- package/src/data-source.ts +2 -0
- package/src/index.ts +1 -0
- package/src/models/DocumentationFileModel.ts +40 -40
- package/src/models/ProjectContactsModel.ts +46 -46
- package/src/models/ProjectTaskUsersModel.ts +15 -0
- package/src/models/ProjectTasksModel.ts +75 -80
package/dist/data-source.js
CHANGED
|
@@ -261,6 +261,7 @@ const ProjectModel_1 = require("./models/ProjectModel");
|
|
|
261
261
|
const TemplateModel_1 = require("./models/TemplateModel");
|
|
262
262
|
const ProjectMilestoneDocumentsModel_1 = require("./models/ProjectMilestoneDocumentsModel");
|
|
263
263
|
const ProjectTasksModel_1 = require("./models/ProjectTasksModel");
|
|
264
|
+
const ProjectTaskUsersModel_1 = require("./models/ProjectTaskUsersModel");
|
|
264
265
|
const ProjectTaskActivityModel_1 = require("./models/ProjectTaskActivityModel");
|
|
265
266
|
const ProjectTaskCommentsModel_1 = require("./models/ProjectTaskCommentsModel");
|
|
266
267
|
const DocumentationFolderModel_1 = require("./models/DocumentationFolderModel");
|
|
@@ -533,6 +534,7 @@ exports.AppDataSource = new typeorm_1.DataSource({
|
|
|
533
534
|
TemplateModel_1.Templates,
|
|
534
535
|
ProjectMilestoneDocumentsModel_1.ProjectMilestoneDocuments,
|
|
535
536
|
ProjectTasksModel_1.ProjectTasks,
|
|
537
|
+
ProjectTaskUsersModel_1.ProjectTaskUsers,
|
|
536
538
|
ProjectTaskActivityModel_1.ProjectTaskActivity,
|
|
537
539
|
ProjectTaskCommentsModel_1.ProjectTaskComments,
|
|
538
540
|
DocumentationFolderModel_1.DocumentationFolder,
|
package/dist/index.d.ts
CHANGED
|
@@ -369,6 +369,7 @@ export * from './models/ProjectMilestoneDocumentsModel';
|
|
|
369
369
|
export * from './models/ProjectMilestonePhasesModel';
|
|
370
370
|
export * from './models/ProjectTimelineModel';
|
|
371
371
|
export * from './models/ProjectTasksModel';
|
|
372
|
+
export * from './models/ProjectTaskUsersModel';
|
|
372
373
|
export * from './models/ProjectTaskActivityModel';
|
|
373
374
|
export * from './models/ProjectTaskCommentsModel';
|
|
374
375
|
export * from './models/DocumentationFolderModel';
|
package/dist/index.js
CHANGED
|
@@ -449,6 +449,7 @@ __exportStar(require("./models/ProjectMilestoneDocumentsModel"), exports);
|
|
|
449
449
|
__exportStar(require("./models/ProjectMilestonePhasesModel"), exports);
|
|
450
450
|
__exportStar(require("./models/ProjectTimelineModel"), exports);
|
|
451
451
|
__exportStar(require("./models/ProjectTasksModel"), exports);
|
|
452
|
+
__exportStar(require("./models/ProjectTaskUsersModel"), exports);
|
|
452
453
|
__exportStar(require("./models/ProjectTaskActivityModel"), exports);
|
|
453
454
|
__exportStar(require("./models/ProjectTaskCommentsModel"), exports);
|
|
454
455
|
__exportStar(require("./models/DocumentationFolderModel"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseModel } from './BaseModel';
|
|
2
|
+
/**
|
|
3
|
+
* Many-to-many: one project task can be assigned to multiple users.
|
|
4
|
+
* Replaces the former `project_tasks.assign_to` single column.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ProjectTaskUsers extends BaseModel {
|
|
7
|
+
task_id: number;
|
|
8
|
+
user_id: number;
|
|
9
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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.ProjectTaskUsers = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
/**
|
|
16
|
+
* Many-to-many: one project task can be assigned to multiple users.
|
|
17
|
+
* Replaces the former `project_tasks.assign_to` single column.
|
|
18
|
+
*/
|
|
19
|
+
let ProjectTaskUsers = class ProjectTaskUsers extends BaseModel_1.BaseModel {
|
|
20
|
+
};
|
|
21
|
+
exports.ProjectTaskUsers = ProjectTaskUsers;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.Column)({ type: 'int' }),
|
|
24
|
+
__metadata("design:type", Number)
|
|
25
|
+
], ProjectTaskUsers.prototype, "task_id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.Column)({ type: 'int' }),
|
|
28
|
+
__metadata("design:type", Number)
|
|
29
|
+
], ProjectTaskUsers.prototype, "user_id", void 0);
|
|
30
|
+
exports.ProjectTaskUsers = ProjectTaskUsers = __decorate([
|
|
31
|
+
(0, typeorm_1.Entity)({ name: 'project_task_users' })
|
|
32
|
+
], ProjectTaskUsers);
|
|
@@ -16,9 +16,8 @@ export declare class ProjectTasks extends BaseModel {
|
|
|
16
16
|
status: string;
|
|
17
17
|
milestone_id: number | null;
|
|
18
18
|
phase: number;
|
|
19
|
-
assign_to: number | null;
|
|
20
19
|
manager_id: number | null;
|
|
21
20
|
start_date: Date | null;
|
|
22
21
|
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,
|
|
22
|
+
constructor(project_id?: number, task_title?: string, task_description?: string, attachments?: TaskAttachmentItem[] | null, priority?: string, status?: string, milestone_id?: number | null, phase?: number, manager_id?: number | null, start_date?: Date | null, end_date?: Date | null);
|
|
24
23
|
}
|
|
@@ -15,7 +15,7 @@ const BaseModel_1 = require("./BaseModel");
|
|
|
15
15
|
exports.TASK_PRIORITY = ['low', 'medium', 'high'];
|
|
16
16
|
exports.TASK_STATUS = ['Not started', 'Pending', 'In Progress', 'Completed'];
|
|
17
17
|
let ProjectTasks = class ProjectTasks extends BaseModel_1.BaseModel {
|
|
18
|
-
constructor(project_id, task_title, task_description, attachments, priority, status, milestone_id, phase,
|
|
18
|
+
constructor(project_id, task_title, task_description, attachments, priority, status, milestone_id, phase, manager_id, start_date, end_date) {
|
|
19
19
|
super();
|
|
20
20
|
this.project_id = project_id ?? 0;
|
|
21
21
|
this.task_title = task_title ?? '';
|
|
@@ -25,7 +25,6 @@ let ProjectTasks = class ProjectTasks extends BaseModel_1.BaseModel {
|
|
|
25
25
|
this.status = status ?? 'Not started';
|
|
26
26
|
this.milestone_id = milestone_id ?? null;
|
|
27
27
|
this.phase = phase ?? 1;
|
|
28
|
-
this.assign_to = assign_to ?? null;
|
|
29
28
|
this.manager_id = manager_id ?? null;
|
|
30
29
|
this.start_date = start_date ?? null;
|
|
31
30
|
this.end_date = end_date ?? null;
|
|
@@ -64,10 +63,6 @@ __decorate([
|
|
|
64
63
|
(0, typeorm_1.Column)({ type: 'int', default: 1, nullable: true }),
|
|
65
64
|
__metadata("design:type", Number)
|
|
66
65
|
], 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
66
|
__decorate([
|
|
72
67
|
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
73
68
|
__metadata("design:type", Object)
|
|
@@ -82,5 +77,5 @@ __decorate([
|
|
|
82
77
|
], ProjectTasks.prototype, "end_date", void 0);
|
|
83
78
|
exports.ProjectTasks = ProjectTasks = __decorate([
|
|
84
79
|
(0, typeorm_1.Entity)({ name: 'project_tasks' }),
|
|
85
|
-
__metadata("design:paramtypes", [Number, String, String, Object, String, String, Object, Number, Object, Object, Object
|
|
80
|
+
__metadata("design:paramtypes", [Number, String, String, Object, String, String, Object, Number, Object, Object, Object])
|
|
86
81
|
], ProjectTasks);
|
package/package.json
CHANGED
package/src/data-source.ts
CHANGED
|
@@ -267,6 +267,7 @@ import { Projects } from './models/ProjectModel';
|
|
|
267
267
|
import { Templates } from './models/TemplateModel';
|
|
268
268
|
import { ProjectMilestoneDocuments } from './models/ProjectMilestoneDocumentsModel';
|
|
269
269
|
import { ProjectTasks } from './models/ProjectTasksModel';
|
|
270
|
+
import { ProjectTaskUsers } from './models/ProjectTaskUsersModel';
|
|
270
271
|
import { ProjectTaskActivity } from './models/ProjectTaskActivityModel';
|
|
271
272
|
import { ProjectTaskComments } from './models/ProjectTaskCommentsModel';
|
|
272
273
|
import { DocumentationFolder } from './models/DocumentationFolderModel';
|
|
@@ -540,6 +541,7 @@ export const AppDataSource = new DataSource({
|
|
|
540
541
|
Templates,
|
|
541
542
|
ProjectMilestoneDocuments,
|
|
542
543
|
ProjectTasks,
|
|
544
|
+
ProjectTaskUsers,
|
|
543
545
|
ProjectTaskActivity,
|
|
544
546
|
ProjectTaskComments,
|
|
545
547
|
DocumentationFolder,
|
package/src/index.ts
CHANGED
|
@@ -386,6 +386,7 @@ export * from './models/ProjectMilestoneDocumentsModel';
|
|
|
386
386
|
export * from './models/ProjectMilestonePhasesModel';
|
|
387
387
|
export * from './models/ProjectTimelineModel';
|
|
388
388
|
export * from './models/ProjectTasksModel';
|
|
389
|
+
export * from './models/ProjectTaskUsersModel';
|
|
389
390
|
export * from './models/ProjectTaskActivityModel';
|
|
390
391
|
export * from './models/ProjectTaskCommentsModel';
|
|
391
392
|
export * from './models/DocumentationFolderModel';
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { Column, Entity } from 'typeorm';
|
|
2
|
-
import { BaseModel } from './BaseModel';
|
|
3
|
-
|
|
4
|
-
@Entity({ name: 'documentation_files' })
|
|
5
|
-
export class DocumentationFile extends BaseModel {
|
|
6
|
-
@Column({ type: 'int', nullable: true })
|
|
7
|
-
project_id: number | null;
|
|
8
|
-
|
|
9
|
-
@Column({ type: 'int' })
|
|
10
|
-
folder_id: number;
|
|
11
|
-
|
|
12
|
-
@Column({ type: 'text', nullable: true })
|
|
13
|
-
file_path: 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 | null,
|
|
26
|
-
folder_id?: number,
|
|
27
|
-
file_path?: string,
|
|
28
|
-
filename?: string,
|
|
29
|
-
filesize?: number,
|
|
30
|
-
filetype?: string
|
|
31
|
-
) {
|
|
32
|
-
super();
|
|
33
|
-
this.project_id = project_id ?? null;
|
|
34
|
-
this.folder_id = folder_id ?? 0;
|
|
35
|
-
this.file_path = file_path ?? '';
|
|
36
|
-
this.filename = filename ?? '';
|
|
37
|
-
this.filesize = filesize ?? 0;
|
|
38
|
-
this.filetype = filetype ?? '';
|
|
39
|
-
}
|
|
40
|
-
}
|
|
1
|
+
import { Column, Entity } from 'typeorm';
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
@Entity({ name: 'documentation_files' })
|
|
5
|
+
export class DocumentationFile extends BaseModel {
|
|
6
|
+
@Column({ type: 'int', nullable: true })
|
|
7
|
+
project_id: number | null;
|
|
8
|
+
|
|
9
|
+
@Column({ type: 'int' })
|
|
10
|
+
folder_id: number;
|
|
11
|
+
|
|
12
|
+
@Column({ type: 'text', nullable: true })
|
|
13
|
+
file_path: 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 | null,
|
|
26
|
+
folder_id?: number,
|
|
27
|
+
file_path?: string,
|
|
28
|
+
filename?: string,
|
|
29
|
+
filesize?: number,
|
|
30
|
+
filetype?: string
|
|
31
|
+
) {
|
|
32
|
+
super();
|
|
33
|
+
this.project_id = project_id ?? null;
|
|
34
|
+
this.folder_id = folder_id ?? 0;
|
|
35
|
+
this.file_path = file_path ?? '';
|
|
36
|
+
this.filename = filename ?? '';
|
|
37
|
+
this.filesize = filesize ?? 0;
|
|
38
|
+
this.filetype = filetype ?? '';
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { Column, Entity } from 'typeorm';
|
|
2
|
-
import { BaseModel } from './BaseModel';
|
|
3
|
-
|
|
4
|
-
@Entity({ name: 'project_contacts' })
|
|
5
|
-
export class ProjectContacts extends BaseModel {
|
|
6
|
-
@Column({ type: 'int' })
|
|
7
|
-
project_id: number;
|
|
8
|
-
|
|
9
|
-
@Column({ type: 'varchar', length: 50 })
|
|
10
|
-
contact_type: string;
|
|
11
|
-
|
|
12
|
-
@Column({ type: 'varchar', length: 50, nullable: true })
|
|
13
|
-
phone_number: string;
|
|
14
|
-
|
|
15
|
-
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
16
|
-
email_id: string;
|
|
17
|
-
|
|
18
|
-
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
19
|
-
name: string;
|
|
20
|
-
|
|
21
|
-
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
22
|
-
designation: string;
|
|
23
|
-
|
|
24
|
-
/** Optional FK to departments.id */
|
|
25
|
-
@Column({ type: 'int', nullable: true })
|
|
26
|
-
department_id: number | null;
|
|
27
|
-
|
|
28
|
-
constructor(
|
|
29
|
-
project_id?: number,
|
|
30
|
-
contact_type?: string,
|
|
31
|
-
phone_number?: string,
|
|
32
|
-
email_id?: string,
|
|
33
|
-
name?: string,
|
|
34
|
-
designation?: string,
|
|
35
|
-
department_id?: number | null
|
|
36
|
-
) {
|
|
37
|
-
super();
|
|
38
|
-
this.project_id = project_id ?? 0;
|
|
39
|
-
this.contact_type = contact_type ?? '';
|
|
40
|
-
this.phone_number = phone_number ?? '';
|
|
41
|
-
this.email_id = email_id ?? '';
|
|
42
|
-
this.name = name ?? '';
|
|
43
|
-
this.designation = designation ?? '';
|
|
44
|
-
this.department_id = department_id ?? null;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
1
|
+
import { Column, Entity } from 'typeorm';
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
@Entity({ name: 'project_contacts' })
|
|
5
|
+
export class ProjectContacts extends BaseModel {
|
|
6
|
+
@Column({ type: 'int' })
|
|
7
|
+
project_id: number;
|
|
8
|
+
|
|
9
|
+
@Column({ type: 'varchar', length: 50 })
|
|
10
|
+
contact_type: string;
|
|
11
|
+
|
|
12
|
+
@Column({ type: 'varchar', length: 50, nullable: true })
|
|
13
|
+
phone_number: string;
|
|
14
|
+
|
|
15
|
+
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
16
|
+
email_id: string;
|
|
17
|
+
|
|
18
|
+
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
19
|
+
name: string;
|
|
20
|
+
|
|
21
|
+
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
22
|
+
designation: string;
|
|
23
|
+
|
|
24
|
+
/** Optional FK to departments.id */
|
|
25
|
+
@Column({ type: 'int', nullable: true })
|
|
26
|
+
department_id: number | null;
|
|
27
|
+
|
|
28
|
+
constructor(
|
|
29
|
+
project_id?: number,
|
|
30
|
+
contact_type?: string,
|
|
31
|
+
phone_number?: string,
|
|
32
|
+
email_id?: string,
|
|
33
|
+
name?: string,
|
|
34
|
+
designation?: string,
|
|
35
|
+
department_id?: number | null
|
|
36
|
+
) {
|
|
37
|
+
super();
|
|
38
|
+
this.project_id = project_id ?? 0;
|
|
39
|
+
this.contact_type = contact_type ?? '';
|
|
40
|
+
this.phone_number = phone_number ?? '';
|
|
41
|
+
this.email_id = email_id ?? '';
|
|
42
|
+
this.name = name ?? '';
|
|
43
|
+
this.designation = designation ?? '';
|
|
44
|
+
this.department_id = department_id ?? null;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Column, Entity } from 'typeorm';
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Many-to-many: one project task can be assigned to multiple users.
|
|
6
|
+
* Replaces the former `project_tasks.assign_to` single column.
|
|
7
|
+
*/
|
|
8
|
+
@Entity({ name: 'project_task_users' })
|
|
9
|
+
export class ProjectTaskUsers extends BaseModel {
|
|
10
|
+
@Column({ type: 'int' })
|
|
11
|
+
task_id: number;
|
|
12
|
+
|
|
13
|
+
@Column({ type: 'int' })
|
|
14
|
+
user_id: number;
|
|
15
|
+
}
|
|
@@ -1,80 +1,75 @@
|
|
|
1
|
-
import { Column, Entity } from 'typeorm';
|
|
2
|
-
import { BaseModel } from './BaseModel';
|
|
3
|
-
|
|
4
|
-
export interface TaskAttachmentItem {
|
|
5
|
-
link?: string;
|
|
6
|
-
filename?: string;
|
|
7
|
-
filesize?: number;
|
|
8
|
-
filetype?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const TASK_PRIORITY = ['low', 'medium', 'high'] as const;
|
|
12
|
-
export const TASK_STATUS = ['Not started', 'Pending', 'In Progress', 'Completed'] as const;
|
|
13
|
-
|
|
14
|
-
@Entity({ name: 'project_tasks' })
|
|
15
|
-
export class ProjectTasks extends BaseModel {
|
|
16
|
-
@Column({ type: 'int' })
|
|
17
|
-
project_id: number;
|
|
18
|
-
|
|
19
|
-
@Column({ type: 'varchar', length: 500 })
|
|
20
|
-
task_title: string;
|
|
21
|
-
|
|
22
|
-
@Column({ type: 'text', nullable: true })
|
|
23
|
-
task_description: string;
|
|
24
|
-
|
|
25
|
-
@Column({ type: 'jsonb', nullable: true })
|
|
26
|
-
attachments: TaskAttachmentItem[] | null;
|
|
27
|
-
|
|
28
|
-
@Column({ type: 'varchar', length: 20, default: 'medium' })
|
|
29
|
-
priority: string;
|
|
30
|
-
|
|
31
|
-
@Column({ type: 'varchar', length: 50, default: 'Not started' })
|
|
32
|
-
status: string;
|
|
33
|
-
|
|
34
|
-
@Column({ type: 'int', nullable: true })
|
|
35
|
-
milestone_id: number | null;
|
|
36
|
-
|
|
37
|
-
@Column({ type: 'int', default: 1, nullable: true })
|
|
38
|
-
phase: number;
|
|
39
|
-
|
|
40
|
-
@Column({ type: 'int', nullable: true })
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
@Column({ type: '
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
@Column({ type: 'date', nullable: true })
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
this.
|
|
68
|
-
this.
|
|
69
|
-
this.
|
|
70
|
-
this.
|
|
71
|
-
this.
|
|
72
|
-
this.
|
|
73
|
-
this.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
this.manager_id = manager_id ?? null;
|
|
77
|
-
this.start_date = start_date ?? null;
|
|
78
|
-
this.end_date = end_date ?? null;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
1
|
+
import { Column, Entity } from 'typeorm';
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
export interface TaskAttachmentItem {
|
|
5
|
+
link?: string;
|
|
6
|
+
filename?: string;
|
|
7
|
+
filesize?: number;
|
|
8
|
+
filetype?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const TASK_PRIORITY = ['low', 'medium', 'high'] as const;
|
|
12
|
+
export const TASK_STATUS = ['Not started', 'Pending', 'In Progress', 'Completed'] as const;
|
|
13
|
+
|
|
14
|
+
@Entity({ name: 'project_tasks' })
|
|
15
|
+
export class ProjectTasks extends BaseModel {
|
|
16
|
+
@Column({ type: 'int' })
|
|
17
|
+
project_id: number;
|
|
18
|
+
|
|
19
|
+
@Column({ type: 'varchar', length: 500 })
|
|
20
|
+
task_title: string;
|
|
21
|
+
|
|
22
|
+
@Column({ type: 'text', nullable: true })
|
|
23
|
+
task_description: string;
|
|
24
|
+
|
|
25
|
+
@Column({ type: 'jsonb', nullable: true })
|
|
26
|
+
attachments: TaskAttachmentItem[] | null;
|
|
27
|
+
|
|
28
|
+
@Column({ type: 'varchar', length: 20, default: 'medium' })
|
|
29
|
+
priority: string;
|
|
30
|
+
|
|
31
|
+
@Column({ type: 'varchar', length: 50, default: 'Not started' })
|
|
32
|
+
status: string;
|
|
33
|
+
|
|
34
|
+
@Column({ type: 'int', nullable: true })
|
|
35
|
+
milestone_id: number | null;
|
|
36
|
+
|
|
37
|
+
@Column({ type: 'int', default: 1, nullable: true })
|
|
38
|
+
phase: number;
|
|
39
|
+
|
|
40
|
+
@Column({ type: 'int', nullable: true })
|
|
41
|
+
manager_id: number | null;
|
|
42
|
+
|
|
43
|
+
@Column({ type: 'date', nullable: true })
|
|
44
|
+
start_date: Date | null;
|
|
45
|
+
|
|
46
|
+
@Column({ type: 'date', nullable: true })
|
|
47
|
+
end_date: Date | null;
|
|
48
|
+
|
|
49
|
+
constructor(
|
|
50
|
+
project_id?: number,
|
|
51
|
+
task_title?: string,
|
|
52
|
+
task_description?: string,
|
|
53
|
+
attachments?: TaskAttachmentItem[] | null,
|
|
54
|
+
priority?: string,
|
|
55
|
+
status?: string,
|
|
56
|
+
milestone_id?: number | null,
|
|
57
|
+
phase?: number,
|
|
58
|
+
manager_id?: number | null,
|
|
59
|
+
start_date?: Date | null,
|
|
60
|
+
end_date?: Date | null
|
|
61
|
+
) {
|
|
62
|
+
super();
|
|
63
|
+
this.project_id = project_id ?? 0;
|
|
64
|
+
this.task_title = task_title ?? '';
|
|
65
|
+
this.task_description = task_description ?? '';
|
|
66
|
+
this.attachments = attachments ?? null;
|
|
67
|
+
this.priority = priority ?? 'medium';
|
|
68
|
+
this.status = status ?? 'Not started';
|
|
69
|
+
this.milestone_id = milestone_id ?? null;
|
|
70
|
+
this.phase = phase ?? 1;
|
|
71
|
+
this.manager_id = manager_id ?? null;
|
|
72
|
+
this.start_date = start_date ?? null;
|
|
73
|
+
this.end_date = end_date ?? null;
|
|
74
|
+
}
|
|
75
|
+
}
|