wip reporting

This commit is contained in:
2025-07-25 11:20:01 -03:00
parent 57cee90187
commit 5eae098098
15 changed files with 269 additions and 213 deletions

View File

@@ -0,0 +1,30 @@
from aws_lambda_powertools.utilities.typing import LambdaContext
from layercake.dynamodb import DynamoDBPersistenceLayer, PartitionKey
import events.reporting.add_item as app
def test_add_item(
dynamodb_seeds,
dynamodb_persistence_layer: DynamoDBPersistenceLayer,
lambda_context: LambdaContext,
):
event = {
'detail': {
'new_image': {
'id': '945e8672-1d72-45c6-b76c-ac06aa8b52ab',
'sk': 'METADATA#BILLING_TERMS',
'billing_day': 5,
'created_at': '2025-07-23T18:09:22.785678-03:00',
'org_id': 'edp8njvgQuzNkLx2ySNfAD',
}
}
}
assert app.lambda_handler(event, lambda_context) # type: ignore
r = dynamodb_persistence_layer.collection.query(
PartitionKey('BILLING#ORG#edp8njvgQuzNkLx2ySNfAD')
)
print(r)