fix billing
This commit is contained in:
@@ -59,7 +59,7 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
|
||||
if old_course:
|
||||
enrollment['course'] = old_course
|
||||
|
||||
created_at: datetime = fromisoformat(enrollment['create_date']) # type: ignore
|
||||
created_at: datetime = fromisoformat(enrollment['created_at']) # type: ignore
|
||||
start_date, end_date = get_billing_period(
|
||||
billing_day=new_image['billing_day'],
|
||||
date_=created_at,
|
||||
@@ -122,9 +122,7 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
|
||||
'user': pick(('id', 'name'), enrollment['user']),
|
||||
'course': pick(('id', 'name'), enrollment['course']),
|
||||
'unit_price': course['unit_price'],
|
||||
# Post-migration: uncomment the following line
|
||||
# 'enrolled_at': enrollment['created_at'],
|
||||
'enrolled_at': enrollment['create_date'],
|
||||
'enrolled_at': enrollment['created_at'],
|
||||
'created_at': now_,
|
||||
}
|
||||
# Add author if present
|
||||
|
||||
@@ -33,7 +33,7 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
|
||||
+ SortKey('canceled', path_spec='author', rename_key='canceled_by')
|
||||
)
|
||||
|
||||
created_at: datetime = fromisoformat(new_image['create_date']) # type: ignore
|
||||
created_at: datetime = fromisoformat(new_image['created_at']) # type: ignore
|
||||
start_date, end_date = get_billing_period(
|
||||
billing_day=int(subscription['billing_day']),
|
||||
date_=created_at,
|
||||
|
||||
Reference in New Issue
Block a user