Files
saladeaula.digital/api.saladeaula.digital/app/routes/orders/__init__.py
2026-01-09 11:20:56 -03:00

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'),
)