add enroll to subscribed

This commit is contained in:
2025-12-08 16:48:31 -03:00
parent 1ff2634bc0
commit 93d96486ff
11 changed files with 148 additions and 108 deletions

View File

@@ -40,8 +40,8 @@ class DeduplicationConflictError(ConflictError): ...
class User(BaseModel):
id: str | UUID4
name: NameStr
cpf: CpfStr
email: EmailStr
cpf: CpfStr
class Course(BaseModel):
@@ -123,9 +123,9 @@ def enroll(
Context = TypedDict(
'Context',
{
'created_by': Authenticated,
'org': Org,
'terms': SubscriptionTerms,
'created_by': Authenticated,
},
)
@@ -251,14 +251,12 @@ def enroll_later(enrollment: Enrollment, context: Context):
'sk': f'{scheduled_for.isoformat()}#{lock_hash}',
'user': user.model_dump(),
'course': course.model_dump(),
'org': org.model_dump(),
'org_name': org.name,
'created_by': {
'id': created_by.id,
'name': created_by.name,
},
'subscription_covered': {
'billing_day': subscription_terms.billing_day,
},
'subscription_billing_day': subscription_terms.billing_day,
'ttl': ttl(start_dt=scheduled_for),
'created_at': now_,
}