This commit is contained in:
João Geonizeli
2022-07-09 14:28:36 -03:00
parent 97dac843fe
commit 82c078f5db
17 changed files with 200 additions and 50 deletions

View File

@@ -0,0 +1,31 @@
import { IsNotEmpty } from "class-validator";
import {
Column,
Entity,
JoinColumn,
ManyToOne,
PrimaryGeneratedColumn
} from "typeorm";
import { Project } from "./project.entity";
@Entity()
export class Task {
@PrimaryGeneratedColumn()
id: number;
@Column()
@IsNotEmpty()
description: string;
@Column({ type: "timestamptz" })
@IsNotEmpty()
createdAt: Date;
@Column({ type: "timestamptz", nullable: true })
finishedAt?: Date;
@ManyToOne((_type) => Project, (project) => project.tasks)
@JoinColumn()
@IsNotEmpty()
project: Project;
}