add lookup

This commit is contained in:
2025-12-01 22:27:14 -03:00
parent f3e3d9f8c2
commit 8eb5427af4
22 changed files with 548 additions and 133 deletions

View File

@@ -28,9 +28,7 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
subscription = enrollment_layer.collection.get_items(
TransactKey(enrollment_id)
+ SortKey('METADATA#SUBSCRIPTION_COVERED')
# Post-migration: uncomment the following line
# + SortKey('CANCELED', path_spec='canceled_by', rename_key='canceled_by')
+ SortKey('CANCELED', path_spec='author', rename_key='canceled_by')
+ SortKey('CANCELED', path_spec='canceled_by', rename_key='canceled_by')
)
created_at: datetime = fromisoformat(new_image['created_at']) # type: ignore
@@ -67,7 +65,7 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
'created_at': now_,
}
| pick(('user', 'course', 'enrolled_at'), old_enrollment)
# Add created_by if present
# Add `created_by` if present
| ({'author': canceled_by} if canceled_by else {}),
# Post-migration: uncomment the following line
# | ({'created_by': canceled_by} if canceled_by else {}),