feat(qa): integrate financial example, growth, dividends and detailed declarations
This commit is contained in:
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user