Files
SIRH/frontend/services/dto/work-hour.ts
tristan bd93c52197 feat : migrate filter/form UI to @malio/layer-ui + fix hours/calendar contract scoping
- Add @malio/layer-ui as Nuxt layer (extends in nuxt.config.ts)
- Migrate site/employee/contract filters to MalioSelectCheckbox / MalioInputText / MalioSelect on employees, calendar and hours screens
- Migrate absence drawer selects + submit button to Malio (MalioSelect + MalioButton)
- Migrate calendar "Ajouter une absence" / "Imprimer" actions to MalioButton
- Drop now-unused EmployeeNameFilterInput and SiteFilterSelector components
- Hours day view: resolve contract nature at selected date (WorkHourDayContext.contractNature) instead of employee.currentContractNature (today-based); fixes interim contracts showing as CDI when mission ended
- Calendar: hide employees whose contract periods do not intersect the displayed month
- Layout: scrollbar-gutter:stable on <main> to avoid horizontal shift when dropdowns open
- Update functional-rules.md, in-app documentation, CLAUDE.md to match

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 16:54:38 +02:00

135 lines
3.3 KiB
TypeScript

import type { Employee } from './employee'
import type { ContractType, TrackingMode } from './contract'
export type WorkHour = {
id: number
employee: Employee
workDate: string
morningFrom?: string | null
morningTo?: string | null
afternoonFrom?: string | null
afternoonTo?: string | null
eveningFrom?: string | null
eveningTo?: string | null
isPresentMorning?: boolean
isPresentAfternoon?: boolean
dayHoursMinutes?: number | null
nightHoursMinutes?: number | null
workshopHoursMinutes?: number | null
hasBreakfast?: boolean
hasLunch?: boolean
hasDinner?: boolean
hasOvernight?: boolean
isSiteValid?: boolean
isValid?: boolean
updatedAt?: string | null
}
export type WorkHourEntryPayload = {
employeeId: number
morningFrom?: string | null
morningTo?: string | null
afternoonFrom?: string | null
afternoonTo?: string | null
eveningFrom?: string | null
eveningTo?: string | null
isPresentMorning?: boolean
isPresentAfternoon?: boolean
dayHoursMinutes?: number | null
nightHoursMinutes?: number | null
workshopHoursMinutes?: number | null
hasBreakfast?: boolean
hasLunch?: boolean
hasDinner?: boolean
hasOvernight?: boolean
}
export type WeeklyWorkHourDailySummary = {
date: string
dayMinutes: number
nightMinutes: number
workshopMinutes?: number
totalMinutes: number
present?: number | null
hasAbsence?: boolean
absenceLabel?: string | null
absenceColor?: string | null
hasNightBasket?: boolean
hasBreakfast?: boolean
hasLunch?: boolean
hasDinner?: boolean
hasOvernight?: boolean
virtualHolidayMinutes?: number
}
export type WeeklyWorkHourRowSummary = {
employeeId: number
firstName: string
lastName: string
siteName?: string | null
contractName?: string | null
contractType?: ContractType | null
trackingMode?: TrackingMode | null
daily: WeeklyWorkHourDailySummary[]
weeklyDayMinutes: number
weeklyNightMinutes: number
weeklyWorkshopMinutes?: number
weeklyTotalMinutes: number
weeklyPresenceCount?: number
weeklyOvertimeTotalMinutes?: number
weeklyOvertime25Minutes?: number
weeklyOvertime50Minutes?: number
weeklyRecoveryMinutes?: number
weeklyNightBasketCount?: number
isDriver?: boolean
weeklyBreakfastCount?: number
weeklyLunchCount?: number
weeklyDinnerCount?: number
weeklyOvernightCount?: number
hasContractForWeek?: boolean
contractNature?: 'CDI' | 'CDD' | 'INTERIM' | null
}
export type WeeklyWorkHourSummary = {
weekStart: string
weekEnd: string
days: string[]
rows: WeeklyWorkHourRowSummary[]
}
export type WorkHourDayContextRow = {
employeeId: number
hasContractAtDate: boolean
absenceLabel?: string | null
absenceColor?: string | null
absenceHalf?: 'AM' | 'PM' | null
absentMorning: boolean
absentAfternoon: boolean
creditedMinutes: number
creditedPresenceUnits: number
isDriverContract?: boolean
hasFormation?: boolean
formationLabel?: string | null
virtualHolidayMinutes?: number
contractNature?: 'CDI' | 'CDD' | 'INTERIM' | null
}
export type WorkHourDayContext = {
workDate: string
rows: WorkHourDayContextRow[]
}
export type DriverHourRow = {
workHourId: number | null
dayHours: string
nightHours: string
workshopHours: string
hasBreakfast: boolean
hasLunch: boolean
hasDinner: boolean
hasOvernight: boolean
isSiteValid: boolean
isValid: boolean
updatedAt: string | null
}