delete option staff varizi

This commit is contained in:
javad committed 2026-10-06 12:30:28 +03:30
1 parent d99e47ecce
commit b53a3e0c5c
14 files changed
+383 -3

No files matched your search

@@ -72,6 +72,18 @@ def _bale_ticket_text(ticket, message=None, *, is_reply=False, message_count=1,
lines.extend([f"🕒 {jalali}", "", f"📝 {excerpt}", "", "🔗 مشاهده و پاسخ", f"{settings.PUBLIC_BASE_URL}/staff/tickets/{ticket.public_id}/"])
return "\n".join(lines)
def _prepare_sms(job):
if job.event_type == 'STAFF_REPLY':
return _prepare_staff_reply_sms(job)
if job.event_type == 'PAYMENT_NOTICE_CREATED' and NotificationJob.objects.filter(
pk=job.pk, payment_notification__notice__deleted_at__isnull=False).exists():
job.status = NotificationJob.Status.CANCELLED
job.last_error = 'اعلامیه واریز حذف شده است.'
job.save(update_fields=['status', 'last_error'])
return False
return True
def _send_sms(job):
if job.event_type in {"PAYMENT_NOTICE_CREATED", "PAYMENT_RECEIPT_APPROVED"}:
from apps.payments.notifications import send_payment_sms
@@ -337,7 +349,7 @@ class Command(BaseCommand):
for job in jobs:
issued_link = None
try:
if job.channel == NotificationJob.Channel.SMS and job.event_type == "STAFF_REPLY" and not _prepare_staff_reply_sms(job):
if job.channel == NotificationJob.Channel.SMS and not _prepare_sms(job):
continue
if job.channel == NotificationJob.Channel.BALE and job.event_type == "CUSTOMER_TICKET_REPLY" and not _prepare_customer_reply_bale(job):
continue