diff --git a/apps/web/src/components/admin/DispoImportClient.tsx b/apps/web/src/components/admin/DispoImportClient.tsx index 7182e39..1e78c74 100644 --- a/apps/web/src/components/admin/DispoImportClient.tsx +++ b/apps/web/src/components/admin/DispoImportClient.tsx @@ -65,6 +65,133 @@ const WORKBOOK_LABELS: { key: string; label: string; placeholder: string }[] = [ { key: "roles", label: "Roles Workbook", placeholder: "/data/dispo/roles.xlsx" }, ]; +type ReadinessReport = { + assignmentCount: number; + availabilityRuleCount: number; + canCommitWithFallbacks: boolean; + canCommitWithStrictSourceData: boolean; + fallbackAssumptions: string[]; + issues: { + code: string; + count: number; + message: string; + resolution: string; + severity: "blocker" | "warning"; + }[]; + projectCount: number; + resourceCount: number; + unresolvedCount: number; + vacationCount: number; +}; + +function ReadinessReportPanel({ report }: { report: ReadinessReport }) { + const blockers = report.issues.filter((i) => i.severity === "blocker"); + const warnings = report.issues.filter((i) => i.severity === "warning"); + + return ( +
+ Ready to stage — no blockers found. +
+ ) : report.canCommitWithFallbacks ? ( ++ Can stage with fallback assumptions applied. +
+ ) : ( ++ Blockers present — resolve before staging. +
+ )} + + {/* Counts */} ++ {issue.message} + {issue.count > 1 && ( + ({issue.count}) + )} +
++ {issue.resolution} +
++ {issue.message} + {issue.count > 1 && ( + ({issue.count}) + )} +
++ {issue.resolution} +
++ Fallback assumptions: +
+Validating…
+ )} + {!validateQuery.isFetching && validateQuery.data && ( ++ Validation failed: {validateQuery.error.message} +
+ )} + {error && ({error}
)}