schema updates

This commit is contained in:
Leon Meier 2025-02-03 22:23:37 +01:00
parent 2e8ee7ca5c
commit 8383080395
3 changed files with 78 additions and 43 deletions

View File

@ -16,3 +16,34 @@ Funktionen:
- Erklärung MP3
- Quittierung MP3
- Verabschiedung MP3
## API Endpoint planning
alertContacts (CRUD Fully implemented)
alerts -> Only get
actionPlan (CRUD)
- select all prios
priorities (CRUD)
- select actionPlan
- Only allow changes to priority
content (CRUD)
- Howto handle upload?
POST /alert/[:alert_hook]
-> Check actionplan if hook exists and select current prios -> Write call request to XYXYX
1. create one or more alertContacts
2. create 4x content (all phases)
3. create actionplan with contents
4. create one or more priorities

View File

@ -2,7 +2,7 @@
//// THIS FILE WAS AUTOMATICALLY GENERATED (DO NOT MODIFY)
//// ------------------------------------------------------
Project "AssetFlow" {
Project "ATAS" {
database_type: ''
Note: ''
}
@ -10,11 +10,11 @@ Project "AssetFlow" {
Table alerts {
id Int [pk, increment]
type alertType [not null]
message String
state alertState [not null]
description String
date DateTime [not null]
actionplan actionPlan
actionplanId Int
date DateTime [not null]
state alertState [not null]
acknowledged_by alertContacts [not null]
acknowledged_at DateTime
}
@ -30,9 +30,9 @@ Table alertContacts {
Table actionPlan {
id Int [pk, increment]
name String [not null]
name String [unique, not null]
comment String
alert_hook String [unique, not null]
alerthook String [unique, not null]
prio priorities [not null]
content content [not null]
alerts alerts [not null]
@ -85,7 +85,7 @@ Enum alertType {
}
Enum alertState {
incomming
incoming
running
failed
acknowledged

View File

@ -26,7 +26,7 @@ generator dbml {
provider = "prisma-dbml-generator"
output = "../docs"
outputName = "schema.dbml"
projectName = "AssetFlow"
projectName = "ATAS"
}
@ -46,7 +46,7 @@ enum alertType {
}
enum alertState {
incomming // Incomming alerts
incoming // Incoming alerts
running // Started calling
failed // Failed to get acknowledgement of any alertContacts
acknowledged // Some user acknowledged alert
@ -55,16 +55,19 @@ enum alertState {
model alerts {
id Int @id @unique @default(autoincrement())
type alertType
message String?
state alertState
description String?
date DateTime
actionplan actionPlan? @relation(fields: [actionplanId], references: [id])
actionplanId Int?
date DateTime
state alertState
acknowledged_by alertContacts[]
acknowledged_at DateTime?
@@fulltext([message])
}
@@fulltext([description])
}
model alertContacts {
id Int @id @unique @default(autoincrement())
@ -73,17 +76,20 @@ model alertContacts {
comment String?
prios priorities[]
alerts alerts[]
@@fulltext([name, phone, comment])
}
model actionPlan {
id Int @id @unique @default(autoincrement())
name String
name String @unique
comment String?
alert_hook String @unique
alerthook String @unique
prio priorities[]
content content[] // aka. all voice files
alerts alerts[]
@@fulltext([name, comment])
}
@ -104,12 +110,10 @@ model content {
name String
filename String
actionplan actionPlan[]
@@fulltext([name, filename])
}
// https://spacecdn.de/file/bma_stoe_v1.mp3
// https://spacecdn.de/file/quittiert_v1.mp3
// https://spacecdn.de/file/angenehmen_tag_v1.mp3