From 98be255203b143053053bbe548528330d4d3bd0d Mon Sep 17 00:00:00 2001 From: avicenan Date: Tue, 9 Jun 2026 15:49:52 +0900 Subject: [PATCH] fix(notif): make new column enum for priority --- src/entity/notification.ts | 3 ++- src/schema/public.ts | 1 + src/types/notification_priority.ts | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 src/types/notification_priority.ts diff --git a/src/entity/notification.ts b/src/entity/notification.ts index 4d8e8c4..322ca2d 100644 --- a/src/entity/notification.ts +++ b/src/entity/notification.ts @@ -9,6 +9,7 @@ import { } from "typeorm"; import { User } from "./users"; +import { NotificationPriority } from "../types/notification_priority"; @Index(["sender", "recipient"]) @Entity("notifications") @@ -79,7 +80,7 @@ export class Notification { length: 10, nullable: true, }) - priority: string | null; + priority: NotificationPriority | null; @Column({ type: "text", diff --git a/src/schema/public.ts b/src/schema/public.ts index 1d8f9c7..8f99c84 100644 --- a/src/schema/public.ts +++ b/src/schema/public.ts @@ -71,3 +71,4 @@ export * from "../types/email"; export * from "../types/telegram"; export * from "../types/specialist_form"; export * from "../types/diagnosis_type"; +export * from "../types/notification_priority"; diff --git a/src/types/notification_priority.ts b/src/types/notification_priority.ts new file mode 100644 index 0000000..89a29a2 --- /dev/null +++ b/src/types/notification_priority.ts @@ -0,0 +1,7 @@ +/** + * Priority for notifications. + */ +export enum NotificationPriority { + NORMAL = "normal", + HIGH = "high", +}