feat(informes): manage manual GEDO responses and shared due date
DH V2 CI / WEB · typecheck, build (push) Successful in 27s
Production dependency audit / API · production dependencies (push) Successful in 15s
Production dependency audit / WEB · production dependencies (push) Successful in 15s
DH V2 CI / API · typecheck, tests, build (push) Successful in 2m3s
DH V2 CI / Docker / migrations / production images (push) Successful in 2m58s
DH V2 CI / Promote verified main to deploy (push) Successful in 3s
Android CI / RC / Android · lint, tests, debug APK, release compile (push) Successful in 5m55s

This commit is contained in:
2026-09-15 23:35:49 -03:00
parent 69aeb52040
commit c9575cc520
20 changed files with 485 additions and 161 deletions
+36
View File
@@ -64,6 +64,14 @@ export interface InspectionReportDetailF4 {
companies: Array<{ id: string; code: string; name: string }>;
areas: Array<{ id: string; code: string; name: string }>;
findingCount: number;
responseDueOn: string | null;
deadlineReason: string | null;
deadlines: Array<{ id: string; reportId: string | null; responseDueOn: string; reason: string; createdAt: string }>;
findings: Array<{ id: string; code: string; title: string; status: string; assetCode: string; assetName: string; responseDueOn: string | null }>;
companyResponses: Array<{
id: string; reportId: string | null; receivedOn: string; details: string | null; committedCorrectionOn: string | null;
contactName: string | null; contactEmail: string | null; originalName: string | null; sizeBytes: number | null; sha256: string | null; createdAt: string;
}>;
}
export interface PendingInspectionReportF4 {
@@ -176,6 +184,30 @@ export function officializeInspectionReport(
});
}
export function setInspectionReportResponseDeadline(
id: string,
input: { responseDueOn: string; reason?: string | null },
) {
return apiRequest<InspectionReportWorkflowView>(`/inspection-reports/${id}/response-deadline`, {
method: 'PATCH',
body: JSON.stringify(input),
});
}
export function addInspectionReportCompanyResponse(
id: string,
input: { receivedOn: string; details?: string; committedCorrectionOn?: string; contactName?: string; contactEmail?: string; file?: File | null },
) {
const body = new FormData();
body.set('receivedOn', input.receivedOn);
if (input.details?.trim()) body.set('details', input.details.trim());
if (input.committedCorrectionOn) body.set('committedCorrectionOn', input.committedCorrectionOn);
if (input.contactName?.trim()) body.set('contactName', input.contactName.trim());
if (input.contactEmail?.trim()) body.set('contactEmail', input.contactEmail.trim());
if (input.file) body.set('file', input.file);
return apiRequest<InspectionReportWorkflowView>(`/inspection-reports/${id}/company-responses`, { method: 'POST', body });
}
export function addInspectionReportFollowUp(
id: string,
input: {
@@ -206,6 +238,10 @@ export function inspectionReportGedoPdfDownloadUrl(id: string) {
return `/api/v3/inspection-reports/${id}/gedo-pdf`;
}
export function inspectionReportCompanyResponseDownloadUrl(reportId: string, responseId: string) {
return `/api/v3/inspection-reports/${reportId}/company-responses/${responseId}/content`;
}
export function inspectionReportFollowUpDownloadUrl(reportId: string, followUpId: string) {
return `/api/v3/inspection-reports/${reportId}/follow-ups/${followUpId}/content`;
}