forked from amand33p/bug-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBug.ts
More file actions
83 lines (67 loc) · 1.73 KB
/
Copy pathBug.ts
File metadata and controls
83 lines (67 loc) · 1.73 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import {
PrimaryGeneratedColumn,
CreateDateColumn,
Entity,
BaseEntity,
Column,
ManyToOne,
JoinColumn,
OneToMany,
} from 'typeorm';
import { Project } from './Project';
import { User } from './User';
import { Note } from './Note';
type Priority = 'low' | 'medium' | 'high';
@Entity({ name: 'bugs' })
export class Bug extends BaseEntity {
@PrimaryGeneratedColumn('uuid')
id: string;
@Column({ type: 'varchar', length: 60 })
title: string;
@Column()
description: string;
@Column({
type: 'enum',
enum: ['low', 'medium', 'high'],
default: 'low',
})
priority: Priority;
@ManyToOne(() => Project, (project) => project)
@JoinColumn({ name: 'projectId' })
project: Project;
@Column()
projectId: string;
@OneToMany(() => Note, (note) => note.bug)
@JoinColumn()
notes: Note[];
@Column({ default: false })
isResolved: boolean;
@ManyToOne(() => User, (user) => user)
@JoinColumn({ name: 'closedById' })
closedBy: User;
@Column({ type: 'text', nullable: true })
closedById: string | null;
@Column({ type: 'timestamp', nullable: true })
closedAt: Date | null;
@ManyToOne(() => User, (user) => user)
@JoinColumn({ name: 'reopenedById' })
reopenedBy: User;
@Column({ type: 'text', nullable: true })
reopenedById: string | null;
@Column({ type: 'timestamp', nullable: true })
reopenedAt: Date | null;
@ManyToOne(() => User, (user) => user)
@JoinColumn({ name: 'createdById' })
createdBy: User;
@Column()
createdById: string;
@CreateDateColumn()
createdAt: Date;
@ManyToOne(() => User, (user) => user)
@JoinColumn({ name: 'updatedById' })
updatedBy: User;
@Column({ nullable: true })
updatedById: string;
@Column({ nullable: true })
updatedAt: Date;
}