Remove lastName field from UserSettings and database

- Removed lastName from UserSettings interface
- Updated UserSettingsForm to remove lastName input field
- Removed lastName from all database operations
- Updated form validation schema to remove lastName validation
- Updated ViewLocationCard to use only firstName for recipient name
- Removed lastName from user settings form state tracking
- Updated Croatian translations to reflect changes

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Knee Cola
2025-11-22 22:26:41 +01:00
parent 86913f60ec
commit c1762f7157
5 changed files with 15 additions and 55 deletions

View File

@@ -28,7 +28,6 @@ const FormFields: FC<FormFieldsProps> = ({ userSettings, errors, message }) => {
// Track current form values for real-time validation
const [formValues, setFormValues] = useState({
firstName: userSettings?.firstName ?? "",
lastName: userSettings?.lastName ?? "",
street: userSettings?.street ?? "",
town: userSettings?.town ?? "",
iban: formatIban(userSettings?.iban) ?? "",
@@ -41,7 +40,7 @@ const FormFields: FC<FormFieldsProps> = ({ userSettings, errors, message }) => {
// Check if any required field is missing (clean IBAN of spaces for validation)
const cleanedIban = formValues.iban.replace(/\s/g, '');
const hasMissingData = !formValues.firstName || !formValues.lastName || !formValues.street || !formValues.town || !cleanedIban || !formValues.currency;
const hasMissingData = !formValues.firstName || !formValues.street || !formValues.town || !cleanedIban || !formValues.currency;
// Track whether to generate 2D code for tenant (use persisted value from database)
const [show2dCodeInMonthlyStatement, setShow2dCodeInMonthlyStatement] = useState(
@@ -94,30 +93,6 @@ const FormFields: FC<FormFieldsProps> = ({ userSettings, errors, message }) => {
</div>
</div>
<div className="form-control w-full">
<label className="label">
<span className="label-text">{t("last-name-label")}</span>
</label>
<input
id="lastName"
name="lastName"
type="text"
placeholder={t("last-name-placeholder")}
className="input input-bordered w-full placeholder:text-gray-600"
defaultValue={userSettings?.lastName ?? ""}
onChange={(e) => handleInputChange("lastName", e.target.value)}
disabled={pending}
/>
<div id="lastName-error" aria-live="polite" aria-atomic="true">
{errors?.lastName &&
errors.lastName.map((error: string) => (
<p className="mt-2 text-sm text-red-500" key={error}>
{error}
</p>
))}
</div>
</div>
<div className="form-control w-full">
<label className="label">
<span className="label-text">{t("street-label")} </span>

View File

@@ -28,7 +28,7 @@ export const ViewLocationCard:FC<ViewLocationCardProps> = ({location, userSettin
ImePlatitelja: tenantName ?? "",
AdresaPlatitelja: tenantStreet ?? "",
SjedistePlatitelja: tenantTown ?? "",
Primatelj: (userSettings?.firstName && userSettings?.lastName) ? `${userSettings.firstName} ${userSettings.lastName}` : "",
Primatelj: userSettings?.firstName ?? "",
AdresaPrimatelja: userSettings?.street ?? "",
SjedistePrimatelja: userSettings?.town ?? "",
IBAN: userSettings?.iban ?? "",