Refactor AccountForm with 2D code toggle and conditional validation
- Refactor AccountForm to use toggle for showing/hiding profile fields - Add show2dCodeInMonthlyStatement field to UserProfile database schema - Implement conditional validation: all fields mandatory when 2D code is enabled - Update FormSchema with .refine() methods for firstName, lastName, address, and IBAN - IBAN validation includes both presence check and format validation when required - Add validation error messages to English and Croatian localization files - Initialize toggle state from persisted database value - Form fields conditionally displayed based on toggle state 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -166,8 +166,9 @@
|
||||
},
|
||||
"account-form": {
|
||||
"title": "Profile Information",
|
||||
"info-box-message": "This information will be used to generate a 2D barcode displayed in the bill view, allowing tenants to scan it and refund the money you have spent on paying utility bills in their name.",
|
||||
"warning-missing-data": "Warning: Some profile fields are missing. The 2D barcode will not be displayed to tenants on the shared bill view until all fields are filled in.",
|
||||
"info-box-message": "By activating this option, a 2D barcode will be included in the monthly statement sent to the tenant, allowing them to make a direct payment to your bank account.",
|
||||
"tenant-2d-code-legend": "TENANT 2D CODE",
|
||||
"tenant-2d-code-toggle-label": "include 2D code in monthly statements",
|
||||
"first-name-label": "First Name",
|
||||
"first-name-placeholder": "Enter your first name",
|
||||
"last-name-label": "Last Name",
|
||||
@@ -179,6 +180,10 @@
|
||||
"save-button": "Save",
|
||||
"cancel-button": "Cancel",
|
||||
"validation": {
|
||||
"first-name-required": "First name is mandatory",
|
||||
"last-name-required": "Last name is mandatory",
|
||||
"address-required": "Address is mandatory",
|
||||
"iban-required": "Valid IBAN is mandatory",
|
||||
"iban-invalid": "Invalid IBAN format. Please enter a valid IBAN",
|
||||
"validation-failed": "Validation failed. Please check the form and try again."
|
||||
}
|
||||
|
||||
@@ -165,8 +165,9 @@
|
||||
},
|
||||
"account-form": {
|
||||
"title": "Podaci o profilu",
|
||||
"info-box-message": "Ovi podaci će se koristiti za generiranje 2D barkoda koji će biti prikazan u pregledu računa, omogućujući podstanarima da ga skeniraju i vrate novac koji ste potrošili na plaćanje režija u njihovo ime.",
|
||||
"warning-missing-data": "Upozorenje: Neki podaci profila nedostaju. 2D barkod neće biti prikazan podstanarima u podijeljenom pregledu računa dok sva polja ne budu popunjena.",
|
||||
"info-box-message": "Ako uključite ovu opciji na mjesečnom obračunu koji se šalje podstanaru biti će prikazan 2D bar kod, putem kojeg će moći izvršiti izravnu uplatu na vaš bankovni račun.",
|
||||
"tenant-2d-code-legend": "2D BARKOD ZA PODSTANARA",
|
||||
"tenant-2d-code-toggle-label": "prikazuj 2D barkod u mjesečnom obračunu",
|
||||
"first-name-label": "Ime",
|
||||
"first-name-placeholder": "Unesite svoje ime",
|
||||
"last-name-label": "Prezime",
|
||||
@@ -178,6 +179,10 @@
|
||||
"save-button": "Spremi",
|
||||
"cancel-button": "Odbaci",
|
||||
"validation": {
|
||||
"first-name-required": "Ime je obavezno",
|
||||
"last-name-required": "Prezime je obavezno",
|
||||
"address-required": "Adresa je obavezna",
|
||||
"iban-required": "Ispravan IBAN je obavezan",
|
||||
"iban-invalid": "Neispravan IBAN format. Molimo unesite ispravan IBAN.",
|
||||
"validation-failed": "Validacija nije uspjela. Molimo provjerite formu i pokušajte ponovno."
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user