fix: remove demonstration scenario from investor simulator and exports

This commit is contained in:
2026-11-23 09:11:12 +02:00
parent 8ffb0f1bc5
commit e929632e42
16 changed files with 565 additions and 150 deletions
@@ -1,9 +1,4 @@
import type { BusinessFinancialPlanInput } from '@/lib/business-financial-plan';
import {
newAnnualReferencePlan,
serializeAnnualExampleSnapshot,
} from '@/lib/business-plan-guidance';
/** Optional declarations share the existing plan snapshot; no independent storage. */
export function FinancialPlanDetails({
plan,
@@ -50,42 +45,23 @@ export function FinancialPlanDetails({
introduzida; não se presume que um mês tenha 30 dias. Confira a
compatibilidade entre contrato e cobranças previstas.
</p>
<label className="grid gap-1">
Fonte do relatório financeiro consolidado
<select
className="rounded border p-2"
value={plan.reportSource ?? 'investor'}
onChange={(e) =>
onChange({
...plan,
reportSource: e.target.value as
| 'investor'
| 'annual_example',
...(e.target.value === 'annual_example' &&
!plan.annualExampleSnapshot
? {
annualExampleSnapshot:
serializeAnnualExampleSnapshot(
newAnnualReferencePlan(),
),
}
: {}),
})
}
>
<option value="investor">Plano do investidor</option>
<option value="annual_example">
Exemplo sintético anual editável
</option>
</select>
</label>
<p className="text-sm">
A escolha do exemplo muda apenas a fonte do relatório, sem
substituir as entradas do investidor. As edições do exemplo são
feitas em «Carregar cenário anual de exemplo» e acompanham a
mesma versão guardada. Escolha novamente «Plano do investidor»
para regressar.
</p>
{plan.reportSource === 'annual_example' && (
<div role="alert" className="rounded border p-3">
<p>
Seleccione o plano do investidor para apresentar os seus
dados financeiros. Os dados guardados foram preservados.
</p>
<button
type="button"
className="underline"
onClick={() =>
onChange({ ...plan, reportSource: 'investor' })
}
>
Usar plano do investidor
</button>
</div>
)}
<label className="flex gap-2">
<input
type="checkbox"