Rename autoTenantNotification to autoBillFwd and update related references in forms and translations

This commit is contained in:
Knee Cola
2025-11-18 09:38:04 +01:00
parent 3411ee3cb5
commit c5fe184f9c
5 changed files with 20 additions and 20 deletions

View File

@@ -18,7 +18,7 @@ export type State = {
generateTenantCode?: string[];
tenantFirstName?: string[];
tenantLastName?: string[];
autoTenantNotification?: string[];
autoBillFwd?: string[];
tenantEmail?: string[];
};
message?:string | null;
@@ -35,7 +35,7 @@ const FormSchema = (t:IntlTemplateFn) => z.object({
generateTenantCode: z.boolean().optional().nullable(),
tenantFirstName: z.string().optional().nullable(),
tenantLastName: z.string().optional().nullable(),
autoTenantNotification: z.boolean().optional().nullable(),
autoBillFwd: z.boolean().optional().nullable(),
tenantEmail: z.string().email(t("tenant-email-invalid")).optional().or(z.literal("")).nullable(),
addToSubsequentMonths: z.boolean().optional().nullable(),
updateScope: z.enum(["current", "subsequent", "all"]).optional().nullable(),
@@ -62,7 +62,7 @@ const FormSchema = (t:IntlTemplateFn) => z.object({
path: ["tenantLastName"],
})
.refine((data) => {
if (data.autoTenantNotification) {
if (data.autoBillFwd) {
return !!data.tenantEmail && data.tenantEmail.trim().length > 0;
}
return true;
@@ -90,7 +90,7 @@ export const updateOrAddLocation = withUser(async (user:AuthenticatedUser, locat
generateTenantCode: formData.get('generateTenantCode') === 'on',
tenantFirstName: formData.get('tenantFirstName') || null,
tenantLastName: formData.get('tenantLastName') || null,
autoTenantNotification: formData.get('autoTenantNotification') === 'on',
autoBillFwd: formData.get('autoBillFwd') === 'on',
tenantEmail: formData.get('tenantEmail') || null,
addToSubsequentMonths: formData.get('addToSubsequentMonths') === 'on',
updateScope: formData.get('updateScope') as "current" | "subsequent" | "all" | undefined,
@@ -110,7 +110,7 @@ export const updateOrAddLocation = withUser(async (user:AuthenticatedUser, locat
generateTenantCode,
tenantFirstName,
tenantLastName,
autoTenantNotification,
autoBillFwd,
tenantEmail,
addToSubsequentMonths,
updateScope,
@@ -148,7 +148,7 @@ export const updateOrAddLocation = withUser(async (user:AuthenticatedUser, locat
generateTenantCode: generateTenantCode || false,
tenantFirstName: tenantFirstName || null,
tenantLastName: tenantLastName || null,
autoTenantNotification: autoTenantNotification || false,
autoBillFwd: autoBillFwd || false,
tenantEmail: tenantEmail || null,
}
}
@@ -174,7 +174,7 @@ export const updateOrAddLocation = withUser(async (user:AuthenticatedUser, locat
generateTenantCode: generateTenantCode || false,
tenantFirstName: tenantFirstName || null,
tenantLastName: tenantLastName || null,
autoTenantNotification: autoTenantNotification || false,
autoBillFwd: autoBillFwd || false,
tenantEmail: tenantEmail || null,
}
}
@@ -193,7 +193,7 @@ export const updateOrAddLocation = withUser(async (user:AuthenticatedUser, locat
generateTenantCode: generateTenantCode || false,
tenantFirstName: tenantFirstName || null,
tenantLastName: tenantLastName || null,
autoTenantNotification: autoTenantNotification || false,
autoBillFwd: autoBillFwd || false,
tenantEmail: tenantEmail || null,
}
}
@@ -210,7 +210,7 @@ export const updateOrAddLocation = withUser(async (user:AuthenticatedUser, locat
generateTenantCode: generateTenantCode || false,
tenantFirstName: tenantFirstName || null,
tenantLastName: tenantLastName || null,
autoTenantNotification: autoTenantNotification || false,
autoBillFwd: autoBillFwd || false,
tenantEmail: tenantEmail || null,
yearMonth: yearMonth,
bills: [],
@@ -279,7 +279,7 @@ export const updateOrAddLocation = withUser(async (user:AuthenticatedUser, locat
generateTenantCode: generateTenantCode || false,
tenantFirstName: tenantFirstName || null,
tenantLastName: tenantLastName || null,
autoTenantNotification: autoTenantNotification || false,
autoBillFwd: autoBillFwd || false,
tenantEmail: tenantEmail || null,
yearMonth: { year: monthData.year, month: monthData.month },
bills: [],

View File

@@ -50,7 +50,7 @@ export interface BillingLocation {
/** (optional) tenant last name */
tenantLastName?: string | null;
/** (optional) whether to automatically notify tenant */
autoTenantNotification?: boolean | null;
autoBillFwd?: boolean | null;
/** (optional) tenant email */
tenantEmail?: string | null;
};