Stand opening hours through the API
A stand’s hours are read and written at three levels: the record (its plages), the openings report (what the solver would receive) and the entry grid. The computation of the effective window is in stand hours and windows; the timeslot grid and concurrent writes in writing the referentials.
Plages
The stand record returns its dated plages under plages, unexpanded: id, mode (OUVERTURE or FERMETURE), day, hours, motif, effectif (an opening) and depliee (unfolded from the model, or typed by hand; stated by the server). A null heureFin means “until closing”. A write answers 400 if a plage is inconsistent or if one day carries an opening and a closure.
ouvertures and indisponibilites (the same plages, split by mode), which the record still returned and accepted for the whole 4.x, are removed in 5.0: the record only returns plages, and a body that carries one of these lists is refused (400, the message names the key) rather than saved without opening hours. A client sends only plages, each plage with its mode.
Three routes write a plage without returning the whole record, and answer the record and its warnings like PUT /api/stands/{id}: POST /api/stands/{id}/plages (sets a hand-typed plage), DELETE /api/stands/{id}/plages/{plageId} (404 if it is not on this stand) and DELETE /api/stands/{id}/plages?date=YYYY-MM-DD (removes all the plages of a day: the stand is open all day again; 400 without a date). Like the record’s, they answer 409 during a solve and when the phase freezes the stands (REFERENTIEL_FIGE). A hand-removed plage does not come back: the model unfolds only new days.
The 3.x recurring rules no longer exist (decision 0104 (external site)): the record’s horaires key carries the stand’s model, which the resolution never reads. Rules written there are kept as the model, then unfolded into plages on each day the edition gains; if it already has timeslots, they are also converted into plages at once (a day already carrying a plage keeps it, the plages the old model had unfolded are removed first). A write without horaires leaves the model as is; horaires: [] erases it; sending it back unchanged unfolds nothing. Never a refusal or a rule silently lost. This bridge disappears with the plage editor; hours compaction is removed.
Openings view
GET /api/ouvertures-stands returns a stand-by-day grid built from the seats the solver would receive: the report validates the real data, with no second interpretation of the entry. source says what decided: DEFAUT (no plage, open all day), REGLE (only plages unfolded from the model speak for the day) or EXCEPTION (a hand-typed plage). The origin (depliee) is stated by the server: a plage sent back as stored keeps its mark, a plage modified or written by a client is a hand entry. No anomaly blocks a solve; three are defects: STAND_JAMAIS_OUVERT, FENETRE_SANS_EFFET (no timeslot of the day overlapped) and SEGMENT_TROP_COURT, signature of the 23:59 workaround.
A day carries its holiday label (jours[].ferie) and its columns (jours[].creneaux): a whole timeslot, or its slices when a window starts or ends inside (4 people from 14h to 19h then 2 until 20h cut the 14-20 timeslot into 14-19 and 19-20, for all stands). Nothing is stored. Each cell carries one entry per column (creneaux[]: creneauId, tranche, effectif, partiel, segments), effectif being null if the stand is closed there; partiel remains only for a bound no column follows (effectif is then the highest and segments says what the cell carries).
Grid entry
PUT /api/ouvertures-stands/grille writes the hours in the shape of the organiser’s workbook: one integer per column, empty for closed. The body carries only the modified stands, each with all its cells (a timeslot and, for a slice, its bounds):
{ "stands": [ { "standId": "BOURSE",
"cellules": [ { "creneauId": 1, "effectif": 2 },
{ "creneauId": 2, "heureDebut": "14:00", "heureFin": "19:00", "effectif": 4 },
{ "creneauId": 2, "heureDebut": "19:00", "heureFin": "20:00", "effectif": 2 } ] } ] }
A submitted stand has its plages replaced entirely by its cells: consecutive timeslots with the same headcount become a dated window (the one reaching the end of the day stays open), and a day without a cell is an explicit closure. effectifMin is the smallest value entered, effectifMax the largest. Minutes no cell covers keep what the stand had there; two overlapping cells, or outside their timeslot, an unknown timeslot or stand, a zero headcount (leave empty to close): 400.
The grid never destroys what it cannot display: a partial cell (partiel) sent back with the same value keeps its segments; retyped otherwise, the value covers the whole timeslot. Flattening partial cells is an explicit request, stands[].aplatir: true. The response says so stand by stand (exceptions counts the plages written; regles is always 0 and compacte always false, 3.x leftovers). All stands are validated first then written in one transaction, 409 during a solve. A grid carries a single variant of each shift (ADR 0029 (external site)).
A mistake, an omission? Fix this page on GitHub. (external site)