Перейти к содержанию

confirmed_orders

draw_up_order async

draw_up_order(
    order: ConfirmedOrderUpdateModel,
    order_id: PydanticObjectIdPath,
    user=Depends(
        get_active_user([SotransRole.carrier_logistician])
    ),
) -> OrderDBModel

Restricted carrier by organization_id, by confirmation_end_time, by id

Source code in api/endpoints/orders/confirmed_orders.py
73
74
75
76
77
78
79
80
81
82
83
84
@confirmed_orders_router.put(
    "/{order_id}/to-unverified",
    response_model_exclude_unset=True,
    responses={404: {"model": ErrorRepr}},
)
async def draw_up_order(
    order: ConfirmedOrderUpdateModel,
    order_id: PydanticObjectIdPath,
    user=Depends(get_active_user([SotransRole.carrier_logistician])),
) -> OrderDBModel:
    """Restricted carrier by organization_id, by confirmation_end_time, by id"""
    return await on_draw_up_order(order_id, user, order)

put_order_to_active async

put_order_to_active(
    order_ids: str,
    user: Annotated[
        SotransOIDCUserModel,
        Depends(
            get_current_user(
                required_role_names=[company_logistician]
            )
        ),
    ],
    order: OrderUpdateModel | None = None,
) -> MultiselectError

Throws Not Found on wrong subsidiary/employee, another than unverified status. Accepts end_price and assigned(both are optional).

Source code in api/endpoints/orders/confirmed_orders.py
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
@confirmed_orders_router.put("/{order_ids}/to-active")
async def put_order_to_active(
    order_ids: str,
    user: Annotated[
        SotransOIDCUserModel,
        Depends(
            idp.get_current_user(
                required_role_names=[SotransRole.company_logistician]
            )
        ),
    ],
    order: OrderUpdateModel | None = None,
) -> MultiselectError:
    """
    Throws Not Found on wrong subsidiary/employee, another than unverified status.
    Accepts end_price and assigned(both are optional).
    """
    return await multiexec(order_ids, on_put_to_active, user, order)

put_order_to_auction async

put_order_to_auction(
    order_ids: str,
    user: Annotated[
        SotransOIDCUserModel,
        Depends(
            get_current_user(
                required_role_names=[company_logistician]
            )
        ),
    ],
    order: OrderUpdateModel,
) -> MultiselectError

Accepts start_price(required), assigned(optional) and auction_end_time(optional).

Source code in api/endpoints/orders/confirmed_orders.py
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
@confirmed_orders_router.put("/{order_ids}/to-exchange")
async def put_order_to_auction(
    order_ids: str,
    user: Annotated[
        SotransOIDCUserModel,
        Depends(
            idp.get_current_user(
                required_role_names=[SotransRole.company_logistician]
            )
        ),
    ],
    order: OrderUpdateModel,
) -> MultiselectError:
    """Accepts start_price(required), assigned(optional) and auction_end_time(optional)."""
    return await multiexec(order_ids, on_put_back_to_auc, user, order)