feat(MED-97): fix occurance->occurrence in components, add missing translations
This commit is contained in:
@@ -20,7 +20,7 @@ const HealthBenefitFields = () => {
|
||||
return (
|
||||
<div className="flex flex-col gap-3">
|
||||
<FormField
|
||||
name="occurance"
|
||||
name="occurrence"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>
|
||||
@@ -30,20 +30,20 @@ const HealthBenefitFields = () => {
|
||||
<Select {...field} onValueChange={field.onChange}>
|
||||
<SelectTrigger>
|
||||
<SelectValue
|
||||
placeholder={<Trans i18nKey="common:formField:occurance" />}
|
||||
placeholder={<Trans i18nKey="common:formField:occurrence" />}
|
||||
/>
|
||||
</SelectTrigger>
|
||||
|
||||
<SelectContent>
|
||||
<SelectGroup>
|
||||
<SelectItem value="yearly">
|
||||
<Trans i18nKey="billing:occurance.yearly" />
|
||||
<Trans i18nKey="billing:occurrence.yearly" />
|
||||
</SelectItem>
|
||||
<SelectItem value="quarterly">
|
||||
<Trans i18nKey="billing:occurance.quarterly" />
|
||||
<Trans i18nKey="billing:occurrence.quarterly" />
|
||||
</SelectItem>
|
||||
<SelectItem value="monthly">
|
||||
<Trans i18nKey="billing:occurance.monthly" />
|
||||
<Trans i18nKey="billing:occurrence.monthly" />
|
||||
</SelectItem>
|
||||
</SelectGroup>
|
||||
</SelectContent>
|
||||
|
||||
@@ -39,13 +39,13 @@ const HealthBenefitForm = ({
|
||||
resolver: zodResolver(UpdateHealthBenefitSchema),
|
||||
mode: 'onChange',
|
||||
defaultValues: {
|
||||
occurance: currentCompanyParams.benefit_occurance || 'yearly',
|
||||
occurrence: currentCompanyParams.benefit_occurance || 'yearly',
|
||||
amount: currentCompanyParams.benefit_amount || 0,
|
||||
},
|
||||
});
|
||||
const isDirty = form.formState.isDirty;
|
||||
|
||||
const onSubmit = (data: { occurance: string; amount: number }) => {
|
||||
const onSubmit = (data: { occurrence: string; amount: number }) => {
|
||||
const promise = async () => {
|
||||
setIsLoading(true);
|
||||
try {
|
||||
@@ -53,7 +53,7 @@ const HealthBenefitForm = ({
|
||||
setCurrentCompanyParams((prev) => ({
|
||||
...prev,
|
||||
benefit_amount: data.amount,
|
||||
benefit_occurance: data.occurance,
|
||||
benefit_occurance: data.occurrence,
|
||||
}));
|
||||
} finally {
|
||||
form.reset(data);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const UpdateHealthBenefitSchema = z.object({
|
||||
occurance: z
|
||||
occurrence: z
|
||||
.string({
|
||||
error: 'Occurance is required',
|
||||
error: 'Occurrence is required',
|
||||
})
|
||||
.nonempty(),
|
||||
amount: z.number({ error: 'Amount is required' }),
|
||||
|
||||
@@ -267,7 +267,7 @@ export class TeamAccountsApi {
|
||||
.schema('medreport')
|
||||
.from('company_params')
|
||||
.update({
|
||||
benefit_occurance: data.occurance,
|
||||
benefit_occurance: data.occurrence,
|
||||
benefit_amount: data.amount,
|
||||
updated_at: new Date().toISOString(),
|
||||
})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export interface UpdateHealthBenefitData {
|
||||
accountId: string;
|
||||
occurance: string;
|
||||
occurrence: string;
|
||||
amount: number;
|
||||
}
|
||||
|
||||
@@ -119,5 +119,25 @@
|
||||
},
|
||||
"cart": {
|
||||
"label": "Cart ({{ items }})"
|
||||
},
|
||||
"pageTitle": "{{companyName}} budget",
|
||||
"description": "Configure company budget..",
|
||||
"saveChanges": "Save changes",
|
||||
"healthBenefitForm": {
|
||||
"title": "Health benefit form",
|
||||
"description": "Company health benefit for employees",
|
||||
"info": "* Taxes are added to the prices"
|
||||
},
|
||||
"occurrence": {
|
||||
"yearly": "Yearly",
|
||||
"quarterly": "Quarterly",
|
||||
"monthly": "Monthly"
|
||||
},
|
||||
"expensesOverview": {
|
||||
"title": "Expenses overview 2025",
|
||||
"monthly": "Expense per employee per month *",
|
||||
"yearly": "Maximum expense per employee per year *",
|
||||
"total": "Maximum expense per {{employeeCount}} employee(s) per year *",
|
||||
"sum": "Total"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
"city": "City",
|
||||
"weight": "Weight",
|
||||
"height": "Height",
|
||||
"occurance": "Support frequency",
|
||||
"occurrence": "Support frequency",
|
||||
"amount": "Amount",
|
||||
"selectDate": "Select date"
|
||||
},
|
||||
|
||||
@@ -121,16 +121,16 @@
|
||||
"label": "Cart ({{ items }})"
|
||||
},
|
||||
"pageTitle": "{{companyName}} eelarve",
|
||||
"description": "Vali kalendrist sobiv kuupäev ja broneeri endale vastuvõtuaeg.",
|
||||
"description": "Muuda ettevõtte eelarve seadistusi.",
|
||||
"saveChanges": "Salvesta muudatused",
|
||||
"healthBenefitForm": {
|
||||
"title": "Tervisetoetuse vorm",
|
||||
"description": "Ettevõtte Tervisekassa toetus töötajale",
|
||||
"info": "* Hindadele lisanduvad riigipoolsed maksud"
|
||||
},
|
||||
"occurance": {
|
||||
"occurrence": {
|
||||
"yearly": "Kord aastas",
|
||||
"quarterly": "kord kvartalis",
|
||||
"quarterly": "Kord kvartalis",
|
||||
"monthly": "Kord kuus"
|
||||
},
|
||||
"expensesOverview": {
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
"city": "Linn",
|
||||
"weight": "Kaal",
|
||||
"height": "Pikkus",
|
||||
"occurance": "Toetuse sagedus",
|
||||
"occurrence": "Toetuse sagedus",
|
||||
"amount": "Summa",
|
||||
"selectDate": "Vali kuupäev"
|
||||
},
|
||||
|
||||
@@ -121,14 +121,14 @@
|
||||
"label": "Корзина ({{ items }})"
|
||||
},
|
||||
"pageTitle": "Бюджет {{companyName}}",
|
||||
"description": "Выберите подходящую дату в календаре и запишитесь на прием.",
|
||||
"description": "Измените настройки бюджета компании.",
|
||||
"saveChanges": "Сохранить изменения",
|
||||
"healthBenefitForm": {
|
||||
"title": "Форма здоровья",
|
||||
"description": "Поддержка сотрудника из корпоративного фонда здоровья",
|
||||
"info": "* К ценам добавляются государственные налоги"
|
||||
},
|
||||
"occurance": {
|
||||
"occurrence": {
|
||||
"yearly": "Раз в год",
|
||||
"quarterly": "Раз в квартал",
|
||||
"monthly": "Раз в месяц"
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
"city": "Город",
|
||||
"weight": "Вес",
|
||||
"height": "Рост",
|
||||
"occurance": "Частота поддержки",
|
||||
"occurrence": "Частота поддержки",
|
||||
"amount": "Сумма",
|
||||
"selectDate": "Выберите дату"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user