diff --git a/app/src/components/StepsStepper.vue b/app/src/components/StepsStepper.vue index 18f059f..7879eba 100644 --- a/app/src/components/StepsStepper.vue +++ b/app/src/components/StepsStepper.vue @@ -69,6 +69,7 @@ const currentComponent = computed(() => { if (id === 'children') return defineAsyncComponent(() => import('./steps/ChildrenStep.vue')) if (id === 'income') return defineAsyncComponent(() => import('./steps/IncomeStep.vue')) if (id === 'professionalExpenses') return defineAsyncComponent(() => import('./steps/ProfessionalExpensesStep.vue')) + if (id === 'sideIncome') return defineAsyncComponent(() => import('./steps/SideIncomeStep.vue')) return null }) diff --git a/app/src/components/steps/SideIncomeStep.vue b/app/src/components/steps/SideIncomeStep.vue new file mode 100644 index 0000000..4f566de --- /dev/null +++ b/app/src/components/steps/SideIncomeStep.vue @@ -0,0 +1,83 @@ + + + + + diff --git a/app/src/generated/commit-info.ts b/app/src/generated/commit-info.ts index 2a511ef..56041af 100644 --- a/app/src/generated/commit-info.ts +++ b/app/src/generated/commit-info.ts @@ -1,2 +1,2 @@ // Auto-generated by scripts/generate-commit-info.mjs -export const COMMIT_CODE = "62da803" as const +export const COMMIT_CODE = "7f3543f" as const diff --git a/app/src/i18n/locales/de-DE/steps.ts b/app/src/i18n/locales/de-DE/steps.ts index 2c38aac..e55fb00 100644 --- a/app/src/i18n/locales/de-DE/steps.ts +++ b/app/src/i18n/locales/de-DE/steps.ts @@ -96,6 +96,11 @@ export default { noAttachments: 'Dokumente anhängen' }, + sideIncome: { + hasSideIncome: 'Haben Sie ein Nebeneinkommen?', + attachments: 'Dokumente anhängen' + }, + informazionesualimenti: 'Informationen zu Unterhalt', inserireindirizzocogniuge: 'Adresse des Ehepartners eingeben', inserireindirizzopartner: 'Adresse des Partners eingeben', diff --git a/app/src/i18n/locales/en-US/steps.ts b/app/src/i18n/locales/en-US/steps.ts index 2f39f2b..d059126 100644 --- a/app/src/i18n/locales/en-US/steps.ts +++ b/app/src/i18n/locales/en-US/steps.ts @@ -112,6 +112,11 @@ export default { hasCanteenOrVouchers: 'Do you have a canteen or meal vouchers?' }, + sideIncome: { + hasSideIncome: 'Do you have supplementary income?', + attachments: 'Attach documents' + }, + informazionesualimenti: 'Alimony information', inserireindirizzocogniuge: 'Enter spouse address', inserireindirizzopartner: 'Enter partner address', diff --git a/app/src/i18n/locales/fr-FR/steps.ts b/app/src/i18n/locales/fr-FR/steps.ts index dd0da5f..e11bc44 100644 --- a/app/src/i18n/locales/fr-FR/steps.ts +++ b/app/src/i18n/locales/fr-FR/steps.ts @@ -96,6 +96,11 @@ export default { noAttachments: 'Joindre des documents' }, + sideIncome: { + hasSideIncome: 'Avez-vous un revenu accessoire ?', + attachments: 'Joindre des documents' + }, + informazionesualimenti: 'Informations sur la pension alimentaire', inserireindirizzocogniuge: "Saisir l'adresse du conjoint", inserireindirizzopartner: "Saisir l'adresse du partenaire", diff --git a/app/src/i18n/locales/it-IT/steps.ts b/app/src/i18n/locales/it-IT/steps.ts index 5816cce..30f97e4 100644 --- a/app/src/i18n/locales/it-IT/steps.ts +++ b/app/src/i18n/locales/it-IT/steps.ts @@ -112,6 +112,11 @@ export default { hasCanteenOrVouchers: 'Hai mensa o buoni pasto?' }, + sideIncome: { + hasSideIncome: 'Hai un reddito accessorio?', + attachments: 'Allega i documenti' + }, + informazionesualimenti: 'Informazioni su alimenti', inserireindirizzocogniuge: "Inserire l'indirizzo del coniuge", inserireindirizzopartner: "Inserire l'indirizzo del partner", diff --git a/app/src/stores/sideIncome.ts b/app/src/stores/sideIncome.ts new file mode 100644 index 0000000..dd6da38 --- /dev/null +++ b/app/src/stores/sideIncome.ts @@ -0,0 +1,67 @@ +import { defineStore } from 'pinia' +import { LocalStorage } from 'quasar' + +export interface SideIncomeData { + hasSideIncome: boolean, + sideIncomeDocuments: { + comments: string, + attachments: [] + } + +} + +const STORAGE_KEY = 'sideIncome:v1' + +const DEFAULT: SideIncomeData = { + hasSideIncome: false, + sideIncomeDocuments: { comments: '', attachments: [] } +} + +function isRecord(v: unknown): v is Record { + return !!v && typeof v === 'object' && !Array.isArray(v) +} + +export const useSideIncomeStore = defineStore('sideincomestore', { + state: () => { + try { + let saved: unknown = LocalStorage.getItem(STORAGE_KEY) + if (typeof saved === 'string') { + try { + saved = JSON.parse(saved) + } catch { + saved = null + } + } + if (isRecord(saved)) { + return { data: { ...DEFAULT, ...(saved as Partial) } as SideIncomeData } + } + } catch { + // ignore and fall back to default + } + return { data: { ...DEFAULT } as SideIncomeData } + }, + actions: { + persist() { + try { + LocalStorage.set(STORAGE_KEY, this.data) + } catch (err) { + console.error('sideIncome.store: persist error', err) + } + }, + getSideIncome() { + return this.data + }, + setSideIncome(partial: Partial) { + this.data = { ...this.data, ...partial } + this.persist() + }, + replaceSideIncome(payload: SideIncomeData) { + this.data = payload + this.persist() + }, + resetSideIncome() { + this.data = { ...DEFAULT } + this.persist() + } + } +})