feat: Add notification endpoints for admin (#8196)

This commit is contained in:
Stevche Radevski
2024-07-19 22:00:53 +02:00
committed by GitHub
parent ecc97076b5
commit 56f2ddc4b6
15 changed files with 209 additions and 3 deletions

View File

@@ -5,7 +5,7 @@ import { NotificationProvider } from "./notification-provider"
export const Notification = model.define("notification", {
id: model.id({ prefix: "noti" }).primaryKey(),
// This can be an email, phone number, or username, depending on the channel.
to: model.text(),
to: model.text().searchable(),
channel: model.text(),
// The template name in the provider's system.
template: model.text(),
@@ -14,7 +14,7 @@ export const Notification = model.define("notification", {
// This can be the event name, the workflow, or anything else that can help to identify what triggered the notification.
trigger_type: model.text().nullable(),
// The ID of the resource this notification is for, if applicable. Useful for displaying relevant information in the UI
resource_id: model.text().nullable(),
resource_id: model.text().searchable().nullable(),
// The typeame of the resource this notification is for, if applicable, eg. "order"
resource_type: model.text().nullable(),
// The ID of the receiver of the notification, if applicable. This can be a customer, user, a company, or anything else.