feat(qa): integrate financial example, growth, dividends and detailed declarations

This commit is contained in:
2026-11-20 14:59:36 +02:00
parent b2cfa93945
commit 9c34af0406
13 changed files with 1532 additions and 54 deletions
@@ -5,6 +5,9 @@ import {
isReportAssumptions,
} from '@/lib/integral-financial-report';
import { InvestmentReportTables } from './investment-report-tables';
import { BusinessPlanWarnings } from './business-plan-warnings';
import { financialPlanWarnings } from '@/lib/financial-plan-warnings';
import { buildAnnualExampleTables } from '@/lib/annual-example-report';
export function IntegralFinancialPlan({
plan,
@@ -13,6 +16,30 @@ export function IntegralFinancialPlan({
plan: BusinessFinancialPlanInput;
onChange: (plan: BusinessFinancialPlanInput) => void;
}) {
if (plan.reportSource === 'annual_example') {
try {
return (
<section aria-label="Relatório do exemplo sintético">
<h4>Relatório do exemplo sintético anual</h4>
<p>
As onze tabelas abaixo usam o exemplo editável. Os dados
reais do investimento ficam conservados separadamente.
</p>
<InvestmentReportTables
tables={buildAnnualExampleTables(plan)}
/>
</section>
);
} catch (error) {
return (
<p role="alert">
{error instanceof Error
? error.message
: 'Confira o cenário de exemplo.'}
</p>
);
}
}
if (plan.reportAssumptions && !isReportAssumptions(plan.reportAssumptions))
return (
<p role="alert">
@@ -258,6 +285,12 @@ export function IntegralFinancialPlan({
<InvestmentReportTables
tables={buildIntegralFinancialTables(plan)}
/>
<BusinessPlanWarnings
warnings={financialPlanWarnings(
plan,
buildIntegralFinancialTables(plan),
)}
/>
</details>
);
}