add purge to canceled and failed enrollment

This commit is contained in:
2026-01-22 12:17:54 -03:00
parent a01e4329f0
commit 5fac7888a8
11 changed files with 129 additions and 108 deletions

View File

@@ -30,6 +30,7 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
offset_days = old_image.get('dedup_window_offset_days')
billing_day = old_image.get('subscription_billing_day')
created_by = old_image.get('created_by')
seat = old_image.get('seat')
enrollment = Enrollment(
course=old_image['course'],
user=old_image['user'],
@@ -53,6 +54,7 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
subscription=subscription,
cancel_policy=bool(subscription),
created_by=created_by,
seat=seat,
scheduled_at=datetime.fromisoformat(old_image['scheduled_at']),
# Transfer the deduplication window if it exists
deduplication_window={'offset_days': offset_days} if offset_days else None,