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
|
- Erklärung MP3
|
||||||
- Quittierung MP3
|
- Quittierung MP3
|
||||||
- Verabschiedung 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)
|
//// THIS FILE WAS AUTOMATICALLY GENERATED (DO NOT MODIFY)
|
||||||
//// ------------------------------------------------------
|
//// ------------------------------------------------------
|
||||||
|
|
||||||
Project "AssetFlow" {
|
Project "ATAS" {
|
||||||
database_type: ''
|
database_type: ''
|
||||||
Note: ''
|
Note: ''
|
||||||
}
|
}
|
||||||
@ -10,11 +10,11 @@ Project "AssetFlow" {
|
|||||||
Table alerts {
|
Table alerts {
|
||||||
id Int [pk, increment]
|
id Int [pk, increment]
|
||||||
type alertType [not null]
|
type alertType [not null]
|
||||||
message String
|
state alertState [not null]
|
||||||
|
description String
|
||||||
|
date DateTime [not null]
|
||||||
actionplan actionPlan
|
actionplan actionPlan
|
||||||
actionplanId Int
|
actionplanId Int
|
||||||
date DateTime [not null]
|
|
||||||
state alertState [not null]
|
|
||||||
acknowledged_by alertContacts [not null]
|
acknowledged_by alertContacts [not null]
|
||||||
acknowledged_at DateTime
|
acknowledged_at DateTime
|
||||||
}
|
}
|
||||||
@ -30,9 +30,9 @@ Table alertContacts {
|
|||||||
|
|
||||||
Table actionPlan {
|
Table actionPlan {
|
||||||
id Int [pk, increment]
|
id Int [pk, increment]
|
||||||
name String [not null]
|
name String [unique, not null]
|
||||||
comment String
|
comment String
|
||||||
alert_hook String [unique, not null]
|
alerthook String [unique, not null]
|
||||||
prio priorities [not null]
|
prio priorities [not null]
|
||||||
content content [not null]
|
content content [not null]
|
||||||
alerts alerts [not null]
|
alerts alerts [not null]
|
||||||
@ -85,7 +85,7 @@ Enum alertType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Enum alertState {
|
Enum alertState {
|
||||||
incomming
|
incoming
|
||||||
running
|
running
|
||||||
failed
|
failed
|
||||||
acknowledged
|
acknowledged
|
||||||
|
@ -26,7 +26,7 @@ generator dbml {
|
|||||||
provider = "prisma-dbml-generator"
|
provider = "prisma-dbml-generator"
|
||||||
output = "../docs"
|
output = "../docs"
|
||||||
outputName = "schema.dbml"
|
outputName = "schema.dbml"
|
||||||
projectName = "AssetFlow"
|
projectName = "ATAS"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -46,70 +46,74 @@ enum alertType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enum alertState {
|
enum alertState {
|
||||||
incomming // Incomming alerts
|
incoming // Incoming alerts
|
||||||
running // Started calling
|
running // Started calling
|
||||||
failed // Failed to get acknowledgement of any alertContacts
|
failed // Failed to get acknowledgement of any alertContacts
|
||||||
acknowledged // Some user acknowledged alert
|
acknowledged // Some user acknowledged alert
|
||||||
}
|
}
|
||||||
|
|
||||||
model alerts {
|
model alerts {
|
||||||
id Int @id @unique @default(autoincrement())
|
id Int @id @unique @default(autoincrement())
|
||||||
type alertType
|
type alertType
|
||||||
message String?
|
|
||||||
actionplan actionPlan? @relation(fields: [actionplanId], references: [id])
|
|
||||||
actionplanId Int?
|
|
||||||
date DateTime
|
|
||||||
state alertState
|
state alertState
|
||||||
|
|
||||||
|
description String?
|
||||||
|
date DateTime
|
||||||
|
|
||||||
|
actionplan actionPlan? @relation(fields: [actionplanId], references: [id])
|
||||||
|
actionplanId Int?
|
||||||
|
|
||||||
acknowledged_by alertContacts[]
|
acknowledged_by alertContacts[]
|
||||||
acknowledged_at DateTime?
|
acknowledged_at DateTime?
|
||||||
@@fulltext([message])
|
|
||||||
|
@@fulltext([description])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
model alertContacts {
|
model alertContacts {
|
||||||
id Int @id @unique @default(autoincrement())
|
id Int @id @unique @default(autoincrement())
|
||||||
name String
|
name String
|
||||||
phone String @unique
|
phone String @unique
|
||||||
comment String?
|
comment String?
|
||||||
prios priorities[]
|
prios priorities[]
|
||||||
alerts alerts[]
|
alerts alerts[]
|
||||||
|
|
||||||
@@fulltext([name, phone, comment])
|
@@fulltext([name, phone, comment])
|
||||||
}
|
}
|
||||||
|
|
||||||
model actionPlan {
|
model actionPlan {
|
||||||
id Int @id @unique @default(autoincrement())
|
id Int @id @unique @default(autoincrement())
|
||||||
name String
|
name String @unique
|
||||||
comment String?
|
comment String?
|
||||||
alert_hook String @unique
|
alerthook String @unique
|
||||||
prio priorities[]
|
prio priorities[]
|
||||||
content content[] // aka. all voice files
|
content content[] // aka. all voice files
|
||||||
|
|
||||||
alerts alerts[]
|
alerts alerts[]
|
||||||
|
|
||||||
@@fulltext([name, comment])
|
@@fulltext([name, comment])
|
||||||
}
|
}
|
||||||
|
|
||||||
model priorities {
|
model priorities {
|
||||||
id Int @id @unique @default(autoincrement())
|
id Int @id @unique @default(autoincrement())
|
||||||
Contact alertContacts @relation(fields: [contactId], references: [id])
|
Contact alertContacts @relation(fields: [contactId], references: [id])
|
||||||
contactId Int
|
contactId Int
|
||||||
priority Int
|
priority Int
|
||||||
actionplan actionPlan @relation(fields: [actionplanId], references: [id])
|
actionplan actionPlan @relation(fields: [actionplanId], references: [id])
|
||||||
actionplanId Int
|
actionplanId Int
|
||||||
|
|
||||||
@@unique([priority, actionplanId])
|
@@unique([priority, actionplanId])
|
||||||
}
|
}
|
||||||
|
|
||||||
model content {
|
model content {
|
||||||
id Int @id @unique @default(autoincrement())
|
id Int @id @unique @default(autoincrement())
|
||||||
type contentType
|
type contentType
|
||||||
name String
|
name String
|
||||||
filename String
|
filename String
|
||||||
actionplan actionPlan[]
|
actionplan actionPlan[]
|
||||||
|
|
||||||
@@fulltext([name, filename])
|
@@fulltext([name, filename])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// https://spacecdn.de/file/bma_stoe_v1.mp3
|
// https://spacecdn.de/file/bma_stoe_v1.mp3
|
||||||
// https://spacecdn.de/file/quittiert_v1.mp3
|
// https://spacecdn.de/file/quittiert_v1.mp3
|
||||||
// https://spacecdn.de/file/angenehmen_tag_v1.mp3
|
// https://spacecdn.de/file/angenehmen_tag_v1.mp3
|
||||||
|
Loading…
x
Reference in New Issue
Block a user