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
38 lines
1.2 KiB
TypeScript
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;
|
|
}
|