Current state

This commit is contained in:
2025-01-17 23:02:39 +01:00
parent fa06c402e6
commit 534e240eff
24 changed files with 18717 additions and 6974 deletions

View File

@ -7,20 +7,43 @@ Project "AssetFlow" {
Note: ''
}
Table AlarmContacts {
Table alerts {
id Int [pk, increment]
type alertType [not null]
message String
actionplan actionPlan
actionplanId Int
date DateTime [not null]
state alertState [not null]
acknowledged_by alertContacts [not null]
acknowledged_at DateTime
}
Table alertContacts {
id Int [pk, increment]
name String [not null]
phone String [unique, not null]
comment String
Prios Priorities [not null]
prios priorities [not null]
alerts alerts [not null]
}
Table Priorities {
Table actionPlan {
id Int [pk, increment]
Contact AlarmContacts [not null]
name String [not null]
comment String
alert_hook String [unique, not null]
prio priorities [not null]
content content [not null]
alerts alerts [not null]
}
Table priorities {
id Int [pk, increment]
Contact alertContacts [not null]
contactId Int [not null]
priority Int [not null]
actionplan ActionPlan [not null]
actionplan actionPlan [not null]
actionplanId Int [not null]
indexes {
@ -28,25 +51,22 @@ Table Priorities {
}
}
Table ActionPlan {
id Int [pk, increment]
name String [not null]
comment String
prio Priorities [not null]
content Content [not null]
}
Table Content {
Table content {
id Int [pk, increment]
type contentType [not null]
name String [not null]
filename String [not null]
actionplan ActionPlan [not null]
actionplan actionPlan [not null]
}
Table ActionPlanToContent {
contentId Int [ref: > Content.id]
actionplanId Int [ref: > ActionPlan.id]
Table alertContactsToalerts {
acknowledged_byId Int [ref: > alertContacts.id]
alertsId Int [ref: > alerts.id]
}
Table actionPlanTocontent {
contentId Int [ref: > content.id]
actionplanId Int [ref: > actionPlan.id]
}
Enum contentType {
@ -56,6 +76,23 @@ Enum contentType {
voice_ending
}
Ref: Priorities.contactId > AlarmContacts.id
Enum alertType {
generic
fire
fault
intrusion
clear
}
Ref: Priorities.actionplanId > ActionPlan.id
Enum alertState {
incomming
running
failed
acknowledged
}
Ref: alerts.actionplanId > actionPlan.id
Ref: priorities.contactId > alertContacts.id
Ref: priorities.actionplanId > actionPlan.id