add billing
This commit is contained in:
@@ -6,14 +6,27 @@ 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
|
||||
from config import ORDER_TABLE, USER_TABLE
|
||||
|
||||
router = Router()
|
||||
dyn = DynamoDBPersistenceLayer(COURSE_TABLE, dynamodb_client)
|
||||
dyn = DynamoDBPersistenceLayer(ORDER_TABLE, dynamodb_client)
|
||||
|
||||
|
||||
@router.get('/<org_id>/subscription')
|
||||
def subscription(org_id: str):
|
||||
return dyn.collection.get_item(
|
||||
KeyPair(
|
||||
pk=org_id,
|
||||
sk='METADATA#SUBSCRIPTION',
|
||||
table_name=USER_TABLE,
|
||||
),
|
||||
raise_on_error=False,
|
||||
default={},
|
||||
)
|
||||
|
||||
|
||||
@router.get('/<org_id>/billing')
|
||||
def get_custom_pricing(
|
||||
def billing(
|
||||
org_id: str,
|
||||
start_date: Annotated[date, Query()],
|
||||
end_date: Annotated[date, Query()],
|
||||
|
||||
Reference in New Issue
Block a user