Add account-level crew pool with per-logbook and per-day selection.
Move skipper and crew master data to the user profile pool, replace the logbook crew tab with selection from that pool, inherit crew on new travel days, and sync via new PersonPayload and LogbookCrewSelection models. Includes migration from legacy crew records, tour/demo updates, and i18n. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -23,6 +23,7 @@ model User {
|
||||
pushSubscriptions PushSubscription[]
|
||||
notificationPrefs UserNotificationPrefs?
|
||||
appearancePrefs UserAppearancePrefs?
|
||||
personPool PersonPayload[]
|
||||
}
|
||||
|
||||
model PushSubscription {
|
||||
@@ -86,6 +87,7 @@ model Logbook {
|
||||
|
||||
yachts YachtPayload[]
|
||||
crews CrewPayload[]
|
||||
logbookCrewSelection LogbookCrewSelectionPayload?
|
||||
deviations DeviationPayload[]
|
||||
entries EntryPayload[]
|
||||
photos PhotoPayload[]
|
||||
@@ -148,6 +150,30 @@ model CrewPayload {
|
||||
@@unique([logbookId, payloadId])
|
||||
}
|
||||
|
||||
model PersonPayload {
|
||||
id String @id @default(uuid())
|
||||
userId String
|
||||
payloadId String
|
||||
encryptedData String
|
||||
iv String
|
||||
tag String
|
||||
updatedAt DateTime @updatedAt
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([userId, payloadId])
|
||||
@@index([userId])
|
||||
}
|
||||
|
||||
model LogbookCrewSelectionPayload {
|
||||
id String @id @default(uuid())
|
||||
logbookId String @unique
|
||||
encryptedData String
|
||||
iv String
|
||||
tag String
|
||||
updatedAt DateTime @updatedAt
|
||||
logbook Logbook @relation(fields: [logbookId], references: [id], onDelete: Cascade)
|
||||
}
|
||||
|
||||
model DeviationPayload {
|
||||
id String @id @default(uuid())
|
||||
logbookId String @unique
|
||||
|
||||
Reference in New Issue
Block a user