Notify moderators about service center applications
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user