Skip to content

Commit

Permalink
docs(uml): add organization to DB UML (#348)
Browse files Browse the repository at this point in the history
* docs(uml): update the UML of the DB

* docs(contributing): update UML image

* ci(labeler): update labeler rule

* ci(labeler): add diagram update to topic docs
  • Loading branch information
frgfm authored Jul 15, 2024
1 parent d4f10be commit 3488cd7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
21 changes: 17 additions & 4 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,35 @@

'module: crud':
- changed-files:
- any-glob-to-any-file: src/app/crud/*
- any-glob-to-any-file: src/app/crud/base.py

'endpoint: cameras':
- changed-files:
- any-glob-to-any-file: src/app/api/*/endpoints/cameras.py
- any-glob-to-any-file:
- src/app/api/*/endpoints/cameras.py
- src/app/crud/cameras.py

'endpoint: detections':
- changed-files:
- any-glob-to-any-file: src/app/api/*/endpoints/detections.py
- any-glob-to-any-file:
- src/app/api/*/endpoints/detections.py
- src/app/crud/detections.py

'endpoint: login':
- changed-files:
- any-glob-to-any-file: src/app/api/*/endpoints/login.py

'endpoint: users':
- changed-files:
- any-glob-to-any-file: src/app/api/*/endpoints/users.py
- any-glob-to-any-file:
- src/app/api/*/endpoints/users.py
- src/app/crud/users.py

'endpoint: organizations':
- changed-files:
- any-glob-to-any-file:
- src/app/api/*/endpoints/organizations.py
- src/app/crud/organizations.py


'topic: build':
Expand Down Expand Up @@ -94,6 +106,7 @@
- CODE_OF_CONDUCT.md
- client/README.md
- client/CONTRIBUTING.md
- scripts/dbdiagram.txt

'topic: style':
- changed-files:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The back-end core feature is to interact with the metadata tables. For the servi

- Detection: association of a picture and a camera.

![UML diagram](https://github.com/pyronear/pyro-api/assets/26927750/bf48f757-7cb0-45fd-aea1-b832e969a705)
![UML diagram](https://github.com/user-attachments/assets/cd45d9e3-c570-4d84-95b9-7a8c5ae00af0)

### What is the full detection workflow through the API

Expand Down
10 changes: 10 additions & 0 deletions scripts/dbdiagram.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Enum "userrole" {

Table "User" as U {
"id" int [not null]
"organization_id" int [ref: > O.id, not null]
"role" userrole [not null]
"login" str [not null]
"hashed_password" str [not null]
Expand All @@ -18,6 +19,7 @@ Table "User" as U {

Table "Camera" as C {
"id" int [not null]
"organization_id" int [ref: > O.id, not null]
"name" str [not null]
"angle_of_view" float [not null]
"elevation" float [not null]
Expand All @@ -43,3 +45,11 @@ Table "Detection" as D {
(id) [pk]
}
}

Table "Organization" as O {
"id" int [not null]
"name" str [not null]
Indexes {
(id) [pk]
}
}

0 comments on commit 3488cd7

Please sign in to comment.