add payment_link and banks
This commit is contained in:
1 parent
2ae79b1ca4
commit
de3135b588
100 files changed
+6167
-47
No files matched your search
@@ -0,0 +1,31 @@
|
||||
# Generated by Django 5.1.1 on 2026-10-06 05:38
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
def align_template_tags(apps, schema_editor):
|
||||
template = apps.get_model('notifications', 'SMSTemplate')
|
||||
ticket_tags = ['magic_link', 'first_name', 'last_name', 'recipient_name', 'unit_name', 'company_name',
|
||||
'ticket_number', 'subject', 'province', 'city', 'expert_name', 'customer_mobile', 'category_name']
|
||||
payment_tags = ['recipient_name', 'company_name', 'notice_number', 'receipt_number', 'amount_rial', 'invoice_number', 'payment_link']
|
||||
for item in template.objects.all():
|
||||
tags = payment_tags if item.event_type in {'PAYMENT_NOTICE_CREATED', 'PAYMENT_RECEIPT_APPROVED'} else ticket_tags
|
||||
if item.event_type == 'UNIT_SUPERVISOR_NEW_TICKET':
|
||||
tags = [tag for tag in tags if tag != 'magic_link']
|
||||
template.objects.filter(pk=item.pk).update(allowed_tags=tags)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('notifications', '0017_alter_smstemplate_event_type'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='smstemplate',
|
||||
name='body',
|
||||
field=models.TextField(help_text='تگ\u200cها بر اساس رویداد مشخص\u200cاند: {magic_link} برای تیکت و {payment_link} برای پرداخت.'),
|
||||
),
|
||||
migrations.RunPython(align_template_tags, migrations.RunPython.noop),
|
||||
]
|
||||
Reference in new issue
Block a user