close bolling
This commit is contained in:
@@ -6,7 +6,7 @@ from aws_lambda_powertools.utilities.data_classes import (
|
||||
event_source,
|
||||
)
|
||||
from aws_lambda_powertools.utilities.typing import LambdaContext
|
||||
from layercake.dateutils import now, ttl
|
||||
from layercake.dateutils import fromisoformat, now, ttl
|
||||
from layercake.dynamodb import (
|
||||
DynamoDBPersistenceLayer,
|
||||
KeyPair,
|
||||
@@ -35,12 +35,17 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
|
||||
data = enrollment_layer.collection.get_items(
|
||||
TransactKey(enrollment_id) + SortKey('0') + SortKey('author')
|
||||
)
|
||||
created_at: datetime = fromisoformat(data['create_date']) # type: ignore
|
||||
|
||||
if not data:
|
||||
logger.debug('Enrollment not found')
|
||||
return False
|
||||
|
||||
start_date, end_date = get_billing_period(new_image['billing_day'])
|
||||
start_date, end_date = get_billing_period(
|
||||
new_image['billing_day'],
|
||||
year=created_at.year,
|
||||
month=created_at.month,
|
||||
)
|
||||
pk = 'BILLING#ORG#{org_id}'.format(org_id=org_id)
|
||||
sk = 'START#{start}#END#{end}'.format(
|
||||
start=start_date.isoformat(),
|
||||
|
||||
Reference in New Issue
Block a user