Add roll-call API for admin work-day logs with tasks.

Lets owners/admins track start/stop sessions and task lists per business day.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-10-07 13:21:01 +03:30
co-authored by Cursor
parent d237d00f65
commit a6c2d4764e
7 changed files with 616 additions and 0 deletions
+34
View File
@@ -51,6 +51,7 @@ model User {
userProducts UserProduct[]
userRoles UserRole[]
smsTemplatesVerified SmsTemplate[] @relation("SmsTemplateVerifier")
rollCalls RollCall[]
@@index([cellNumber], map: "idx_users_cell_number")
@@map("users")
@@ -172,6 +173,7 @@ model Business {
website_sliders website_sliders[]
websitePageViews WebsitePageView[]
websitePageViewCounters WebsitePageViewCounter[]
rollCalls RollCall[]
@@map("businesses")
}
@@ -1962,3 +1964,35 @@ enum TranslationStatus {
@@map("translation_status")
}
model RollCall {
id BigInt @id @default(autoincrement())
businessId BigInt @map("business_id")
userId BigInt @map("user_id")
workDate DateTime @map("work_date") @db.Date
startTime String @map("start_time") @db.VarChar(5)
endTime String @map("end_time") @db.VarChar(5)
createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz(6)
updatedAt DateTime @default(now()) @updatedAt @map("updated_at") @db.Timestamptz(6)
business Business @relation(fields: [businessId], references: [id], onDelete: Cascade, onUpdate: NoAction)
user User @relation(fields: [userId], references: [id], onDelete: Cascade, onUpdate: NoAction)
tasks RollCallTask[]
@@unique([businessId, userId, workDate], map: "roll_calls_business_user_date_unique")
@@index([businessId], map: "idx_roll_calls_business_id")
@@index([userId], map: "idx_roll_calls_user_id")
@@index([businessId, userId, workDate(sort: Desc)], map: "idx_roll_calls_business_user_date")
@@map("roll_calls")
}
model RollCallTask {
id BigInt @id @default(autoincrement())
rollCallId BigInt @map("roll_call_id")
title String @db.VarChar(500)
sortOrder Int @default(0) @map("sort_order")
createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz(6)
rollCall RollCall @relation(fields: [rollCallId], references: [id], onDelete: Cascade, onUpdate: NoAction)
@@index([rollCallId], map: "idx_roll_call_tasks_roll_call_id")
@@map("roll_call_tasks")
}