feat(repairs): automatic repair status emails
This commit is contained in:
parent
3ed6596bf0
commit
c58e212e3a
21 changed files with 525 additions and 36 deletions
|
|
@ -13,6 +13,7 @@ from app.schemas.repair import (
|
|||
RepairCreate,
|
||||
RepairIntakePayload,
|
||||
RepairIntakeResponse,
|
||||
RepairNotificationEventResponse,
|
||||
RepairListResponse,
|
||||
RepairNotificationOverviewResponse,
|
||||
RepairPublicLinkCreateResponse,
|
||||
|
|
@ -171,6 +172,17 @@ def get_repair_notifications(
|
|||
return RepairNotificationService.overview(db, db_repair)
|
||||
|
||||
|
||||
@router.post("/repairs/{repair_id}/send-status-mail", response_model=RepairNotificationEventResponse)
|
||||
def send_repair_status_mail(
|
||||
repair_id: int,
|
||||
request: Request,
|
||||
db: Session = Depends(get_db),
|
||||
current_user: User = Depends(require_permission("repairs.update")),
|
||||
):
|
||||
db_repair = get_repair_or_404(db, repair_id)
|
||||
return RepairNotificationService.send_status_mail(db, db_repair, actor=current_user, request=request, manual=True)
|
||||
|
||||
|
||||
@router.post("/public/repair-intake", response_model=RepairIntakeResponse, status_code=status.HTTP_201_CREATED)
|
||||
def create_repair_intake(
|
||||
payload: RepairIntakePayload,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue