add billing

This commit is contained in:
2025-12-12 09:48:08 -03:00
parent 979ef22126
commit 3954b148fe
4 changed files with 18 additions and 3 deletions

View File

@@ -24,6 +24,7 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
*_, org_id = old_image['id'].split('#')
offset_days = old_image.get('dedup_window_offset_days')
billing_day = old_image.get('subscription_billing_day')
created_by = old_image.get('created_by')
enrollment = Enrollment(
course=old_image['course'],
user=old_image['user'],
@@ -43,6 +44,7 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
if billing_day
else None
),
created_by=created_by,
scheduled_at=datetime.fromisoformat(old_image['created_at']),
# Transfer the deduplication window if it exists
deduplication_window={'offset_days': offset_days} if offset_days else None,