feat(settings): add SMTP admin configuration

This commit is contained in:
Schubert Ferenc 2026-07-04 23:54:20 +02:00
parent c58e212e3a
commit 884a20e043
32 changed files with 1200 additions and 42 deletions

View file

@ -343,6 +343,17 @@ class RepairRepository:
.where(RepairNotificationEvent.status.in_(["failed", "skipped"]))
) or 0
@staticmethod
def latest_failed_status_mail(db: Session) -> RepairNotificationEvent | None:
return db.scalar(
select(RepairNotificationEvent)
.where(RepairNotificationEvent.event_type == "repair_status_mail")
.where(RepairNotificationEvent.success.is_(False))
.where(RepairNotificationEvent.status.in_(["failed", "skipped"]))
.order_by(RepairNotificationEvent.created_at.desc(), RepairNotificationEvent.id.desc())
.limit(1)
)
@staticmethod
def count_open_repairs_without_customer_email(db: Session) -> int:
return db.scalar(