fix: target literal financial diagnostics and document V09 QA coverage

This commit is contained in:
2026-11-21 21:40:56 +02:00
parent b20feeb72e
commit 77f621b48d
34 changed files with 924 additions and 8 deletions
+17 -2
View File
@@ -1,5 +1,6 @@
import {
forecastBusinessPlan,
businessPlanNumberError,
type BusinessFinancialPlanInput,
} from './business-financial-plan.ts';
import {
@@ -272,11 +273,18 @@ export function buildComplementaryTables(
!r.responsible?.trim() ||
!r.department?.trim() ||
!date(r.start_date ?? '') ||
!date(r.due_date) ||
!date(r.due_date)
)
milestones.issues.push(
`Marco ${i + 1}: complete título, responsável, departamento e datas de início/término válidas.`,
);
if (
date(r.start_date ?? '') &&
date(r.due_date) &&
r.start_date! > r.due_date
)
milestones.issues.push(
`Marco ${i + 1}: complete título, responsável, departamento e datas de início/término válidas e ordenadas.`,
`Marcos / Marco ${i + 1} / «Prazo previsto»: A data de término não pode ser anterior à data de início.`,
);
milestones.rows.push([
r.title || unknown,
@@ -354,6 +362,13 @@ export function buildComplementaryTables(
try {
if (!r.competency.trim() || !r.department?.trim())
throw Error('Indique função e departamento.');
const quantityError = businessPlanNumberError(r.quantity ?? '', {
integer: true,
});
if (quantityError)
throw Error(
`«Quantidade de pessoas (inteiro)»: ${quantityError}`,
);
const count = integer(r.quantity, 0, 1000000),
salary = amount(r.monthly_salary),
start = integer(r.start_month, 1, periods),