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

exchange_orders

confirm_order async

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

Accepts carrier(optional) and assigned(optional).

Source code in api/endpoints/orders/exchange_orders.py
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
@exchange_orders_router.put("/{order_ids}/to-confirmed")
async def confirm_order(
    order_ids: str,
    user: Annotated[
        SotransOIDCUserModel,
        Depends(
            idp.get_current_user(
                required_role_names=[SotransRole.company_logistician]
            )
        ),
    ],
    order: OrderUpdateModel | None = None,
) -> MultiselectError:
    """Accepts carrier(optional) and assigned(optional)."""
    return await multiexec(order_ids, on_confirm_order, user, order)

get_exchange async

get_exchange(
    user=Depends(
        get_active_user(
            [SotransRole.carrier_logistician],
            company_security_verification=None,
        )
    ),
    params: BaseGetListQueryParams = Depends(),
) -> GenericGetListResponse[OrderDBModel]

For any status starting with 'exchange' for CompLogistician

Source code in api/endpoints/orders/exchange_orders.py
120
121
122
123
124
125
126
127
128
129
130
131
@exchange_orders_router.get("")
async def get_exchange(
    user=Depends(
        get_active_user(
            [SotransRole.carrier_logistician],
            company_security_verification=None,
        )
    ),
    params: BaseGetListQueryParams = Depends(),
) -> GenericGetListResponse[OrderDBModel]:
    """For any status starting with 'exchange' for CompLogistician"""
    return await on_get_exchange(user, params)

get_exchange_bids async

get_exchange_bids(
    user=Depends(
        get_active_user(
            [SotransRole.carrier_logistician],
            company_security_verification=None,
        )
    ),
    params: BaseGetListQueryParams = Depends(),
) -> GenericGetListResponse[OrderDBModel]

For any status starting with 'exchange' for CompLogistician

Source code in api/endpoints/orders/exchange_orders.py
134
135
136
137
138
139
140
141
142
143
144
145
@exchange_orders_router.get("/my-bids")
async def get_exchange_bids(
    user=Depends(
        get_active_user(
            [SotransRole.carrier_logistician],
            company_security_verification=None,
        )
    ),
    params: BaseGetListQueryParams = Depends(),
) -> GenericGetListResponse[OrderDBModel]:
    """For any status starting with 'exchange' for CompLogistician"""
    return await on_get_my_bids(user, params)

get_exchange_order_by_id async

get_exchange_order_by_id(
    order_id: PydanticObjectIdPath,
    user=Depends(
        get_active_user(
            [
                SotransRole.carrier_logistician,
                SotransRole.bid_service,
            ]
        )
    ),
    params: BaseGetOneQueryParams = Depends(),
) -> OrderDBModel

For any status starting with 'exchange' in exchange collection

Source code in api/endpoints/orders/exchange_orders.py
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
@exchange_orders_router.get(
    "/{order_id}",
    responses={404: {"model": ErrorRepr}},
    response_model_exclude_unset=True,
)
async def get_exchange_order_by_id(
    order_id: PydanticObjectIdPath,
    user=Depends(
        get_active_user(
            [SotransRole.carrier_logistician, SotransRole.bid_service]
        )
    ),
    params: BaseGetOneQueryParams = Depends(),
) -> OrderDBModel:
    """For any status starting with 'exchange' in exchange collection"""
    return await on_get_exchange_order_by_id(user, order_id, params)