add events

This commit is contained in:
2025-08-21 22:18:37 -03:00
parent c70a74b94a
commit 3ab20c485b
19 changed files with 315 additions and 164 deletions

View File

@@ -34,7 +34,7 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
order = order_layer.collection.get_items(
TransactKey(order_id) + SortKey('0') + SortKey('items', path_spec='items'),
)
tenant_id = order['tenant_id']
org_id = order['tenant_id']
items = {
item['id']: int(item['quantity'])
for item in order['items']
@@ -51,10 +51,10 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
for slot in slots:
transact.put(
item={
'id': f'vacancies#{tenant_id}',
'id': f'vacancies#{org_id}',
'sk': f'{order_id}#{uuid4()}',
# Post-migration: uncomment the follow lines
# 'id': f'SLOT#ORG#{tenant_id}',
# 'id': f'SLOT#ORG#{org_id}',
# 'sk': f'ORDER#{order_id}#ENROLLMENT#{uuid4()}',
'course': asdict(slot),
'created_at': now_,