schema updates
This commit is contained in:
parent
2e8ee7ca5c
commit
8383080395
31
README.MD
31
README.MD
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -26,7 +26,7 @@ generator dbml {
|
||||
provider = "prisma-dbml-generator"
|
||||
output = "../docs"
|
||||
outputName = "schema.dbml"
|
||||
projectName = "AssetFlow"
|
||||
projectName = "ATAS"
|
||||
}
|
||||
|
||||
|
||||
@ -46,70 +46,74 @@ enum alertType {
|
||||
}
|
||||
|
||||
enum alertState {
|
||||
incomming // Incomming alerts
|
||||
running // Started calling
|
||||
failed // Failed to get acknowledgement of any alertContacts
|
||||
acknowledged // Some user acknowledged alert
|
||||
incoming // Incoming alerts
|
||||
running // Started calling
|
||||
failed // Failed to get acknowledgement of any alertContacts
|
||||
acknowledged // Some user acknowledged alert
|
||||
}
|
||||
|
||||
model alerts {
|
||||
id Int @id @unique @default(autoincrement())
|
||||
type alertType
|
||||
message String?
|
||||
actionplan actionPlan? @relation(fields: [actionplanId], references: [id])
|
||||
actionplanId Int?
|
||||
date DateTime
|
||||
id Int @id @unique @default(autoincrement())
|
||||
type alertType
|
||||
state alertState
|
||||
|
||||
description String?
|
||||
date DateTime
|
||||
|
||||
actionplan actionPlan? @relation(fields: [actionplanId], references: [id])
|
||||
actionplanId Int?
|
||||
|
||||
acknowledged_by alertContacts[]
|
||||
acknowledged_at DateTime?
|
||||
@@fulltext([message])
|
||||
|
||||
@@fulltext([description])
|
||||
}
|
||||
|
||||
|
||||
model alertContacts {
|
||||
id Int @id @unique @default(autoincrement())
|
||||
id Int @id @unique @default(autoincrement())
|
||||
name String
|
||||
phone String @unique
|
||||
phone String @unique
|
||||
comment String?
|
||||
prios priorities[]
|
||||
alerts alerts[]
|
||||
alerts alerts[]
|
||||
|
||||
@@fulltext([name, phone, comment])
|
||||
}
|
||||
|
||||
model actionPlan {
|
||||
id Int @id @unique @default(autoincrement())
|
||||
name String
|
||||
comment String?
|
||||
alert_hook String @unique
|
||||
prio priorities[]
|
||||
content content[] // aka. all voice files
|
||||
id Int @id @unique @default(autoincrement())
|
||||
name String @unique
|
||||
comment String?
|
||||
alerthook String @unique
|
||||
prio priorities[]
|
||||
content content[] // aka. all voice files
|
||||
|
||||
alerts alerts[]
|
||||
|
||||
@@fulltext([name, comment])
|
||||
}
|
||||
|
||||
model priorities {
|
||||
id Int @id @unique @default(autoincrement())
|
||||
Contact alertContacts @relation(fields: [contactId], references: [id])
|
||||
contactId Int
|
||||
priority Int
|
||||
actionplan actionPlan @relation(fields: [actionplanId], references: [id])
|
||||
actionplanId Int
|
||||
id Int @id @unique @default(autoincrement())
|
||||
Contact alertContacts @relation(fields: [contactId], references: [id])
|
||||
contactId Int
|
||||
priority Int
|
||||
actionplan actionPlan @relation(fields: [actionplanId], references: [id])
|
||||
actionplanId Int
|
||||
|
||||
@@unique([priority, actionplanId])
|
||||
}
|
||||
|
||||
model content {
|
||||
id Int @id @unique @default(autoincrement())
|
||||
type contentType
|
||||
name String
|
||||
filename String
|
||||
actionplan actionPlan[]
|
||||
id Int @id @unique @default(autoincrement())
|
||||
type contentType
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user