| | 1 | = Entity-Relationship Model v.01 = |
| | 2 | |
| | 3 | == Diagram == |
| | 4 | |
| | 5 | [[Image(ERModel_v01.png, width=100%)]] |
| | 6 | |
| | 7 | Source file: [attachment:ERModel_v01.xml] |
| | 8 | |
| | 9 | == Data requirements == |
| | 10 | |
| | 11 | === Entities === |
| | 12 | |
| | 13 | ==== Reports ==== |
| | 14 | Represents a single communal problem reported by a citizen (damaged road, broken street light, waste...). It is the central entity of the system because photos, status changes, comments and assignments all refer to a report. |
| | 15 | |
| | 16 | '''Candidate keys:''' report_id is the only candidate key. No natural attribute uniquely identifies a report, so a generated numeric identifier is used as the primary key. |
| | 17 | |
| | 18 | '''Attributes:''' |
| | 19 | * report_id - numeric, required, auto-generated |
| | 20 | * description - text, required |
| | 21 | * location_text - text, optional (manually entered address) |
| | 22 | * latitude - numeric, optional, between -90 and 90 |
| | 23 | * longitude - numeric, optional, between -180 and 180 |
| | 24 | * status - text, required, one of: submitted, received, in_progress, resolved, rejected |
| | 25 | * priority - text, required, one of: low, medium, high, urgent |
| | 26 | * created_at - date and time, required |
| | 27 | |
| | 28 | At least one of location_text or latitude/longitude must be entered. |
| | 29 | |
| | 30 | ==== Citizens ==== |
| | 31 | ... |
| | 32 | |
| | 33 | === Relationships === |
| | 34 | |
| | 35 | ==== Submits (Citizens - Reports) ==== |
| | 36 | Each report is submitted by exactly one citizen, and a citizen can submit many reports. Participation of Reports is total, because a report cannot exist without its author. |
| | 37 | |
| | 38 | ==== Classifies (Categories - Reports) ==== |
| | 39 | ... |
| | 40 | |
| | 41 | == Entity-Relationship Model History == |
| | 42 | |
| | 43 | * '''v01''' - Initial version of the ER model. |