@@ -2,7 +2,8 @@ import { csvCell } from './csv.js';
|
||||
import { isApiSimulationResultSnapshotV1 } from './simulation-contract.ts';
|
||||
|
||||
export type SimulationDraft = Record<string, string | string[]>;
|
||||
export const projectQuestionnaireVersion = 'investmoz-project-dossier-2026-10-05.1';
|
||||
export const projectQuestionnaireVersion =
|
||||
'investmoz-project-dossier-2026-10-05.1';
|
||||
|
||||
function isProjectGuidedJourney(draft: SimulationDraft): boolean {
|
||||
return (
|
||||
@@ -12,7 +13,9 @@ function isProjectGuidedJourney(draft: SimulationDraft): boolean {
|
||||
}
|
||||
|
||||
function isInvestorProjectJourney(draft: SimulationDraft): boolean {
|
||||
return draft.purpose === 'simulate_only' && draft.journey_type === 'investor';
|
||||
return (
|
||||
draft.purpose === 'simulate_only' && draft.journey_type === 'investor'
|
||||
);
|
||||
}
|
||||
|
||||
export function getFiscalPeriodRange(
|
||||
@@ -87,7 +90,13 @@ export function getSimulationSections(draft: SimulationDraft) {
|
||||
if (draft.journey_type === 'investor') {
|
||||
return [
|
||||
...simulationSections.filter((section) =>
|
||||
['purpose', 'project', 'location', 'financial', 'tax'].includes(section.id),
|
||||
[
|
||||
'purpose',
|
||||
'project',
|
||||
'location',
|
||||
'financial',
|
||||
'tax',
|
||||
].includes(section.id),
|
||||
),
|
||||
{ id: 'scenarios', title: 'Cenários e retorno indicativo' },
|
||||
{ id: 'procedures', title: 'Procedimentos e documentos' },
|
||||
@@ -254,7 +263,13 @@ export const simulationOptions: Record<string, string[]> = {
|
||||
'unknown',
|
||||
],
|
||||
preparedness_status: ['yes', 'no', 'partial', 'unknown', 'not_applicable'],
|
||||
funding_status: ['confirmed', 'in_process', 'not_started', 'unknown', 'not_applicable'],
|
||||
funding_status: [
|
||||
'confirmed',
|
||||
'in_process',
|
||||
'not_started',
|
||||
'unknown',
|
||||
'not_applicable',
|
||||
],
|
||||
fiscal_month: Array.from({ length: 12 }, (_, index) =>
|
||||
String(index + 1).padStart(2, '0'),
|
||||
),
|
||||
@@ -501,19 +516,25 @@ export const simulationFieldGroups: Record<
|
||||
key: 'target_customers',
|
||||
label: 'Quem são os clientes ou beneficiários?',
|
||||
type: 'textarea',
|
||||
showWhen: (d) => d.purpose === 'simulate_only' && ['small_business', 'investor'].includes(String(d.journey_type)),
|
||||
showWhen: (d) =>
|
||||
d.purpose === 'simulate_only' &&
|
||||
['small_business', 'investor'].includes(String(d.journey_type)),
|
||||
},
|
||||
{
|
||||
key: 'value_proposition',
|
||||
label: 'Que solução ou proposta de valor oferece?',
|
||||
type: 'textarea',
|
||||
showWhen: (d) => d.purpose === 'simulate_only' && ['small_business', 'investor'].includes(String(d.journey_type)),
|
||||
showWhen: (d) =>
|
||||
d.purpose === 'simulate_only' &&
|
||||
['small_business', 'investor'].includes(String(d.journey_type)),
|
||||
},
|
||||
{
|
||||
key: 'market_assumption',
|
||||
label: 'Hipótese sobre mercado, concorrência ou procura',
|
||||
type: 'textarea',
|
||||
showWhen: (d) => d.purpose === 'simulate_only' && ['small_business', 'investor'].includes(String(d.journey_type)),
|
||||
showWhen: (d) =>
|
||||
d.purpose === 'simulate_only' &&
|
||||
['small_business', 'investor'].includes(String(d.journey_type)),
|
||||
},
|
||||
{
|
||||
key: 'market_source',
|
||||
@@ -600,42 +621,56 @@ export const simulationFieldGroups: Record<
|
||||
key: 'customer_validation_status',
|
||||
label: 'Já conversou com potenciais clientes sobre esta necessidade?',
|
||||
options: 'preparedness_status',
|
||||
showWhen: (d) => d.purpose === 'simulate_only' && ['small_business', 'investor'].includes(String(d.journey_type)),
|
||||
showWhen: (d) =>
|
||||
d.purpose === 'simulate_only' &&
|
||||
['small_business', 'investor'].includes(String(d.journey_type)),
|
||||
},
|
||||
{
|
||||
key: 'target_customers',
|
||||
label: 'Quem são os clientes ou beneficiários? Onde estão e que necessidade têm?',
|
||||
type: 'textarea',
|
||||
showWhen: (d) => d.purpose === 'simulate_only' && ['small_business', 'investor'].includes(String(d.journey_type)),
|
||||
showWhen: (d) =>
|
||||
d.purpose === 'simulate_only' &&
|
||||
['small_business', 'investor'].includes(String(d.journey_type)),
|
||||
},
|
||||
{
|
||||
key: 'market_assumption',
|
||||
label: 'O que sabe ou está a assumir sobre procura, preço e concorrência?',
|
||||
type: 'textarea',
|
||||
showWhen: (d) => d.purpose === 'simulate_only' && ['small_business', 'investor'].includes(String(d.journey_type)),
|
||||
showWhen: (d) =>
|
||||
d.purpose === 'simulate_only' &&
|
||||
['small_business', 'investor'].includes(String(d.journey_type)),
|
||||
},
|
||||
{
|
||||
key: 'market_source',
|
||||
label: 'Qual é a origem e a data dessa informação, se as conhecer?',
|
||||
showWhen: (d) => d.purpose === 'simulate_only' && ['small_business', 'investor'].includes(String(d.journey_type)),
|
||||
showWhen: (d) =>
|
||||
d.purpose === 'simulate_only' &&
|
||||
['small_business', 'investor'].includes(String(d.journey_type)),
|
||||
},
|
||||
{
|
||||
key: 'competitor_assumption',
|
||||
label: 'Que alternativas ou concorrentes os clientes usam actualmente?',
|
||||
type: 'textarea',
|
||||
showWhen: (d) => d.purpose === 'simulate_only' && ['small_business', 'investor'].includes(String(d.journey_type)),
|
||||
showWhen: (d) =>
|
||||
d.purpose === 'simulate_only' &&
|
||||
['small_business', 'investor'].includes(String(d.journey_type)),
|
||||
},
|
||||
{
|
||||
key: 'sales_channel_assumption',
|
||||
label: 'Como pretende chegar aos clientes e receber encomendas?',
|
||||
type: 'textarea',
|
||||
showWhen: (d) => d.purpose === 'simulate_only' && ['small_business', 'investor'].includes(String(d.journey_type)),
|
||||
showWhen: (d) =>
|
||||
d.purpose === 'simulate_only' &&
|
||||
['small_business', 'investor'].includes(String(d.journey_type)),
|
||||
},
|
||||
{
|
||||
key: 'marketing_approach',
|
||||
label: 'Que acções de divulgação pretende experimentar?',
|
||||
type: 'textarea',
|
||||
showWhen: (d) => d.purpose === 'simulate_only' && ['small_business', 'investor'].includes(String(d.journey_type)),
|
||||
showWhen: (d) =>
|
||||
d.purpose === 'simulate_only' &&
|
||||
['small_business', 'investor'].includes(String(d.journey_type)),
|
||||
},
|
||||
],
|
||||
location: [
|
||||
@@ -643,7 +678,8 @@ export const simulationFieldGroups: Record<
|
||||
key: 'location_assessment_status',
|
||||
label: 'Já avaliou a adequação desta localização?',
|
||||
options: 'preparedness_status',
|
||||
showWhen: (d) => ['small_business', 'investor'].includes(String(d.journey_type)),
|
||||
showWhen: (d) =>
|
||||
['small_business', 'investor'].includes(String(d.journey_type)),
|
||||
},
|
||||
{
|
||||
key: 'province_id',
|
||||
@@ -684,31 +720,36 @@ export const simulationFieldGroups: Record<
|
||||
label: 'Local conhecido?',
|
||||
options: 'yes_no',
|
||||
required: (d) => d.purpose !== 'simulate_only',
|
||||
showWhen: (d) => d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
showWhen: (d) =>
|
||||
d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
},
|
||||
{
|
||||
key: 'location_rationale',
|
||||
label: 'Porque considera esta localização e o que ainda precisa de confirmar?',
|
||||
type: 'textarea',
|
||||
showWhen: (d) => ['small_business', 'investor'].includes(String(d.journey_type)),
|
||||
showWhen: (d) =>
|
||||
['small_business', 'investor'].includes(String(d.journey_type)),
|
||||
},
|
||||
{
|
||||
key: 'land_status',
|
||||
label: 'Situação do terreno',
|
||||
options: 'land_status',
|
||||
showWhen: (d) => d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
showWhen: (d) =>
|
||||
d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
},
|
||||
{
|
||||
key: 'area_required',
|
||||
label: 'Área necessária',
|
||||
type: 'number',
|
||||
showWhen: (d) => d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
showWhen: (d) =>
|
||||
d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
},
|
||||
{
|
||||
key: 'area_unit',
|
||||
label: 'Unidade da área',
|
||||
options: 'area_unit',
|
||||
showWhen: (d) => d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
showWhen: (d) =>
|
||||
d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
},
|
||||
{
|
||||
key: 'latitude',
|
||||
@@ -725,14 +766,16 @@ export const simulationFieldGroups: Record<
|
||||
{
|
||||
key: 'special_zone_id',
|
||||
label: 'Zona especial ZEE/ZFI',
|
||||
showWhen: (d) => d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
showWhen: (d) =>
|
||||
d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
},
|
||||
{
|
||||
key: 'infrastructure_needs',
|
||||
label: 'Necessidades de infra-estrutura',
|
||||
options: 'infrastructure',
|
||||
multiple: true,
|
||||
showWhen: (d) => d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
showWhen: (d) =>
|
||||
d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
},
|
||||
],
|
||||
financial: [
|
||||
@@ -740,86 +783,99 @@ export const simulationFieldGroups: Record<
|
||||
key: 'cost_estimate_status',
|
||||
label: 'Já identificou os principais custos e respectiva periodicidade?',
|
||||
options: 'preparedness_status',
|
||||
showWhen: (d) => ['small_business', 'investor'].includes(String(d.journey_type)),
|
||||
showWhen: (d) =>
|
||||
['small_business', 'investor'].includes(String(d.journey_type)),
|
||||
},
|
||||
{
|
||||
key: 'receivables_timing_status',
|
||||
label: 'Já sabe quando as vendas serão recebidas?',
|
||||
options: 'preparedness_status',
|
||||
showWhen: (d) => ['small_business', 'investor'].includes(String(d.journey_type)),
|
||||
showWhen: (d) =>
|
||||
['small_business', 'investor'].includes(String(d.journey_type)),
|
||||
},
|
||||
{
|
||||
key: 'funding_status',
|
||||
label: 'Qual é o estado dos recursos de financiamento de que precisa?',
|
||||
options: 'funding_status',
|
||||
showWhen: (d) => ['small_business', 'investor'].includes(String(d.journey_type)),
|
||||
showWhen: (d) =>
|
||||
['small_business', 'investor'].includes(String(d.journey_type)),
|
||||
},
|
||||
{
|
||||
key: 'currency',
|
||||
label: 'Moeda',
|
||||
options: 'currency',
|
||||
required: (d) => d.purpose !== 'simulate_only',
|
||||
showWhen: (d) => d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
showWhen: (d) =>
|
||||
d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
},
|
||||
{
|
||||
key: 'total_investment',
|
||||
label: 'Investimento total',
|
||||
type: 'number',
|
||||
required: (d) => d.purpose !== 'simulate_only',
|
||||
showWhen: (d) => d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
showWhen: (d) =>
|
||||
d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
},
|
||||
{
|
||||
key: 'own_capital',
|
||||
label: 'Capital próprio',
|
||||
type: 'number',
|
||||
required: (d) => d.purpose !== 'simulate_only',
|
||||
showWhen: (d) => d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
showWhen: (d) =>
|
||||
d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
},
|
||||
{
|
||||
key: 'domestic_debt',
|
||||
label: 'Financiamento interno',
|
||||
type: 'number',
|
||||
required: (d) => d.purpose !== 'simulate_only',
|
||||
showWhen: (d) => d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
showWhen: (d) =>
|
||||
d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
},
|
||||
{
|
||||
key: 'foreign_debt',
|
||||
label: 'Financiamento externo',
|
||||
type: 'number',
|
||||
required: (d) => d.purpose !== 'simulate_only',
|
||||
showWhen: (d) => d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
showWhen: (d) =>
|
||||
d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
},
|
||||
{
|
||||
key: 'grants',
|
||||
label: 'Subvenções',
|
||||
type: 'number',
|
||||
required: (d) => d.purpose !== 'simulate_only',
|
||||
showWhen: (d) => d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
showWhen: (d) =>
|
||||
d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
},
|
||||
{
|
||||
key: 'secured_amount',
|
||||
label: 'Montante mobilizado',
|
||||
type: 'number',
|
||||
required: (d) => d.purpose !== 'simulate_only',
|
||||
showWhen: (d) => d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
showWhen: (d) =>
|
||||
d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
},
|
||||
{
|
||||
key: 'sought_amount',
|
||||
label: 'Montante procurado',
|
||||
type: 'number',
|
||||
showWhen: (d) => d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
showWhen: (d) =>
|
||||
d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
},
|
||||
{
|
||||
key: 'annual_revenue',
|
||||
label: 'Receitas anuais estimadas',
|
||||
type: 'number',
|
||||
showWhen: (d) => d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
showWhen: (d) =>
|
||||
d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
},
|
||||
{
|
||||
key: 'annual_operating_costs',
|
||||
label: 'Custos operacionais anuais',
|
||||
type: 'number',
|
||||
showWhen: (d) => d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
showWhen: (d) =>
|
||||
d.purpose !== 'simulate_only' || isInvestorProjectJourney(d),
|
||||
},
|
||||
{
|
||||
key: 'expected_profit',
|
||||
@@ -1232,7 +1288,8 @@ export const simulationFieldGroups: Record<
|
||||
label: 'Documentos de suporte que já possui ou pretende preparar',
|
||||
options: 'document_types',
|
||||
multiple: true,
|
||||
showWhen: (d) => d.journey_type === 'investor' && d.purpose === 'simulate_only',
|
||||
showWhen: (d) =>
|
||||
d.journey_type === 'investor' && d.purpose === 'simulate_only',
|
||||
},
|
||||
],
|
||||
review: [
|
||||
|
||||
Reference in New Issue
Block a user