Expand description
SyndicResponse — append-only structured reply to a ticket (Story 3.7 — FR32 INV-23).
Each row represents a syndic’s reply (text + optional declared action).
The relation is append-only: edits and deletions are blocked both at
the SQL trigger level (cf. 20260605050000_create_syndic_responses.sql)
and via the AppError::ResponseImmutable typed error returned by any
upstream layer that tried to mutate a persisted response.
§SLA model
The sla_window_for_severity function returns the maximum acceptable
delay between ticket creation and the first syndic response, depending
on the ticket’s TicketSeverity. The SLA escalation cron job
(crate::infrastructure::jobs::sla_escalation_job) compares
Ticket.sla_due_at to now() to flag overdue tickets.
| Severity | Window | Rationale |
|---|---|---|
| Critical | 24 hours | Imminent risk (eau, gaz, sécurité) |
| High | 72 hours | Strong impact (ascenseur, chauffage) |
| Normal | 5 days | Standard request |
| Low | 10 days | Cosmetic / non-urgent |
Structs§
Constants§
- ALLOWED_
ACTIONS - Whitelisted values for
action_proposed. Keeping this hard-coded server- side means a hostile client cannot inject free-form action strings into audit-grade rows. - MAX_
RESPONSE_ BODY_ LEN - Maximum body length (chars).
- MIN_
RESPONSE_ BODY_ LEN - Minimum body length (chars).
Functions§
- sla_
window_ for_ severity - SLA policy : maximum acceptable delay between ticket creation and the first syndic response for a given severity tier.