This commit is contained in:
@@ -15,7 +15,6 @@ model Venue {
|
||||
|
||||
devices Device[]
|
||||
clientUsers ClientUser[]
|
||||
tabOwnerships TabOwnership[]
|
||||
remoteCommands RemoteCommand[]
|
||||
auditLogs AuditLog[]
|
||||
regCodes RegistrationCode[]
|
||||
@@ -43,9 +42,7 @@ model Device {
|
||||
revokedAt DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
venue Venue @relation(fields: [venueId], references: [id])
|
||||
tabSnapshots OpenTabSnapshot[]
|
||||
tabOwnerships TabOwnership[]
|
||||
venue Venue @relation(fields: [venueId], references: [id])
|
||||
remoteCommands RemoteCommand[]
|
||||
tabEvents TabEvent[]
|
||||
settlements Settlement[]
|
||||
@@ -81,38 +78,6 @@ model RegistrationCode {
|
||||
@@index([venueId])
|
||||
}
|
||||
|
||||
model OpenTabSnapshot {
|
||||
id String @id @default(uuid())
|
||||
deviceId String
|
||||
tabId String
|
||||
customerName String
|
||||
version Int
|
||||
totalInCents Int
|
||||
itemCount Int
|
||||
// The tab's lines as reported by the terminal: [{ productName, quantity, unitPriceInCents }].
|
||||
// Null for terminals running an app version that doesn't report them.
|
||||
items Json?
|
||||
reportedAt DateTime
|
||||
|
||||
device Device @relation(fields: [deviceId], references: [id])
|
||||
|
||||
@@unique([deviceId, tabId])
|
||||
@@index([deviceId])
|
||||
@@index([tabId, reportedAt])
|
||||
}
|
||||
|
||||
model TabOwnership {
|
||||
tabId String
|
||||
venueId String
|
||||
deviceId String
|
||||
lastReportedAt DateTime
|
||||
|
||||
venue Venue @relation(fields: [venueId], references: [id])
|
||||
device Device @relation(fields: [deviceId], references: [id])
|
||||
|
||||
@@id([venueId, tabId])
|
||||
}
|
||||
|
||||
// A request from the dashboard. close_tab used to be executed by the owning terminal; the server now settles
|
||||
// the tab itself and records the command as completed right away, for the history.
|
||||
model RemoteCommand {
|
||||
|
||||
Reference in New Issue
Block a user