Notify moderators about service center applications

This commit is contained in:
VPN SaaS Dev
2026-05-15 04:45:54 +09:00
parent c0014ab4ea
commit 85b46a94b9
4 changed files with 65 additions and 17 deletions

View File

@@ -46,6 +46,7 @@ from app.schemas.service_center import (
VehicleSearchRequest,
VehicleSearchResult,
)
from app.services.notifications import notify_platform_moderators
from app.services.odometer import validate_odometer_change
from app.services.vehicle_identity import mask_license_plate, mask_vin
@@ -101,9 +102,19 @@ async def create_service_center(
status="active",
)
session.add(employee)
await log_audit(session, actor=current_user, action="service_center.create", target_type="service_center", target_id=center.id)
await log_audit(
session,
actor=current_user,
action="service_center.create",
target_type="service_center",
target_id=center.id,
)
await session.commit()
await session.refresh(center)
await notify_platform_moderators(
session,
f"Новая заявка СТО #{center.id}: {center.display_name or center.name}. Откройте /admin_sto_pending для модерации.",
)
return center