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
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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
|
||||
|
||||
6
frontend/services/dto/half-day.ts
Normal file
6
frontend/services/dto/half-day.ts
Normal 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' }
|
||||
]
|
||||
Reference in New Issue
Block a user