feat(api): allow withdraw of in-approval vehicle recharge applies

Applicants can return an in-approval apply to draft while keeping prior approval rows.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zlwuandCursor committed 2026-09-29 12:08:48 +08:00
1 parent 388eb8cc7e
commit d8df5c47e2
2 files changed
+55 -4

No files matched your search

+13
View File
@@ -336,6 +336,19 @@ def cancel_apply(
return svc.cancel_apply(db, tenant_no, user, id, mine_vehicles=mine_vehicles)
@apply_router.post("/{id}/withdraw", response_model=VehicleRechargeApplyRead)
def withdraw_apply(
id: str,
mine_vehicles: bool = Query(default=False, alias="mineVehicles"),
db: Session = Depends(get_db),
user: DbUserContext = Depends(get_db_current_user),
) -> VehicleRechargeApplyRead:
tenant_no = get_tenant_no(db, user.to_tenant_user_dict())
return svc.withdraw_apply(
db, tenant_no, user, id, mine_vehicles=mine_vehicles
)
@apply_router.delete("/{ids}", status_code=status.HTTP_204_NO_CONTENT)
def delete_applies(
ids: str,