Files
dh-inspeccion-v2/web-v2/src/features/inspections/inspectionActPresentation.ts
T
DH V2 5cf99442a8
Android CI / RC / Android · lint, tests, debug APK, release compile (push) Successful in 3m24s
DH V2 CI / API · typecheck, tests, build (push) Successful in 40s
DH V2 CI / WEB · typecheck, build (push) Successful in 18s
Production dependency audit / API · production dependencies (push) Successful in 8s
Production dependency audit / WEB · production dependencies (push) Successful in 9s
DH V2 CI / Docker / scripts contract (push) Successful in 1m22s
feat(f6.9): consolidate act and report documents and simplify follow-up
2026-09-15 18:48:12 -03:00

38 lines
1.2 KiB
TypeScript

import type { InspectionActVersionEvent } from '../../lib/api';
const statusLabels: Record<string, string> = {
DRAFT: 'En elaboración',
LOCKED: 'Para firmar',
SEALED: 'Firmada y cerrada',
READY: 'Lista para cerrar · legado',
CLOSED: 'Firmada y cerrada',
CANCELLED: 'Cancelada',
RECTIFIED: 'Rectificada · legado',
};
const eventLabels: Record<string, string> = {
CREATED: 'Creación',
UPDATED: 'Actualización',
LOCKED: 'Bloqueo para firmas',
SEALED: 'Sellado definitivo',
READY: 'Preparación para firmas · legado',
REOPENED: 'Vuelta a borrador',
CLOSED: 'Cierre · legado',
CANCELLED: 'Cancelación',
};
export function inspectionActStatusLabel(value: string): string {
return statusLabels[value] ?? value;
}
export function inspectionActStatusClass(value: string): string {
if (value === 'SEALED' || value === 'CLOSED') return 'active';
if (value === 'LOCKED' || value === 'READY' || value === 'RECTIFIED') return 'observed';
if (value === 'CANCELLED') return 'inactive';
return 'pending';
}
export function inspectionActVersionEventLabel(value: InspectionActVersionEvent | string): string {
return eventLabels[value] ?? value;
}