-
Notifications
You must be signed in to change notification settings - Fork 100
Expand file tree
/
Copy pathtask.model.ts
More file actions
33 lines (30 loc) · 864 Bytes
/
task.model.ts
File metadata and controls
33 lines (30 loc) · 864 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { TaskPriority, TaskStatus } from "../../interfaces/i.task";
export class TaskModel {
id?: number;
title!: string;
description?: string;
creator_id!: number;
organization_id!: number;
due_date?: Date;
priority!: TaskPriority;
status!: TaskStatus;
categories?: string[];
created_at?: Date;
updated_at?: Date;
constructor(data: TaskModel) {
this.id = data.id;
this.title = data.title;
this.description = data.description;
this.creator_id = data.creator_id;
this.organization_id = data.organization_id;
this.due_date = data.due_date;
this.priority = data.priority;
this.status = data.status;
this.categories = data.categories;
this.created_at = data.created_at;
this.updated_at = data.updated_at;
}
static createTask(data: TaskModel): TaskModel {
return new TaskModel(data);
}
}