📝Updated documentation for the backend services

This commit is contained in:
Anton SHEPILOV
2024-05-28 16:46:01 +02:00
committed by Anton Shepilov
parent 904b767382
commit 3cf164787f
26 changed files with 193 additions and 248 deletions
@@ -1,40 +1,28 @@
---
description: File database models
---
<!-- TODO[NOT UP TO DATE] -->
# Database models
* **files** The main file object in database
```javascript
javascript
{
//Primary key: [["company_id"], "id"]
"company_id": "uuid-v4",
"id": "uuid-v4",
"user_id": "string",
"application_id": "string",
"updated_at": "number",
"created_at":"number
"upload_data": (json){
"size": number, //Total file size
"chunks": number, //Number of chunks
}
"metadata": (json){
"name": "string", //File name
"mime": "type/subtype",
}
"thumbnails": (json) { //Url to thumbnail (or set it to undefined if no relevant)
"index": "string",
"id": "uuid-v4",
"type": "string",
"size": "number,
"width": number, //Thumbnail width (for images only)
"height": number, //Thumbnail height (for images only)
}
```Typescript
export class File {
company_id: string;
id: string;
user_id: string;
application_id: null | string;
encryption_key: string;
updated_at: number;
created_at: number;
metadata: null | {
name?: string;
mime?: string;
thumbnails_status?: "done" | "error" | "waiting";
};
thumbnails: Thumbnail[];
upload_data: null | {
size: number;
chunks: number;
};
}
```
```