Repository navigation
Database
Keegan edited this page Jul 21, 2026
·
18 revisions
We separate the user database from the other database that the services have access to. All information from the separated users database is passed to functions that need that information by using the JWT.
The users database is used for authentication upon log in and responsible for the authorization for the requests since it helps to bind the user's role to the JWT.
| Column | Type | Description |
|---|---|---|
| UserId | UUID | This acts like the id so don't have to expose sensitive information |
| UserEmail | VARCHAR(255) | User's unique email address |
| UserName | VARCHAR(100) | User's display name |
| UserRole | User_Role_Enum | Role: 'ADMIN','INVESTIGATOR','USER' |
| UserPassword | VARCHAR(255) | Hashed Password |
| UserJWTIssued | TIMESTAMPTZ | Time of last Issued JWT |
This contains information that is needed for services related to cases.
| Column | Type | Description |
|---|---|---|
| MediaTypeId | UUID | Unique Identifier |
| MediaName | varchar(100) | Human readable identifier |
| MediaExtension | varchar(10) | The file type e.g. .png |
| MediaBucket | VARCHAR(255) | The storage bucket location for the media. |
| Column | Type | Description |
|---|---|---|
| CaseId | UUID | Unique identifier |
| CaseName | VARCHAR(255) | Name of case |
| CaseCreator | VARCHAR(100) | Name of creator |
| CaseDescription | TEXT | The description of the case |
| CaseClosed | Boolean | true or false to show if case solved |
| CaseCreationDate | TIMESTAMPTZ | Timestamp of creation |
| Column | Type | Description |
|---|---|---|
| MediaId | UUID | Unique identifier. |
| MediaType | UUID | Referencing Mediatype table |
| MediaUploadDate | TIMESTAMPTZ | Timestamp of media uploaded. |
| MediaAnnotations | JSONB | The annotations that are overlayed onto the images by investigators |
| MediaHash | VARCHAR(255) | Hash value for the uploaded media. |
| Column | Type | Description |
|---|---|---|
| ReportId | UUID | Primary key; automatically generated unique identifier. |
| CaseId | UUID | Foreign key referencing CaseId in the Cases table; cascades on both delete and update; cannot be null. |
| ImageId | UUID | Foreign key referencing MediaId in the Media table; cascades on update; cannot be null. |
| ImageTitle | TEXT | This is name of the file when it was uploaded |
| ReportArtifacts | JSONB | Semi-structured JSON data containing report artifacts. |
| ReportFindings | TEXT | Detailed text findings for the report. |
| ReportComments | TEXT | Additional comments or notes for the report. |
| ReportDateCreation | TIMESTAMPTZ | Timestamp of when the report was created; defaults to the current time with time zone. |
| ReportCertainty | SMALLINT | Can only be 0, 1,2,3 and it is the comparable as an int |
There is enforce uniqueness with the combination of the ImageId and CaseId since there can not be two images that are the same in one case.
This holds the comments left from case reviews
| Column | Type | Description |
|---|---|---|
| CommentID | BIGINT | A serial primary key. |
| CaseId | UUID | Foreign key that links to the case table |
| Username | varchar(100) | The username of the individual who wrote the comment |
| Comment | Text | The comment |
| CommentTimestamp | TIMESTAMPTZ | The timestamp saying when comment was created |
- User Stories
- Use Cases
- Use Case Diagrams
- Functional Requirements
- API Service Contracts
- Quality Requirements
- Constraints
- Technologies Required
- Architecture Diagram
- Domain Model
- Introduction
- User Stories
- Use Case Diagrams
- Functional Requirements
- Non-Functional Requirements
- Domain Model
- Introduction
- User Stories
- Use Case Diagrams
- Functional Requirements
- Non-Functional Requirements
- Domain Model
- Introduction
- Architectural Requirements
- Technology Requirements
- API Contracts
- Deployment
- NFR Testing
- NFR Traceability Matrix
- Introduction
- User Stories
- Use Case Diagrams
- Functional Requirements
- Non-Functional Requirements
- Domain Model
- Introduction
- Architectural Requirements
- Technology Requirements
- API Contracts
- Deployment
- NFR Testing
- NFR Traceability Matrix