C
C#17mo ago
Hulkstance

❔ ERD Review

I'm working on an ERD for the FE mockups here: https://imgur.com/a/E3XJ0OU. It's a multi-tenant database where a tenant represents a company. Azure AD is used for authentication. Tenant - TenantId (primary key) - Name User - UserId (primary key) - TenantId (foreign key to Tenant table) - Email - Phone Event The Event table represents the different types of events for which notifications can be sent. It could be the different stages of an offer: Offer Filled, Offer Completed, Offer Cancelled, Offer Rejected, Offer Expired. - EventId (primary key) - EventName AlertTone - AlertToneId (primary key) - AlertToneName - AlertToneUrl UserEventNotification For each user, we can store their individual preferences for event notification types in the UserEventNotification table. This table also includes the user's chosen alert tone for each event type. The XEnabled column allows users to enable/disable notification types for specific events, but only for those events that were enabled by the administrator in the GlobalEventNotification table. - UserEventNotificationId (primary key) - UserId (foreign key to User table) - EventId (foreign key to Event table) - InAppNotificationEnabled (boolean, whether in-app notification is enabled for this user and event) - EmailNotificationEnabled (boolean, whether email notification is enabled for this user and event) - SmsNotificationEnabled (boolean, whether SMS notification is enabled for this user and event) - AlertToneId (foreign key to AlertTone table) GlobalEventNotification - GlobalEventNotificationId (primary key) - EventId (foreign key to Event table) - InAppNotificationEnabled - EmailNotificationEnabled - SmsNotificationEnabled
2 Replies
Hulkstance
Hulkstance17mo ago
erDiagram
User ||--o{ UserEventNotification : "has"
Tenant ||--o{ User : "has"
UserEventNotification ||--|{ Event : "for"
UserEventNotification ||--o{ AlertTone : "uses"
GlobalNotificationType ||--o{ Event : "for"

User {
string UserId
string Email
string Phone
string TenantId
}
Tenant {
string TenantId
string Name
}
Event {
string EventId
string EventName
}
AlertTone {
string AlertToneId
string AlertToneName
string AlertToneUrl
}
UserEventNotification {
string UserEventNotificationId
string UserId
string EventId
boolean InAppNotification
boolean EmailNotification
boolean SmsNotification
string AlertToneId
}
GlobalNotificationType {
string GlobalNotificationTypeId
string EventId
boolean InAppNotification
boolean EmailNotification
boolean SmsNotification
}
erDiagram
User ||--o{ UserEventNotification : "has"
Tenant ||--o{ User : "has"
UserEventNotification ||--|{ Event : "for"
UserEventNotification ||--o{ AlertTone : "uses"
GlobalNotificationType ||--o{ Event : "for"

User {
string UserId
string Email
string Phone
string TenantId
}
Tenant {
string TenantId
string Name
}
Event {
string EventId
string EventName
}
AlertTone {
string AlertToneId
string AlertToneName
string AlertToneUrl
}
UserEventNotification {
string UserEventNotificationId
string UserId
string EventId
boolean InAppNotification
boolean EmailNotification
boolean SmsNotification
string AlertToneId
}
GlobalNotificationType {
string GlobalNotificationTypeId
string EventId
boolean InAppNotification
boolean EmailNotification
boolean SmsNotification
}
Accord
Accord17mo ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.