From f7ad36bef8c17e0a47db29be5e58bdc4aeb072bb Mon Sep 17 00:00:00 2001 From: YuehuCao Date: Fri, 25 Jul 2025 18:57:53 +0800 Subject: [PATCH] feat(template): define MongoDB schema for message templates and email senders --- apps/notification/backend/models/models.py | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/apps/notification/backend/models/models.py b/apps/notification/backend/models/models.py index e69de29..5d55cba 100644 --- a/apps/notification/backend/models/models.py +++ b/apps/notification/backend/models/models.py @@ -0,0 +1,26 @@ +from beanie import Document +from datetime import datetime +from typing import Optional + +from common.constants.region import UserRegion + +class MessageTemplateDoc(Document): + template_id: str + tenant_id: Optional[str] = None + region: UserRegion + subject: str + body: str + is_active: bool = True + created_at: datetime = datetime.utcnow() + updated_at: Optional[datetime] = None + + class Settings: + name = "message_templates_doc" + +class EmailSenderDoc(Document): + tenant_id: str + email_senders: list[str] = [] + is_active: bool = True + + class Settings: + name = "email_sender_doc" \ No newline at end of file