add missing file
This commit is contained in:
27
http-api/app/routes/billing/__init__.py
Normal file
27
http-api/app/routes/billing/__init__.py
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
from datetime import date
|
||||||
|
from typing import Annotated
|
||||||
|
|
||||||
|
from aws_lambda_powertools.event_handler.api_gateway import Router
|
||||||
|
from aws_lambda_powertools.event_handler.openapi.params import Path, Query
|
||||||
|
from layercake.dynamodb import DynamoDBPersistenceLayer, KeyPair
|
||||||
|
|
||||||
|
from boto3clients import dynamodb_client
|
||||||
|
from config import ORDER_TABLE
|
||||||
|
|
||||||
|
router = Router()
|
||||||
|
order_layer = DynamoDBPersistenceLayer(ORDER_TABLE, dynamodb_client)
|
||||||
|
|
||||||
|
|
||||||
|
@router.get('/<id>', compress=True, tags=['Billing'])
|
||||||
|
def get_billing(
|
||||||
|
id: Annotated[str, Path()],
|
||||||
|
start_date: Annotated[date, Query()],
|
||||||
|
end_date: Annotated[date, Query()],
|
||||||
|
):
|
||||||
|
result = order_layer.collection.query(
|
||||||
|
KeyPair(
|
||||||
|
pk=f'BILLING#ORG#{id}',
|
||||||
|
sk=f'START#{start_date}#END#{end_date}',
|
||||||
|
)
|
||||||
|
)
|
||||||
|
return result
|
||||||
Reference in New Issue
Block a user