fix(sanity): resolve 15 gaps from sanity check audit (G-01 through G-15)
- G-01: ProjectWizard renders blueprint fieldDefs with DynamicFieldInput component - G-02: Blueprint rolePresets validated via RolePresetsSchema in wizard; API keeps loose schema - G-03: ProjectWizard step 2/3 validation (role, hoursPerDay, headcount required) - G-04: EstimateWizard validates baseCurrency and demand line cost rates - G-05: Project lifecycle transition guards with ALLOWED_TRANSITIONS map - G-06: Blueprint validator extended for minLength/maxLength/pattern and DATE range checks - G-07: assertBlueprintDynamicFields merges global blueprint fieldDefs into validation - G-08: (tracked — chapter managed dropdown; deferred to backend ticket) - G-09: JSDoc added to lcrCents/ucrCents clarifying LCR/UCR terminology - G-10: Dispo route redirect already in place — closed as done - G-11: packages/ui empty by design — closed as documented - G-12: @deprecated JSDoc added to CreateAllocationSchema and UpdateAllocationSchema - G-13: ProjectWizard review step enhanced with blueprint name, field values, skills, assignments - G-14: ProjectWizard handleSubmit collects per-item warnings instead of silent swallowing - G-15: Vacation cancel reverses usedDays entitlement for APPROVED ANNUAL/OTHER vacations Tests: all 1575 passing (1 pre-existing failure in insights-summary unrelated to these changes) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -296,11 +296,30 @@ export function EstimateWizard({ onClose }: { onClose: () => void }) {
|
||||
}
|
||||
|
||||
function validateStep(targetStep: number) {
|
||||
// Moving from step 0 → step 1: require name
|
||||
if (targetStep === 1 && !name.trim()) {
|
||||
setError("Estimate name is required.");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Moving from step 0 → step 1: require base currency
|
||||
if (targetStep === 1 && !baseCurrency.trim()) {
|
||||
setError("Base currency is required.");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Moving from step 3 (Staffing) → step 4 (Review): validate demand lines
|
||||
if (targetStep === 4) {
|
||||
const linesWithHours = demandLines.filter((l) => toHours(l.hours) > 0);
|
||||
const invalid = linesWithHours.find((l) => toCents(l.costRate) <= 0);
|
||||
if (invalid) {
|
||||
setError(
|
||||
`Demand line "${invalid.name || "unnamed"}" has hours but no cost rate. Please enter a cost rate or remove the line.`,
|
||||
);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
setError(null);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user