Incident Management — Data & Read/Write Tables
Incident Management uses SQL as the main store, Blob for files, and reads several other entities to enrich UI/report/notification.
Main Tables/Entities
| Table/entity | Ownership | Role |
|---|---|---|
FormInstance | Incident owns rows with FormCategoryId = IncidentManagement | Root incident, status, fields (including internal-only Internal Notes), flags, metadata. |
FormTemplateVersion.PrefillBlobName | Incident type config | Points to the blob storing the default Description template for the type, by Business Unit. |
FormInstanceAttendee / related attendee records | Incident | Affected attendee, role, notes, body marker JSON. |
FormAcknowledgement | Incident | Recipient/customer acknowledgement and status. |
GeneratedAttachment | Incident | Generated PDF report, blob name, attendee association. |
| Attachment records | Incident | Internal/shared/attendee-specific uploaded files. |
EntityHistory | Platform-owned projection | Audit timeline keyed by incident guid. |
NotificationJob / schedulers | Platform/Communication | Async notification for submitted/sent-to-customer. |
Exact table names may live in the EF model; use the service/controller code as the anchor when investigating.
Read Dependencies
| Entity | Used for |
|---|---|
Org / Site | Incident site, list filters, report display, site-contact context. |
TermProgramSet / course | Course/session context by site + date. |
TermAttendance | Suggest attendees present on the date/course. |
Account | Customer scope and account information. |
Attendee | Attendee name, account link, report detail. |
Contact | Recipients when sending to customer. |
NotificationSetting | Template/recipient config for notification worker. |
These entities are read/enrichment dependencies; they are not aggregate roots of Incident Management.
Blob Storage
| Blob | Created/read by | Content |
|---|---|---|
| Attachment blob | Staff upload/download | Images, PDFs, evidence files. |
| Generated document blob | GeneratePdfAsync, customer/admin download | Incident report PDF. |
| Signature blob | Customer acknowledgement submit | Stored signature image/base64. |
form-config-json prefill blob | Settings save / create-edit prefill | Default Description template by type (field-prefill format). |
When debugging files that cannot be downloaded, check both the SQL record and the matching BlobName/container.
Notification Data
| Event | EventData | Note |
|---|---|---|
IncidentSubmitted | Incident id | Created on submit; worker emails staff/manager recipients for the BU. No recipient ⇒ completes without sending. |
IncidentSentToCustomer | Incident id + message/channels/recipient context | Created when sending approved incident; email/SMS + portal user message. |
- BU has no template for the event type ⇒ worker uses built-in default template.
- Notification history visible to staff is a projection from notification jobs related to the incident guid/event.
Customer Access Scope
Customer access is not based on URL id alone. The service checks:
- Which account the customer is currently in.
- Whether
ackIdbelongs to that account. - Whether the acknowledgement is not
NotificationOnlyfor list/actionable flow. - Whether the incident is customer-visible according to the sent flow.
This rule prevents customers from viewing acknowledgements for other accounts/contacts.
Reporting Service
Generated PDF is not a user-uploaded file. It is created from the incident dataset:
- incident summary,
- attendee details,
- body markers,
- acknowledgements,
- generated metadata,
- eligible PDF attachments when merging is needed.
If PDF content is wrong, debug BuildPdfDatasetAsync first, then rendering/Blob.
Next: Common cases.