Skip to content

Latest commit

 

History

History
132 lines (107 loc) · 11.1 KB

doctrine.md

File metadata and controls

132 lines (107 loc) · 11.1 KB

Doctrine entities

Global notes:

  • All UUIDs are UUIDv7 (RFC 4122) and are generated by the database.

Department

The Department entity defines a department in the government. It is used to group dossiers. There can be multiple departments attached to a dossier.

Field Type Description
id UUID The internal ID of the department
name string The name of the department

Document

The Document entity defines a document that is attached to a dossier. Each dossier has one or more documents attached to it. All documents are binary stored in the documents folder.

Field Type Description
id UUID The internal ID of the document
created_at DateTime Date/time when this record was created (not the same as documentDate!)
updated_at DateTime Date/time this record was last updated. Same as createdDate when not modified.
mimetype string The mimetype of the document
filepath string Path (relative from document-root) of the file on disk
filesize int File size in bytes
page_count int In case of a paged document: the number of pages in the document
summary string Summary of the document (not used)
title string Title of the document (email subject, or filename)
class string Class of the document (inventory, decision or document)
source_type string Type of the ORIGINAL source file (spreadsheet, email, word document etc)
file_type string Type of the uploaded file (mostly PDF)
publication_type string ??
publication_section string ??
document_number string Generated document number for usage in this platform (not known in other systems).
document_date DateTime The date of the original document
filename string The original filename of the document before it was converted to a PDF
familiy_id int The family / group ID for this document. If this document is the only one in the group, the familty id is the same as the document id
document_id int The actual document ID
thread_id int In case of an email, the thread ID of the email
judgement string Wether or not this document is (partially) restricted
grounds string[] The law grounds on which this document is restricted
subjects string[] A list of subjects / labels for this document
period string The date period (eg: 2020-08) that this document refers to
uploaded boolean True if an actual document has been uploaded for this record

Documents have an m:n relation with documents through the document_dossier table.

Dossier

A Dossier is the main entity in the system. It defines a dossier. A dossier can have one or more documents attached to it. A dossier can have one or more departments attached to it.

When creating a dossier, an inventory spreadsheet must be uploaded as well. This defines all the documents that should be uploaded for this dossier. After a dossier has been completed by uploading all documents, it can be published.

Field Type Description
id UUID The internal ID of the dossier
created_at DateTime Date/time when this record was created
updated_at DateTime Date/time this record was last updated. Same as createdDate when not modified.
dossier_nr string The generated dossier number. Normally prefixed with department code (eg: VWS-xxx-xxxx)
title string The title of the dossier
status string The status of the dossier (draft, published, etc)
date_from Date The start of the period for this dossier (or null)
date_to Date The end of the period for this dossier (or null)
publication_reason string The reason this dossier is published (woo/wob)
decision string Decision of the dossier (open, partly open, closed)
publication_date Date Date of publication

Dossiers have an m:n relation with documents through the document_dossier table. Dossiers have an m:n relation with departments through the dossier_department table.

User

A User is a user in the system. It is used to log in to the system. A user is able to create and manage dossiers and/or other users depending on the roles assigned to the user.

Field Type Description
id UUID The internal ID of the user
created_at DateTime Date/time when this record was created
updated_at DateTime Date/time this record was last updated. Same as createdDate when not modified.
email string The email address for this user
roles string[] The roles assigned to this user
password string Hashed password of the user
name string Full name of the user, mostly for display purposes
mfa_token Encrypted string[^1] The MFA token for this user. This is used to generate the QR code for the MFA app.
mfa_recovery Encrypted string[^1] The MFA recovery codes for this user. This is used to recover the MFA app.
enabled bool True if the user is enabled, false if the user is disabled.
changepwd bool True if the user must change the password on next login.

[^1] Encrypted strings are encrypted at rest in the database with a symmetric encryption.

Inquiry

An Inquiry is a request for documents from the government. Anyone is able to create an inquiry, and these inquiries will result in a dossier.

Field Type Description
id UUID The internal ID of the user
casenr string Generated case number for this inquiry
created_at DateTime Date/time when this record was created
updated_at DateTime Date/time this record was last updated. Same as createdDate when not modified.
token string The token used to access the inquiry

WorkerStats

A WorkerStats is a record that keeps track of the number of documents processed by the workers. This is used to generate statistics on the number of documents processed per day.

Field Type Description
id UUID The internal ID of the user
section string Section name of the worker
count int Number of times this worker section has been executed
duration bigint (64bits) Number of seconds in total by this worker