Skip to main content

Module syndic_response

Module syndic_response 

Source
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.

SeverityWindowRationale
Critical24 hoursImminent risk (eau, gaz, sécurité)
High72 hoursStrong impact (ascenseur, chauffage)
Normal5 daysStandard request
Low10 daysCosmetic / non-urgent

Structs§

SyndicResponse

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.