58 lines
2.0 KiB
Go
58 lines
2.0 KiB
Go
package models
|
|
|
|
// GlobalRules = constantes communes à tous les utilisateurs.
|
|
type GlobalRules struct {
|
|
// ForfaitDimFerie = forfait par dimanche / jour férié (€/jour)
|
|
ForfaitDimFerie float64 `json:"forfait_dim_ferie"`
|
|
}
|
|
|
|
// Profile = taux dépendants de la personne (grade, etc.)
|
|
type Profile struct {
|
|
ID string `json:"id"`
|
|
Label string `json:"label"`
|
|
Matricule string `json:"matricule,omitempty"` // ✅ pour auto-match avec l'agent importé
|
|
|
|
// Taux horaires (€/h)
|
|
T456 float64 `json:"t456"` // Interventions jour hors dimanche/férié
|
|
T458 float64 `json:"t458"` // Interventions dimanche/jour férié
|
|
T459 float64 `json:"t459"` // Interventions nuit hors dimanche/férié
|
|
T471 float64 `json:"t471"` // Astreinte: heures totales du mois
|
|
}
|
|
|
|
// ProfileListItem = ce qu'on expose à l'UI (id + label + matricule pour auto-match)
|
|
type ProfileListItem struct {
|
|
ID string `json:"id"`
|
|
Label string `json:"label"`
|
|
Matricule string `json:"matricule,omitempty"`
|
|
}
|
|
|
|
// CalculateRequest = saisies mensuelles par l'utilisateur.
|
|
type CalculateRequest struct {
|
|
ProfileID string `json:"profileId"`
|
|
|
|
// Quantités en heures
|
|
Q456 float64 `json:"q456"` // heures interventions jour hors dim/férié
|
|
Q458 float64 `json:"q458"` // heures interventions dimanche/férié
|
|
Q459 float64 `json:"q459"` // heures interventions nuit hors dim/férié
|
|
Q471 float64 `json:"q471"` // heures totales astreinte du mois
|
|
|
|
// ✅ Nombre de dimanches / jours fériés "au forfait" (auto-rempli à l'import, modifiable)
|
|
NbDimFerie int `json:"nbDimFerie"`
|
|
}
|
|
|
|
// Line = une ligne de la grille (456/458/459/471/480).
|
|
type Line struct {
|
|
Code string `json:"code"`
|
|
Label string `json:"label"`
|
|
Rate float64 `json:"rate"`
|
|
Quantity float64 `json:"quantity"`
|
|
Amount float64 `json:"amount"`
|
|
Unit string `json:"unit"` // "h" ou "j"
|
|
}
|
|
|
|
// CalculateResponse = résultat du calcul (lignes + total)
|
|
type CalculateResponse struct {
|
|
Lines []Line `json:"lines"`
|
|
Total float64 `json:"total"`
|
|
}
|