Skip to content

Commit 6aceaf9

Browse files
committed
Merge remote-tracking branch 'origin/feature/add-editor-source-column-on-notification-template-models'
2 parents 28589ae + 2560cde commit 6aceaf9

3 files changed

Lines changed: 35 additions & 1 deletion

File tree

app/admin_api/serializers/notification.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,15 @@ class _NotiTemplateAdminSerializerBase(BaseAbstractSerializer, JsonSchemaSeriali
142142
template_variables = serializers.SerializerMethodField()
143143

144144
class Meta:
145-
fields = COMMON_ADMIN_FIELDS + ("code", "title", "description", "data", "sent_from", "template_variables")
145+
fields = COMMON_ADMIN_FIELDS + (
146+
"code",
147+
"title",
148+
"description",
149+
"data",
150+
"editor_source",
151+
"sent_from",
152+
"template_variables",
153+
)
146154

147155
def get_template_variables(self, obj: NotificationTemplateBase) -> list[str]:
148156
return sorted(obj.template_variables)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from django.db import migrations, models
2+
3+
4+
class Migration(migrations.Migration):
5+
dependencies = [("notification", "0002_emailnotificationhistorysentto_failure_reason_and_more")]
6+
operations = [
7+
migrations.AddField(
8+
model_name="emailnotificationtemplate",
9+
name="editor_source",
10+
field=models.TextField(blank=True, null=True),
11+
),
12+
migrations.AddField(
13+
model_name="nhncloudkakaoalimtalknotificationtemplate",
14+
name="editor_source",
15+
field=models.TextField(blank=True, null=True),
16+
),
17+
migrations.AddField(
18+
model_name="nhncloudsmsnotificationtemplate",
19+
name="editor_source",
20+
field=models.TextField(blank=True, null=True),
21+
),
22+
]

app/notification/models/base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ class NotificationTemplateBase(BaseAbstractModel):
5858
description = models.TextField(null=True, blank=True)
5959
data = models.TextField()
6060

61+
# 에디터(예: @react-email/renderer)가 다루는 source-of-truth.
62+
# 발송 경로는 data만 사용하며, 에디터가 저장 시점에 컴파일된 결과를 data에 기록.
63+
editor_source = models.TextField(null=True, blank=True)
64+
6165
# Email: from address, SMS: 발신번호, Kakao: sender key
6266
sent_from = models.CharField(max_length=256)
6367

0 commit comments

Comments
 (0)