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:
1 parent
388eb8cc7e
commit
d8df5c47e2
2 files changed
+55
-4
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user