wip checkout
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
from aws_lambda_powertools.event_handler.api_gateway import Router
|
||||
from aws_lambda_powertools.event_handler.exceptions import (
|
||||
NotFoundError,
|
||||
from layercake.dynamodb import (
|
||||
DynamoDBPersistenceLayer,
|
||||
SortKey,
|
||||
TransactKey,
|
||||
)
|
||||
from layercake.dynamodb import DynamoDBPersistenceLayer, KeyPair
|
||||
|
||||
from boto3clients import dynamodb_client
|
||||
from config import ORDER_TABLE
|
||||
@@ -17,7 +18,12 @@ dyn = DynamoDBPersistenceLayer(ORDER_TABLE, dynamodb_client)
|
||||
|
||||
@router.get('/<order_id>')
|
||||
def get_order(order_id: str):
|
||||
return dyn.collection.get_item(
|
||||
KeyPair(order_id, '0'),
|
||||
exc_cls=NotFoundError,
|
||||
return dyn.collection.get_items(
|
||||
TransactKey(order_id)
|
||||
+ SortKey('0')
|
||||
+ SortKey('ITEMS')
|
||||
+ SortKey('ADDRESS')
|
||||
+ SortKey('PIX')
|
||||
+ SortKey('NFSE')
|
||||
+ SortKey('FEE'),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user