update readme

This commit is contained in:
2025-05-26 10:14:00 -03:00
parent e52d009cc6
commit ffca5c22c7
4 changed files with 18 additions and 29 deletions

View File

@@ -41,6 +41,9 @@ class LifecycleEvents(str, Enum):
# Archive the course after the certificate expires
COURSE_ARCHIVED = 'schedules#course_archived'
# When the access period ends for a course without a certificate
COURSE_EXPIRED = 'schedules#course_expired'
def enroll(
enrollment: Enrollment,
@@ -95,6 +98,18 @@ def enroll(
},
)
transact.put(
item={
'id': enrollment.id,
'sk': LifecycleEvents.COURSE_EXPIRED,
'name': user.name,
'email': user.email,
'course': course.name,
'create_date': now_,
'ttl': ttl(start_dt=now_ + timedelta(days=course.access_period)),
},
)
return persistence_layer.transact_write_items(transact)