Diagram fix final
This commit is contained in:
395
README.md
395
README.md
@@ -46,209 +46,210 @@ The HTML code for the frontend can be generated by using `trunk build`. The resu
|
|||||||
|
|
||||||
## Diagrams
|
## Diagrams
|
||||||
### Class Diagramm
|
### Class Diagramm
|
||||||
|
#### Backend
|
||||||
```mermaid
|
```mermaid
|
||||||
classDiagram
|
classDiagram
|
||||||
namespace Backend {
|
class Error {
|
||||||
class Error {
|
+status: &'static str
|
||||||
+status: &'static str
|
+message: String
|
||||||
+message: String
|
|
||||||
}
|
|
||||||
class TicketResponse {
|
|
||||||
+id: i32
|
|
||||||
+category: String
|
|
||||||
+betreff: String
|
|
||||||
+description: String
|
|
||||||
+room: i16
|
|
||||||
+status: String
|
|
||||||
+date: chrono::DateTime~chrono::Utc~
|
|
||||||
+user_id: i16
|
|
||||||
+user_first_name: String
|
|
||||||
+user_last_name: String
|
|
||||||
}
|
|
||||||
class User {
|
|
||||||
+id: i16
|
|
||||||
+last_name: String
|
|
||||||
+first_name: String
|
|
||||||
+username: String
|
|
||||||
+is_admin: bool
|
|
||||||
+pwd: String
|
|
||||||
}
|
|
||||||
class TicketCreateScheme {
|
|
||||||
+category: String
|
|
||||||
+betreff: String
|
|
||||||
+description: String
|
|
||||||
+room: i16
|
|
||||||
}
|
|
||||||
class TicketUpdateScheme {
|
|
||||||
+status: String
|
|
||||||
}
|
|
||||||
class UserUpdateScheme {
|
|
||||||
+id: i16
|
|
||||||
+first_name: String
|
|
||||||
+last_name: String
|
|
||||||
+username: String
|
|
||||||
+make_admin: bool
|
|
||||||
+new_pwd: String
|
|
||||||
}
|
|
||||||
class UserCreateScheme {
|
|
||||||
+first_name: String
|
|
||||||
+last_name: String
|
|
||||||
+username: String
|
|
||||||
+is_admin: bool
|
|
||||||
+pwd: String
|
|
||||||
}
|
|
||||||
class LoginScheme {
|
|
||||||
+username: String
|
|
||||||
+pwd: String
|
|
||||||
}
|
|
||||||
class FilteredUser {
|
|
||||||
+id: i16
|
|
||||||
+first_name: String
|
|
||||||
+last_name: String
|
|
||||||
+username: String
|
|
||||||
+is_admin: bool
|
|
||||||
}
|
|
||||||
class Claims {
|
|
||||||
+sub: String
|
|
||||||
+issued: usize
|
|
||||||
+expires: usize
|
|
||||||
}
|
|
||||||
class AppState {
|
|
||||||
-db: PgPool
|
|
||||||
-env: Env
|
|
||||||
}
|
|
||||||
class Env {
|
|
||||||
+db_url: String
|
|
||||||
+token_secret: String
|
|
||||||
+origin: String
|
|
||||||
+backend_port: String
|
|
||||||
+load() Env
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
namespace Frontend {
|
class TicketResponse {
|
||||||
class TicketCreateScheme {
|
+id: i32
|
||||||
+category: String
|
+category: String
|
||||||
+betreff: String
|
+betreff: String
|
||||||
+description: String
|
+description: String
|
||||||
+room: i16
|
+room: i16
|
||||||
}
|
+status: String
|
||||||
class TicketUpdateScheme {
|
+date: chrono::DateTime~chrono::Utc~
|
||||||
+status: String
|
+user_id: i16
|
||||||
}
|
+user_first_name: String
|
||||||
class Ticket {
|
+user_last_name: String
|
||||||
+id: i32
|
}
|
||||||
+category: String
|
class User {
|
||||||
+betreff: String
|
+id: i16
|
||||||
+description: String
|
+last_name: String
|
||||||
+room: i16
|
+first_name: String
|
||||||
+status: String
|
+username: String
|
||||||
+date: chrono::DateTime~chrono::Utc~
|
+is_admin: bool
|
||||||
+user_id: i16
|
+pwd: String
|
||||||
+user_first_name: String
|
}
|
||||||
+user_last_name: String
|
class TicketCreateScheme {
|
||||||
}
|
+category: String
|
||||||
class TicketProps {
|
+betreff: String
|
||||||
+id: i32
|
+description: String
|
||||||
}
|
+room: i16
|
||||||
class ActiveUser {
|
}
|
||||||
+id: Option~i16~
|
class TicketUpdateScheme {
|
||||||
+is_admin: bool
|
+status: String
|
||||||
}
|
}
|
||||||
class ApiError {
|
class UserUpdateScheme {
|
||||||
-message: String
|
+id: i16
|
||||||
-_status: String
|
+first_name: String
|
||||||
}
|
+last_name: String
|
||||||
class SidebarExpandState {
|
+username: String
|
||||||
+ticket_open: bool
|
+make_admin: bool
|
||||||
+users_open: bool
|
+new_pwd: String
|
||||||
}
|
}
|
||||||
class Default {
|
class UserCreateScheme {
|
||||||
+default() Self
|
+first_name: String
|
||||||
}
|
+last_name: String
|
||||||
class SidebarState {
|
+username: String
|
||||||
+expand: SidebarExpandState
|
+is_admin: bool
|
||||||
+set_tickets_open: Callback~bool~
|
+pwd: String
|
||||||
+toggle_tickets: Callback~()~
|
}
|
||||||
+set_users_open: Callback~bool~
|
class LoginScheme {
|
||||||
+toggle_users: Callback~()~
|
+username: String
|
||||||
+new(expand:SidebarExpandState, set_tickets_open:Callback~bool~, toggle_tickets:Callback~()~, set_users_open:Callback~bool~, toggle_users:Callback~()~) Self
|
+pwd: String
|
||||||
}
|
}
|
||||||
class SidebarProps {
|
class FilteredUser {
|
||||||
+children: Children
|
+id: i16
|
||||||
}
|
+first_name: String
|
||||||
class TicketPartial {
|
+last_name: String
|
||||||
-date: DateTime~Utc~
|
+username: String
|
||||||
-room: i16
|
+is_admin: bool
|
||||||
-user_id: i16
|
}
|
||||||
}
|
class Claims {
|
||||||
class UserPartial {
|
+sub: String
|
||||||
-id: i16
|
+issued: usize
|
||||||
-first_name: String
|
+expires: usize
|
||||||
-last_name: String
|
}
|
||||||
}
|
class AppState {
|
||||||
class RoomTotalsProps {
|
-db: PgPool
|
||||||
-tickets: Vec~TicketPartial~
|
-env: Env
|
||||||
}
|
}
|
||||||
class UserTotalProps {
|
class Env {
|
||||||
-users: Vec~UserPartial~
|
+db_url: String
|
||||||
-tickets: Vec~TicketPartial~
|
+token_secret: String
|
||||||
}
|
+origin: String
|
||||||
class AdminSetupScheme {
|
+backend_port: String
|
||||||
+first_name: String
|
+load() Env
|
||||||
+last_name: String
|
|
||||||
+username: String
|
|
||||||
+pwd: String
|
|
||||||
}
|
|
||||||
class UserCreateScheme {
|
|
||||||
+first_name: String
|
|
||||||
+last_name: String
|
|
||||||
+username: String
|
|
||||||
+is_admin: bool
|
|
||||||
+pwd: String
|
|
||||||
}
|
|
||||||
class LoginScheme {
|
|
||||||
+username: String
|
|
||||||
+pwd: String
|
|
||||||
}
|
|
||||||
class UserUpdateScheme {
|
|
||||||
+id: i16
|
|
||||||
+first_name: String
|
|
||||||
+last_name: String
|
|
||||||
+username: String
|
|
||||||
+make_admin: bool
|
|
||||||
+new_pwd: String
|
|
||||||
}
|
|
||||||
class FilteredUser {
|
|
||||||
+id: i16
|
|
||||||
+first_name: String
|
|
||||||
+last_name: String
|
|
||||||
+username: String
|
|
||||||
+is_admin: bool
|
|
||||||
}
|
|
||||||
class UserProps {
|
|
||||||
+id: i16
|
|
||||||
}
|
|
||||||
class ApiError {
|
|
||||||
-message: String
|
|
||||||
-_status: String
|
|
||||||
}
|
|
||||||
class AuthState {
|
|
||||||
+is_authenticated: Option~bool~
|
|
||||||
+is_admin: Option~bool~
|
|
||||||
}
|
|
||||||
class ProtectedRouteProps {
|
|
||||||
+children: Children
|
|
||||||
+admin_page: bool
|
|
||||||
}
|
|
||||||
class SidebarShellProps {
|
|
||||||
+children: Children
|
|
||||||
}
|
|
||||||
class AdminCheckWrapperProps {
|
|
||||||
+children: Children
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
AppState --> Env
|
AppState --> Env
|
||||||
Env ..> Env
|
Env ..> Env
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Frontend
|
||||||
|
```mermaid
|
||||||
|
class TicketCreateScheme {
|
||||||
|
+category: String
|
||||||
|
+betreff: String
|
||||||
|
+description: String
|
||||||
|
+room: i16
|
||||||
|
}
|
||||||
|
class TicketUpdateScheme {
|
||||||
|
+status: String
|
||||||
|
}
|
||||||
|
class Ticket {
|
||||||
|
+id: i32
|
||||||
|
+category: String
|
||||||
|
+betreff: String
|
||||||
|
+description: String
|
||||||
|
+room: i16
|
||||||
|
+status: String
|
||||||
|
+date: chrono::DateTime~chrono::Utc~
|
||||||
|
+user_id: i16
|
||||||
|
+user_first_name: String
|
||||||
|
+user_last_name: String
|
||||||
|
}
|
||||||
|
class TicketProps {
|
||||||
|
+id: i32
|
||||||
|
}
|
||||||
|
class ActiveUser {
|
||||||
|
+id: Option~i16~
|
||||||
|
+is_admin: bool
|
||||||
|
}
|
||||||
|
class ApiError {
|
||||||
|
-message: String
|
||||||
|
-_status: String
|
||||||
|
}
|
||||||
|
class SidebarExpandState {
|
||||||
|
+ticket_open: bool
|
||||||
|
+users_open: bool
|
||||||
|
}
|
||||||
|
class Default {
|
||||||
|
+default() Self
|
||||||
|
}
|
||||||
|
class SidebarState {
|
||||||
|
+expand: SidebarExpandState
|
||||||
|
+set_tickets_open: Callback~bool~
|
||||||
|
+toggle_tickets: Callback~()~
|
||||||
|
+set_users_open: Callback~bool~
|
||||||
|
+toggle_users: Callback~()~
|
||||||
|
+new(expand:SidebarExpandState, set_tickets_open:Callback~bool~, toggle_tickets:Callback~()~, set_users_open:Callback~bool~, toggle_users:Callback~()~) Self
|
||||||
|
}
|
||||||
|
class SidebarProps {
|
||||||
|
+children: Children
|
||||||
|
}
|
||||||
|
class TicketPartial {
|
||||||
|
-date: DateTime~Utc~
|
||||||
|
-room: i16
|
||||||
|
-user_id: i16
|
||||||
|
}
|
||||||
|
class UserPartial {
|
||||||
|
-id: i16
|
||||||
|
-first_name: String
|
||||||
|
-last_name: String
|
||||||
|
}
|
||||||
|
class RoomTotalsProps {
|
||||||
|
-tickets: Vec~TicketPartial~
|
||||||
|
}
|
||||||
|
class UserTotalProps {
|
||||||
|
-users: Vec~UserPartial~
|
||||||
|
-tickets: Vec~TicketPartial~
|
||||||
|
}
|
||||||
|
class AdminSetupScheme {
|
||||||
|
+first_name: String
|
||||||
|
+last_name: String
|
||||||
|
+username: String
|
||||||
|
+pwd: String
|
||||||
|
}
|
||||||
|
class UserCreateScheme {
|
||||||
|
+first_name: String
|
||||||
|
+last_name: String
|
||||||
|
+username: String
|
||||||
|
+is_admin: bool
|
||||||
|
+pwd: String
|
||||||
|
}
|
||||||
|
class LoginScheme {
|
||||||
|
+username: String
|
||||||
|
+pwd: String
|
||||||
|
}
|
||||||
|
class UserUpdateScheme {
|
||||||
|
+id: i16
|
||||||
|
+first_name: String
|
||||||
|
+last_name: String
|
||||||
|
+username: String
|
||||||
|
+make_admin: bool
|
||||||
|
+new_pwd: String
|
||||||
|
}
|
||||||
|
class FilteredUser {
|
||||||
|
+id: i16
|
||||||
|
+first_name: String
|
||||||
|
+last_name: String
|
||||||
|
+username: String
|
||||||
|
+is_admin: bool
|
||||||
|
}
|
||||||
|
class UserProps {
|
||||||
|
+id: i16
|
||||||
|
}
|
||||||
|
class ApiError {
|
||||||
|
-message: String
|
||||||
|
-_status: String
|
||||||
|
}
|
||||||
|
class AuthState {
|
||||||
|
+is_authenticated: Option~bool~
|
||||||
|
+is_admin: Option~bool~
|
||||||
|
}
|
||||||
|
class ProtectedRouteProps {
|
||||||
|
+children: Children
|
||||||
|
+admin_page: bool
|
||||||
|
}
|
||||||
|
class SidebarShellProps {
|
||||||
|
+children: Children
|
||||||
|
}
|
||||||
|
class AdminCheckWrapperProps {
|
||||||
|
+children: Children
|
||||||
|
}
|
||||||
SidebarState --> SidebarExpandState
|
SidebarState --> SidebarExpandState
|
||||||
RoomTotalsProps --> TicketPartial
|
RoomTotalsProps --> TicketPartial
|
||||||
UserTotalProps --> UserPartial
|
UserTotalProps --> UserPartial
|
||||||
|
|||||||
Reference in New Issue
Block a user