From a2b5ae17f3014036354f91f8924a5e5c02dbf98e Mon Sep 17 00:00:00 2001
From: Luca <102960244+Luca-Timo@users.noreply.github.com>
Date: Wed, 3 Jun 2026 19:28:47 +0200
Subject: [PATCH] fix(crm): drop redundant 'Country (full name)' field
The customer detail + business profile forms showed both a Country picker
(stores the ISO code) and a free-text 'Country (full name)' override
(migration 107). Now that the picker offers the full ISO list and the PDF
renderer derives the localized full name from the code (pdfService.countryName,
used as 'country_name || derive' for both issuer and recipient), the free-text
field is redundant. Remove the input from both forms. The DB column + the
fallback stay, so any legacy override still renders.
---
.../src/pages/admin/CustomerDetailPage.tsx | 18 +++++-------------
.../settings/SettingsBusinessProfilePage.tsx | 12 +++++-------
2 files changed, 10 insertions(+), 20 deletions(-)
diff --git a/frontend/src/pages/admin/CustomerDetailPage.tsx b/frontend/src/pages/admin/CustomerDetailPage.tsx
index 431e842b..0a6edfe9 100644
--- a/frontend/src/pages/admin/CustomerDetailPage.tsx
+++ b/frontend/src/pages/admin/CustomerDetailPage.tsx
@@ -545,19 +545,11 @@ export const CustomerDetailPage: React.FC = () => {
onChange={(code) => setForm((prev) => ({ ...prev, countryCode: code }))}
/>
-
- {/* Free-text country name override (migration 107). When
- left empty the PDF renderer falls back to the locale-
- aware lookup on the ISO code. Kept for the rare case
- where an operator wants a custom display name that
- differs from the standard localized label. */}
-
-
-
+ {/* The free-text "Country (full name)" override (migration 107) was
+ removed as redundant — the country picker stores the ISO code and
+ the PDF renderer derives the localized full name from it
+ (pdfService.countryName). The DB column + the `country_name ||`
+ fallback stay, so any legacy override still renders. */}
diff --git a/frontend/src/pages/admin/settings/SettingsBusinessProfilePage.tsx b/frontend/src/pages/admin/settings/SettingsBusinessProfilePage.tsx
index cff6045f..2a4e97f8 100644
--- a/frontend/src/pages/admin/settings/SettingsBusinessProfilePage.tsx
+++ b/frontend/src/pages/admin/settings/SettingsBusinessProfilePage.tsx
@@ -88,13 +88,11 @@ export const SettingsBusinessProfilePage: React.FC = () => {
setProfile({ ...profile, countryCode: code })} />
- {/* Free-text country name override (migration 107). When
- left empty the renderer falls back to the COUNTRY_NAMES
- lookup on the abbreviation. */}
- setProfile({ ...profile, countryName: e.target.value })} />
+ {/* The free-text "Country (full name)" override (migration 107) was
+ removed as redundant — the picker stores the ISO code and the PDF
+ renderer derives the localized full name from it
+ (pdfService.countryName). The DB column + `country_name ||`
+ fallback remain, so any legacy override still renders. */}