add cancel schedule
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user