refactor: replace generateTenantCode boolean with tenantPaymentMethod enum

- Replace generateTenantCode boolean field with tenantPaymentMethod enum ("none" | "iban" | "revolut")
- Update LocationEditForm to use dropdown select instead of toggle for payment method selection
- Consolidate multiple useState hooks into single formValues state object
- Change from defaultValue to controlled components with value/onChange pattern
- Add hidden inputs to preserve tenant data when payment method is not selected
- Update validation logic to check tenantPaymentMethod === "iban"
- Update ViewLocationCard to use new tenantPaymentMethod field
- Add Croatian translations for new dropdown options

This provides better scalability for adding future payment methods and improves form state management.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-24 15:34:59 +01:00
parent ead7451170
commit 3e581d8878
5 changed files with 108 additions and 74 deletions

View File

@@ -51,8 +51,10 @@ export interface BillingLocation {
bills: Bill[];
/** (optional) notes */
notes: string|null;
/** (optional) whether to generate 2D code for tenant */
generateTenantCode?: boolean | null;
/** (optional) method for showing payment instructions to tenant */
tenantPaymentMethod?: "none" | "iban" | "revolut" | null;
/** (optional) tenant name */
tenantName?: string | null;
/** (optional) tenant street */