File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -172,6 +172,28 @@ model BaremScore {
172172 @@map (" scores " )
173173}
174174
175+ // tạo 1 bảng lưu lại thông tin đăng ký thời gian present của ứng viên bao gồm
176+ // id
177+ // team_id - quan hệ với team
178+ // thời gian present thử - json
179+ // thời gian present thật - json
180+
181+ // created_at
182+ // updated_at
183+
184+ model Present {
185+ id String @id @default (uuid () ) @db.VarChar (36 )
186+ teamId String @map (" team_id " ) @db.VarChar (36 )
187+ tentativeSchedule String @map (" tentative_schedule " ) @db.Json
188+ finalSchedule String @map (" final_schedule " ) @db.Json
189+ createdAt DateTime @default (now () ) @map (" created_at " )
190+ updatedAt DateTime @updatedAt @map (" updated_at " )
191+
192+ team Team @relation (fields : [teamId ] , references : [id ] )
193+
194+ @@map (" presents " )
195+ }
196+
175197enum Role {
176198 CANDIDATE
177199 HOST
Original file line number Diff line number Diff line change 1+ import { v4 as uuidv4 } from "uuid" ;
2+ // model Present {
3+ // id String @id @default (uuid()) @db.VarChar(36)
4+ // teamId String @map ("team_id") @db.VarChar(36)
5+ // tentativeSchedule String @map ("tentative_schedule") @db.Json
6+ // finalSchedule String @map ("final_schedule") @db.Json
7+ // createdAt DateTime @default (now()) @map("created_at")
8+ // updatedAt DateTime @updatedAt @map ("updated_at")
9+
10+ // team Team @relation (fields: [teamId], references: [id])
11+
12+ // @@map ("presents")
13+ // }
14+ interface PresentType {
15+ id ?: string ;
16+ teamId : string ;
17+ tentativeSchedule : string ;
18+ finalSchedule : string ;
19+ createdAt ?: Date ;
20+ updatedAt ?: Date ;
21+ }
22+
23+ class Present {
24+ id : string ;
25+ teamId : string ;
26+ tentativeSchedule : string ;
27+ finalSchedule : string ;
28+ createdAt : Date ;
29+ updatedAt : Date ;
30+ constructor ( present : PresentType ) {
31+ this . id = present . id || uuidv4 ( ) ;
32+ this . teamId = present . teamId ;
33+ this . tentativeSchedule = present . tentativeSchedule ;
34+ this . finalSchedule = present . finalSchedule ;
35+ this . createdAt = present . createdAt || new Date ( ) ;
36+ this . updatedAt = present . updatedAt || new Date ( ) ;
37+ }
38+ }
39+
40+ export default Present ;
You can’t perform that action at this time.
0 commit comments