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:
@@ -0,0 +1,61 @@
|
||||
export type PersonRole = 'skipper' | 'crew'
|
||||
|
||||
export interface PersonData {
|
||||
name: string
|
||||
address: string
|
||||
birthDate: string
|
||||
phone: string
|
||||
nationality: string
|
||||
passportNumber: string
|
||||
bloodType: string
|
||||
allergies: string
|
||||
diseases: string
|
||||
role: PersonRole
|
||||
photo?: string | null
|
||||
}
|
||||
|
||||
export interface PersonSnapshot {
|
||||
id: string
|
||||
role: PersonRole
|
||||
name: string
|
||||
address: string
|
||||
birthDate: string
|
||||
phone: string
|
||||
nationality: string
|
||||
passportNumber: string
|
||||
bloodType: string
|
||||
allergies: string
|
||||
diseases: string
|
||||
photo?: string | null
|
||||
}
|
||||
|
||||
export interface LogbookCrewSelectionData {
|
||||
activeSkipperId: string | null
|
||||
activeCrewIds: string[]
|
||||
/** Denormalized for collaborators / offline display without account pool access */
|
||||
snapshotsById: Record<string, PersonSnapshot>
|
||||
}
|
||||
|
||||
export interface EntryCrewFields {
|
||||
selectedSkipperId: string | null
|
||||
selectedCrewIds: string[]
|
||||
crewSnapshotsById: Record<string, PersonSnapshot>
|
||||
}
|
||||
|
||||
export const MAX_POOL_CREW_MEMBERS = 5
|
||||
|
||||
export function emptyLogbookCrewSelection(): LogbookCrewSelectionData {
|
||||
return {
|
||||
activeSkipperId: null,
|
||||
activeCrewIds: [],
|
||||
snapshotsById: {}
|
||||
}
|
||||
}
|
||||
|
||||
export function emptyEntryCrewFields(): EntryCrewFields {
|
||||
return {
|
||||
selectedSkipperId: null,
|
||||
selectedCrewIds: [],
|
||||
crewSnapshotsById: {}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user