feat : calcul de l'âge en mois côté back + colonne Age et alertes visuelles

- Champ ageMonths (int) ajouté à Bovine avec migration
- Lifecycle PrePersist/PreUpdate pour maintenir la cohérence
- Sync processor recalcule explicitement ageMonths à chaque passage (cron-friendly)
- Colonne Age + rowClass côté front : rouge >= 24 mois, orange 22-24 mois
- Util formatAgeLabel remplace le calcul client
- Boutons pagination Prev/Next en français avec style bouton bordure primary
- Colonnes Sexe/N° Travail réduites au profit de Bâtiment

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-24 09:50:39 +02:00
parent 9d3cfd10db
commit c0c6c81e74
7 changed files with 104 additions and 9 deletions

View File

@@ -0,0 +1,10 @@
export const formatAgeLabel = (months: number | null | undefined): string => {
if (months === null || months === undefined) return '—'
const years = Math.floor(months / 12)
const remaining = months % 12
let label = ''
if (years > 0) label = `${years} an${years > 1 ? 's' : ''}`
if (remaining > 0) label += `${label ? ' ' : ''}${remaining} mois`
if (!label) label = '< 1 mois'
return label
}