Work on order endpoint and related methods.

This commit is contained in:
Scott Idem
2021-11-19 15:59:35 -05:00
parent f1580dbfe7
commit e805e69dc7
2 changed files with 17 additions and 15 deletions

View File

@@ -224,9 +224,9 @@ async def get_obj_id_order_list(
status: str = 'closed', # open, locked, reopened?, closed (complete), canceled, other
enabled: str = 'enabled',
limit: int = 50,
x_account_id: str = Header(..., min_length=11, max_length=22),
by_alias: Optional[bool] = True,
exclude_unset: Optional[bool] = True,
x_account_id: str = Header(..., min_length=11, max_length=22),
response: Response = Response,
):
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
@@ -239,27 +239,27 @@ async def get_obj_id_order_list(
log.warning('Likely bad request')
return mk_resp(data=False, status_code=400, response=response) # Bad Request
# Updated 2021-06-28
# Updated 2021-11-19
if order_rec_list_result := get_order_rec_list(
for_obj_type = obj_type,
for_obj_id = obj_id,
limit = limit,
enabled = enabled,
from_datetime = from_datetime,
to_datetime = to_datetime,
status = status,
enabled = enabled,
limit = limit,
):
order_result_list = []
for order_rec in order_rec_list_result:
if load_order_result := load_order_obj(
order_id = order_rec.get('order_id', None),
limit = limit,
inc_order_cfg = inc_order_cfg,
inc_order_line_list = inc_order_line_list,
enabled = enabled,
limit = limit,
by_alias = by_alias,
exclude_unset = exclude_unset,
# model_as_dict = model_as_dict,
inc_order_cfg = inc_order_cfg,
inc_order_line_list = inc_order_line_list,
):
order_result_list.append(load_order_result)
else: