fix(qa): clarify and deduplicate V12 financial inconsistency messages
This commit is contained in:
@@ -2,24 +2,40 @@ import {
|
||||
displayReportMoney,
|
||||
type InvestmentReportTable,
|
||||
} from '@/lib/integral-financial-report';
|
||||
import { financialIssuesForDisplay } from '@/lib/financial-issue-presentation';
|
||||
|
||||
export function InvestmentReportTables({
|
||||
tables,
|
||||
}: {
|
||||
tables: InvestmentReportTable[];
|
||||
}) {
|
||||
const issues = financialIssuesForDisplay(tables);
|
||||
return (
|
||||
<div className="space-y-5">
|
||||
{issues.length > 0 && (
|
||||
<aside
|
||||
aria-label="Dados financeiros a corrigir"
|
||||
className="space-y-2 rounded border border-amber-400 bg-amber-50 p-3 text-sm"
|
||||
>
|
||||
<h4 className="font-semibold">
|
||||
Confira os dados de origem
|
||||
</h4>
|
||||
<ul className="list-disc space-y-2 pl-5">
|
||||
{issues.map((issue) => (
|
||||
<li key={issue.message}>
|
||||
<p>{issue.message}</p>
|
||||
<p className="text-xs">
|
||||
Tabelas afectadas: {issue.tables.join('; ')}
|
||||
.
|
||||
</p>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</aside>
|
||||
)}
|
||||
{tables.map((table) => (
|
||||
<section key={table.id} aria-label={table.title}>
|
||||
<h4 className="font-semibold">{table.title}</h4>
|
||||
{table.issues.length > 0 && (
|
||||
<ul className="list-disc pl-5 text-amber-900">
|
||||
{[...new Set(table.issues)].map((issue) => (
|
||||
<li key={issue}>{issue}</li>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
{table.rows.length > 0 && (
|
||||
<div
|
||||
className="overflow-x-auto"
|
||||
|
||||
@@ -26,6 +26,7 @@ import { FinancialRatiosPlan } from '@/components/financial-ratios-plan';
|
||||
import { PlanEconomicClassification } from '@/components/plan-economic-classification';
|
||||
import { FinancialPlanDetails } from '@/components/financial-plan-details';
|
||||
import { StartupAssetRequirements } from '@/components/startup-asset-requirements';
|
||||
import { forecastErrorShownInReport } from '@/lib/financial-issue-presentation';
|
||||
|
||||
const emptyPlan: BusinessFinancialPlanInput = {
|
||||
currency: '',
|
||||
@@ -2531,7 +2532,7 @@ export function SimulationBusinessPlan({
|
||||
)}
|
||||
</details>
|
||||
|
||||
{error && (
|
||||
{error && !forecastErrorShownInReport(plan, error) && (
|
||||
<p role="alert" className="my-3 text-sm text-red-800">
|
||||
{error}
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user