All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 28m41s
Verhindert stilles Überschreiben neuerer Änderungen durch veralteten Stand (z.B. nach Offline-Reconnect oder Lock-Ablauf bei Multi-Device). - Project.featuresVersion (Schema + Auto-Migration), pro Features-Speichern +1 - Features-PUT: optimistischer Lock in interaktiver Transaktion (updateMany WHERE featuresVersion=baseVersion -> atomar; count=0 => 409 Konflikt) - Bei Konflikt liefert der Server den aktuellen Stand zurück (409 + features + version) - Client sendet baseVersion (Auto-Save, manuell, Beacon, Offline-Queue), übernimmt bei 409 den Server-Stand und warnt den Nutzer (statt still zu überschreiben) - Offline-Queue verwirft konfligierende 4xx (kein Clobber beim Reconnect) - Transaktions-Timeout 15s für grosse Zeichnungen auf langsamer DB Version 1.4.11 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
76 lines
1.5 KiB
TypeScript
76 lines
1.5 KiB
TypeScript
export type ProjectMode = 'EINSATZ' | 'UEBUNG'
|
|
|
|
export interface Project {
|
|
id: string
|
|
title: string
|
|
mode?: ProjectMode
|
|
exerciseEvaluation?: string | null
|
|
location?: string
|
|
description?: string
|
|
einsatzleiter?: string
|
|
journalfuehrer?: string
|
|
mapCenter: { lng: number; lat: number }
|
|
mapZoom: number
|
|
isLocked: boolean
|
|
featuresVersion?: number
|
|
editingById?: string | null
|
|
editingUserName?: string | null
|
|
editingStartedAt?: string | null
|
|
planImageKey?: string | null
|
|
planBounds?: { north: number; south: number; east: number; west: number } | null
|
|
createdAt: string
|
|
updatedAt: string
|
|
}
|
|
|
|
export interface DrawFeature {
|
|
id: string
|
|
type: string
|
|
geometry: {
|
|
type: string
|
|
coordinates: number[] | number[][] | number[][][]
|
|
}
|
|
properties: Record<string, any>
|
|
}
|
|
|
|
// Mapbox Feature Types
|
|
export type Feature = {
|
|
id?: string | number
|
|
type: 'Feature'
|
|
geometry: {
|
|
type: string
|
|
coordinates: any
|
|
}
|
|
properties: Record<string, any>
|
|
}
|
|
|
|
export type DrawMode =
|
|
| 'select'
|
|
| 'point'
|
|
| 'linestring'
|
|
| 'polygon'
|
|
| 'rectangle'
|
|
| 'circle'
|
|
| 'freehand'
|
|
| 'text'
|
|
| 'arrow'
|
|
| 'measure'
|
|
| 'dangerzone'
|
|
| 'eraser'
|
|
|
|
export interface JournalEntry {
|
|
id: string
|
|
type: 'TEXT' | 'IMAGE' | 'AUDIO' | 'SOMA' | 'DANGER'
|
|
content?: string
|
|
timestamp: string
|
|
userId?: string
|
|
userName?: string
|
|
userRole?: string
|
|
isDone?: boolean
|
|
fileUrl?: string
|
|
fileKey?: string
|
|
somaTemplateId?: string
|
|
somaChecked?: boolean
|
|
isCorrected?: boolean
|
|
correctionOfId?: string
|
|
}
|