feat : ajout des demi-journées d'absence dans le calendrier et l'export pdf
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled

This commit is contained in:
2026-02-10 16:11:09 +01:00
parent 4cf00e6ef3
commit 2a8c874985
11 changed files with 404 additions and 46 deletions

View File

@@ -1,4 +1,5 @@
import type { Absence } from './dto/absence'
import type { HalfDay } from './dto/half-day'
import { extractItems } from '~/utils/api'
type ListAbsencesFilters = {
@@ -31,7 +32,9 @@ export const createAbsence = async (payload: {
employeeId: number
typeId: number
startDate: string
startHalf: HalfDay
endDate: string
endHalf: HalfDay
comment?: string
}) => {
const api = useApi()
@@ -39,7 +42,9 @@ export const createAbsence = async (payload: {
employee: `/api/employees/${payload.employeeId}`,
type: `/api/absence_types/${payload.typeId}`,
startDate: payload.startDate,
startHalf: payload.startHalf,
endDate: payload.endDate,
endHalf: payload.endHalf,
comment: payload.comment
}, {
toastSuccessKey: 'success.absence.create',
@@ -52,7 +57,9 @@ export const updateAbsence = async (payload: {
employeeId: number
typeId: number
startDate: string
startHalf: HalfDay
endDate: string
endHalf: HalfDay
comment?: string
}) => {
const api = useApi()
@@ -60,7 +67,9 @@ export const updateAbsence = async (payload: {
employee: `/api/employees/${payload.employeeId}`,
type: `/api/absence_types/${payload.typeId}`,
startDate: payload.startDate,
startHalf: payload.startHalf,
endDate: payload.endDate,
endHalf: payload.endHalf,
comment: payload.comment
}, {
toastSuccessKey: 'success.absence.update',

View File

@@ -1,10 +1,13 @@
import type { Employee } from './employee'
import type { AbsenceType } from './absence-type'
import type { HalfDay } from './half-day'
export type Absence = {
id: number
startDate: string
startHalf: HalfDay
endDate: string
endHalf: HalfDay
comment?: string | null
employee: Employee
type: AbsenceType

View File

@@ -0,0 +1,6 @@
export type HalfDay = 'AM' | 'PM'
export const HALF_DAYS: { value: HalfDay; label: string }[] = [
{ value: 'AM', label: 'Matin' },
{ value: 'PM', label: 'Après-midi' }
]