fix : correction des Heures et ajout d'une validation pour les chefs de site
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled

This commit is contained in:
2026-02-26 14:49:28 +01:00
parent 5cced46254
commit b68fef61c4
20 changed files with 547 additions and 106 deletions

View File

@@ -13,6 +13,7 @@ export type WorkHour = {
eveningTo?: string | null
isPresentMorning?: boolean
isPresentAfternoon?: boolean
isSiteValid?: boolean
isValid?: boolean
}
@@ -67,6 +68,7 @@ export type WeeklyWorkHourSummary = {
export type WorkHourDayContextRow = {
employeeId: number
hasContractAtDate: boolean
absenceLabel?: string | null
absenceHalf?: 'AM' | 'PM' | null
absentMorning: boolean

View File

@@ -23,7 +23,7 @@ export const listWorkHoursByDate = async (workDate: string) => {
export const bulkUpsertWorkHours = async (payload: {
workDate: string
entries: WorkHourEntryPayload[]
}) => {
}, options?: { toast?: boolean }) => {
const api = useApi()
return api.post<{
processed: number
@@ -34,6 +34,7 @@ export const bulkUpsertWorkHours = async (payload: {
'/work-hours/bulk-upsert',
payload,
{
toast: options?.toast ?? true,
toastSuccessMessage: 'Horaires enregistrés.',
toastErrorMessage: "Impossible d'enregistrer les horaires."
}
@@ -57,6 +58,23 @@ export const updateWorkHourValidation = async (
)
}
export const updateWorkHourSiteValidation = async (
id: number,
isSiteValid: boolean,
options?: { toast?: boolean }
) => {
const api = useApi()
return api.patch<WorkHour>(
`/work_hours/${id}/site-validation`,
{ isSiteValid },
{
toast: options?.toast ?? true,
toastSuccessMessage: isSiteValid ? 'Validation site enregistrée.' : 'Validation site retirée.',
toastErrorMessage: "Impossible de mettre à jour la validation site."
}
)
}
export const getWeeklyWorkHourSummary = async (weekStart: string) => {
const api = useApi()
return api.get<WeeklyWorkHourSummary>(