4. Documentation Handling¶
Document management is an essential tool to achieve an efficient, organized and systematic dynamic in the interested areas of the entity.
The Documentation Handling service, serves the following purposes:
- Creating cabinets: A cabinet is an abstraction that allows you to group together a set of related documents. Conceptually, its similar to a folder in a traditional filesystem, even though it only supports one level of nesting - this is, a cabinet cannot contain other cabinets as elements - only documents.
- Creating documents: A document is an abrstaction that represents a group of papers that deals with the same subject. For example, sworn declarations, statutes, balance sheets, etc.
- Attach files to documents, and download them. A document may have several files, just like a balance sheet may have several sheets.
erDiagram
DigitalProfile ||--|| Cabinet: has
Cabinet ||--o{ Document: has
Document ||--o{ Files: has
Files ||--o{ DownloadToken: has
Document }o--|| DigitalProfile: belongs
DigitalProfile {
string id
string name
}
Cabinet {
string id
string name
}
Document {
string id
string name
}
Files {
string url
string filename
int size
string content_type
}
DownloadToken {
string token
string doc_id
string url
int size
int expires_in
string content_type
}
4.1 Cabinets¶
A cabinet is specified by its name and an optional description. Initially the cabinets holds no documents.
Note
By convention, an empty cabinet must be assigned to each profile. This is, we establish a correspondence of a cabinet for each file. Then, the documents
property of the profile must be set to a list containing a single element: a string with the reference to the created cabinet, using for it the id
assigned to the cabinet.
4.2 Documents¶
A document is an abstraction that represent a group of papers that deals with the same subject. For example, sworn declarations, statutes, balance sheets, etc. A document is specified by:
-
A name
name
is required, limited to max 255 characters. -
An optional
description
, limited to max 255 characters. -
A document type
doc_type
. More information on 4.9 Document types -
An external reference
ref
. By convention, theid
of the profile that is related to this profile must be saved as an external reference. -
The
cabinet_id
is a reference to theid
field of the cabinet that contains this document. -
The pair of attributes
date_from
anddate_tp
is used to define the period of validity of the document.
4.3 Files¶
Each document has associated one or more files. The size of the files have a limit of 50 MB per file.
4.4 Download tokens¶
To download the files a temporary download token is used to allow access to the files that comprises a document. The expiry time for this token has a microsecond granularity and can be found in the expires_in
field. The default expiry time is 10 minutes. At most, it can be one day.
4.5 Summing it up¶
The following diagram summarizes the main entities linked in handling documentation and foreign key references to maintain.
4.6 Labels/Tags¶
A document can be marked using arbitrary strings as tags. A label has a minumum length of 2 characters and a maximum of 20 characters.
4.7 Additional Information¶
All the additional information you want can be saved in the profile in key-value format.
4.8 History¶
If the document is set to be versionable, the system will keep track of all the changes made to it, along with the timestamp and user or application that made the change. The versions of the document will be numbered starting from 1. Each change is an object that references the document by its unique identifier (orig_id
), the version number immediately previous and an array of changes. The changes format is similar to that described for profiles. At most, up to 50 versions of the same documents are allowed.
By default, the documents of a profile can't be erased. If you wish to allow the delation, they can be marked as erasables.
4.9 Document Types¶
Each documents carries a type, that allows you to categorize its function. By default, the following types are provided:
- Balance Sheet:
balance_sheet
. - Security Gesture:
gesture
. - ID Front Cover:
id_front
. - ID Back Cover:
id_back
. - ID Card:
identity_card
. - Paycheck Stub:
paycheck_stub
. - Signature:
signature
. - Selfie:
selfie
- Statute:
statute
. - Statutory Powers:
statutory_powers
. - Tax Records:
tax_records
. - Others:
other
.
You can extend this enumeration to contain all the document types that your entity needs to represent their bussiness model.
4.10 Allowed file types¶
Mime type | Extension |
---|---|
text/plain | .txt |
text/csv | .csv |
image/png | .png |
image/jpeg | .jpeg |
application/json | .json |
application/pdf | |
application/msword | .doc .dot |
application/excel | |
application/vnd.ms-powerpoint | .ppt .pot .pps .ppa |
application/vnd.ms-excel | .xls .xlt .xla |
application/vnd.oasis.opendocument.text | .odt |
application/vnd.oasis.opendocument.spreadsheet | .ods |
application/vnd.oasis.opendocument.presentation | .odp |
application/vnd.openxmlformats-officedocument.wordprocessingml.document | .docx |
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | .xlsx |
application/vnd.openxmlformats-officedocument.presentationml.presentation | .pptx |
application/vnd.rar | .rar |
application/x-tar | .tar .tgz |
application/zip | .zip |
4.11 Documentation to expire and expired documentation¶
Trak.e allows you to configure a validity period for each document. The platform may be configured to issue alerts when a documents is close to its expiration date, or when the document actually reaches its expriration date.
4.12 Resources¶
Recurso |
---|
doc_cabinet |
doc_document |
doc_file |