163bf0891a
LST-66 (2.3) front. Companion to the backend module migration. - Move pages (absences, team-absences), 8 components, the absences service + DTO and the useAbsenceHelpers composable into frontend/modules/absence/ (auto-detected layer; composable now auto-imported). - Rewrite consumers: AdminAbsencePolicyTab and the time-tracking calendar (getPublicHolidays) point to ~/modules/absence/... - Middlewares (employee/admin) and shared services (clients, users, user-data DTO) stay at the root. i18n stays global. - Routes /absences and /team-absences preserved. nuxt build passes; routes confirmed.
94 lines
2.2 KiB
TypeScript
94 lines
2.2 KiB
TypeScript
export type AbsenceType = 'cp' | 'mariage_pacs' | 'naissance' | 'conge_parental' | 'deces' | 'maladie'
|
|
export type AbsenceStatus = 'pending' | 'approved' | 'rejected' | 'cancelled'
|
|
export type HalfDay = 'matin' | 'apres_midi'
|
|
|
|
export type AbsenceUserRef = {
|
|
'@id'?: string
|
|
id: number
|
|
username: string
|
|
avatarUrl: string | null
|
|
}
|
|
|
|
export type AbsenceRequest = {
|
|
'@id'?: string
|
|
id: number
|
|
user: AbsenceUserRef
|
|
type: AbsenceType
|
|
label: string
|
|
startDate: string
|
|
endDate: string
|
|
startHalfDay: HalfDay | null
|
|
endHalfDay: HalfDay | null
|
|
countedDays: number
|
|
reason: string | null
|
|
justificationFileName: string | null
|
|
justificationUrl: string | null
|
|
status: AbsenceStatus
|
|
rejectionReason: string | null
|
|
createdAt: string
|
|
reviewedAt: string | null
|
|
reviewedBy: AbsenceUserRef | null
|
|
}
|
|
|
|
export type AbsenceRequestWrite = {
|
|
type: AbsenceType
|
|
startDate: string
|
|
endDate: string
|
|
startHalfDay?: HalfDay | null
|
|
endHalfDay?: HalfDay | null
|
|
reason?: string | null
|
|
}
|
|
|
|
export type AbsenceBalance = {
|
|
'@id'?: string
|
|
id: number
|
|
user: AbsenceUserRef
|
|
type: AbsenceType
|
|
label: string
|
|
period: string
|
|
acquired: number
|
|
acquiring: number
|
|
acquiredTotal: number
|
|
taken: number
|
|
pending: number
|
|
available: number
|
|
}
|
|
|
|
export type AbsencePolicy = {
|
|
'@id'?: string
|
|
id: number
|
|
type: AbsenceType
|
|
label: string
|
|
daysPerYear: number | null
|
|
daysPerEvent: number | null
|
|
justificationRequired: boolean
|
|
noticeDays: number
|
|
countWorkingDaysOnly: boolean
|
|
active: boolean
|
|
}
|
|
|
|
export type AbsencePolicyWrite = {
|
|
daysPerYear?: number | null
|
|
daysPerEvent?: number | null
|
|
justificationRequired?: boolean
|
|
noticeDays?: number
|
|
countWorkingDaysOnly?: boolean
|
|
active?: boolean
|
|
}
|
|
|
|
export type AbsencePreviewPayload = {
|
|
type: AbsenceType
|
|
startDate: string
|
|
endDate: string
|
|
startHalfDay?: HalfDay | null
|
|
endHalfDay?: HalfDay | null
|
|
}
|
|
|
|
export type AbsencePreviewResult = {
|
|
countedDays: number
|
|
period: string | null
|
|
available: number | null
|
|
projectedAvailable: number | null
|
|
justificationRequired: boolean
|
|
}
|