Revízny systém - kompletná implementácia
- Backend: CRUD revízií, schedule endpoint (agregovaný plán), skip revízia, stats - Shared utility revisionSchedule.ts - centralizovaná logika výpočtu cyklov - Equipment detail s revíznym plánom, históriou a prílohami - Frontend: RevisionsList s tabmi (nadchádzajúce/po termíne/vykonané/preskočené) - Pozičné labeling cyklov (eliminuje drift 4×90≠365) - EquipmentRevisionSchedule model (many-to-many typy revízií) - Aktualizovaná dokumentácia HELPDESK_INIT_V2.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -109,7 +109,8 @@ model RevisionType {
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
revisions Revision[]
|
||||
revisions Revision[]
|
||||
equipmentSchedules EquipmentRevisionSchedule[]
|
||||
|
||||
@@index([active])
|
||||
@@index([order])
|
||||
@@ -492,9 +493,10 @@ model Equipment {
|
||||
partNumber String?
|
||||
serialNumber String?
|
||||
|
||||
installDate DateTime?
|
||||
warrantyEnd DateTime?
|
||||
warrantyStatus String?
|
||||
installDate DateTime?
|
||||
revisionCycleStart DateTime?
|
||||
warrantyEnd DateTime?
|
||||
warrantyStatus String?
|
||||
|
||||
description String?
|
||||
notes String?
|
||||
@@ -507,9 +509,10 @@ model Equipment {
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
revisions Revision[]
|
||||
attachments EquipmentAttachment[]
|
||||
tags EquipmentTag[]
|
||||
revisions Revision[]
|
||||
revisionSchedules EquipmentRevisionSchedule[]
|
||||
attachments EquipmentAttachment[]
|
||||
tags EquipmentTag[]
|
||||
|
||||
@@index([typeId])
|
||||
@@index([customerId])
|
||||
@@ -518,6 +521,22 @@ model Equipment {
|
||||
@@index([createdById])
|
||||
}
|
||||
|
||||
model EquipmentRevisionSchedule {
|
||||
id String @id @default(cuid())
|
||||
|
||||
equipmentId String
|
||||
equipment Equipment @relation(fields: [equipmentId], references: [id], onDelete: Cascade)
|
||||
|
||||
revisionTypeId String
|
||||
revisionType RevisionType @relation(fields: [revisionTypeId], references: [id])
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@unique([equipmentId, revisionTypeId])
|
||||
@@index([equipmentId])
|
||||
@@index([revisionTypeId])
|
||||
}
|
||||
|
||||
model Revision {
|
||||
id String @id @default(cuid())
|
||||
|
||||
@@ -527,6 +546,8 @@ model Revision {
|
||||
typeId String
|
||||
type RevisionType @relation(fields: [typeId], references: [id])
|
||||
|
||||
status String @default("performed") // "performed" | "skipped"
|
||||
|
||||
performedDate DateTime
|
||||
nextDueDate DateTime?
|
||||
|
||||
@@ -536,6 +557,7 @@ model Revision {
|
||||
findings String?
|
||||
result String?
|
||||
notes String?
|
||||
skipReason String?
|
||||
|
||||
reminderSent Boolean @default(false)
|
||||
reminderDate DateTime?
|
||||
@@ -548,6 +570,7 @@ model Revision {
|
||||
@@index([performedById])
|
||||
@@index([nextDueDate])
|
||||
@@index([reminderDate])
|
||||
@@index([status])
|
||||
}
|
||||
|
||||
model EquipmentAttachment {
|
||||
|
||||
Reference in New Issue
Block a user