30 lines
669 B
Python
30 lines
669 B
Python
from aws_lambda_powertools.event_handler.api_gateway import Router
|
|
from layercake.dynamodb import (
|
|
DynamoDBPersistenceLayer,
|
|
SortKey,
|
|
TransactKey,
|
|
)
|
|
|
|
from boto3clients import dynamodb_client
|
|
from config import ORDER_TABLE
|
|
|
|
from .checkout import router as checkout
|
|
|
|
__all__ = ['checkout']
|
|
|
|
router = Router()
|
|
dyn = DynamoDBPersistenceLayer(ORDER_TABLE, dynamodb_client)
|
|
|
|
|
|
@router.get('/<order_id>')
|
|
def get_order(order_id: str):
|
|
return dyn.collection.get_items(
|
|
TransactKey(order_id)
|
|
+ SortKey('0')
|
|
+ SortKey('ITEMS')
|
|
+ SortKey('ADDRESS')
|
|
+ SortKey('PIX')
|
|
+ SortKey('NFSE')
|
|
+ SortKey('FEE'),
|
|
)
|