wip reenroll

This commit is contained in:
2025-09-11 21:53:08 -03:00
parent ac07ee0101
commit e51964bc8b
13 changed files with 106 additions and 567 deletions

View File

@@ -18,7 +18,7 @@ from layercake.dynamodb import (
from boto3clients import dynamodb_client
from config import COURSE_TABLE, ENROLLMENT_TABLE, ORDER_TABLE
from enrollment import DeduplicationWindow, LinkedEntity, enroll
from enrollment import LinkedEntity, enroll
from schemas import Course, Enrollment, User
logger = Logger(__name__)
@@ -88,12 +88,8 @@ def _handler(record: Course, context: dict) -> Enrollment:
enroll(
enrollment,
persistence_layer=enrollment_layer,
deduplication_window=DeduplicationWindow(offset_days=90),
linked_entities=frozenset(
{
LinkedEntity(context['order_id'], 'ORDER'),
}
),
deduplication_window={'offset_days': 90},
linked_entities=frozenset({LinkedEntity(context['order_id'], 'ORDER')}),
)
return enrollment