Skip to content

Commit

Permalink
feat: add user models, integrate task models
Browse files Browse the repository at this point in the history
  • Loading branch information
selena1108 committed Oct 14, 2023
1 parent f28a120 commit 9065496
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 55 deletions.
31 changes: 0 additions & 31 deletions backend/typescript/models/user-model.prisma

This file was deleted.

82 changes: 58 additions & 24 deletions backend/typescript/prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
model Task {
id Int @id @default(autoincrement())
category Categories
title String
status Statuses
description String
// TODO: CHANGE THESE AFTER USER MODELS HAVE BEEN MADE
assignee String
assigner String
credit_value Float
start_date DateTime
end_date DateTime?
comments String
recurrence_frequency String?
id Int @id @default(autoincrement())
category Categories
title String
status Statuses
description String
assignee Resident @relation(fields: [assignee_id], references: [id])
assignee_id Int
assigner Staff @relation(fields: [assigner_id], references: [id])
assigner_id Int
credit_value Float
start_date DateTime
end_date DateTime?
comments String
recurrence_frequency String?
// recurrence_days String // store days a comma separted string to be parsed for usage
warnings Warning[]
warnings Warning[]
}

enum Categories {
Expand All @@ -33,11 +32,46 @@ enum Statuses {
}

model Warning {
resident_id Int @id @default(autoincrement())
title String
description String
assigned_by String // change this to be Staff
date_issued DateTime
related_task Task? @relation(fields: [related_task_id], references: [id])
related_task_id Int?
}
resident_id Int @id @default(autoincrement())
title String
description String
assigner Staff @relation(fields: [assigner_id], references: [id])
assigner_id Int
date_issued DateTime
related_task Task? @relation(fields: [related_task_id], references: [id])
related_task_id Int?
}

model Staff {
id Int @id @default(autoincrement())
role StaffRoles
first_name String
last_name String
email String
phone_number String?
display_name String
profile_picture_link String?
tasks Task[]
warnings Warning[]
}

enum StaffRoles {
ADMIN
CORE
RELIEF
}

model Resident {
id Int @id @default(autoincrement())
first_name String
last_name String
email String
phone_number String?
display_name String
profile_picture_link String?
birthdate DateTime?
credits Float
date_joined DateTime
date_left DateTime
tasks Task[]
}

0 comments on commit 9065496

Please sign in to comment.