add cancel schedule

This commit is contained in:
2025-12-15 16:38:40 -03:00
parent 2774545d09
commit 62b5340b20
11 changed files with 238 additions and 85 deletions

View File

@@ -32,17 +32,17 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
)
created_at: datetime = fromisoformat(new_image['created_at']) # type: ignore
start_date, end_date = get_billing_period(
start_period, end_period = get_billing_period(
billing_day=int(subscription['billing_day']),
date_=created_at,
)
pk = 'BILLING#ORG#{org_id}'.format(org_id=subscription['org_id'])
sk = 'START#{start}#END#{end}'.format(
start=start_date.isoformat(),
end=end_date.isoformat(),
start=start_period.isoformat(),
end=end_period.isoformat(),
)
if now_.date() > end_date:
if now_.date() > end_period:
logger.debug('Enrollment outside the billing period')
return False