add billing
This commit is contained in:
27
api.saladeaula.digital/app/routes/orgs/billing.py
Normal file
27
api.saladeaula.digital/app/routes/orgs/billing.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 Query
|
||||||
|
from layercake.dynamodb import DynamoDBPersistenceLayer, KeyPair
|
||||||
|
|
||||||
|
from boto3clients import dynamodb_client
|
||||||
|
from config import COURSE_TABLE
|
||||||
|
|
||||||
|
router = Router()
|
||||||
|
dyn = DynamoDBPersistenceLayer(COURSE_TABLE, dynamodb_client)
|
||||||
|
|
||||||
|
|
||||||
|
@router.get('/<org_id>/billing')
|
||||||
|
def get_custom_pricing(
|
||||||
|
org_id: str,
|
||||||
|
start_date: Annotated[date, Query()],
|
||||||
|
end_date: Annotated[date, Query()],
|
||||||
|
):
|
||||||
|
return dyn.collection.query(
|
||||||
|
KeyPair(
|
||||||
|
pk=f'BILLING#ORG#{org_id}',
|
||||||
|
sk=f'START#{start_date}#END#{end_date}',
|
||||||
|
),
|
||||||
|
limit=150,
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user