renamem orders
This commit is contained in:
@@ -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'),
|
||||
)
|
||||
# Post-migration: rename `tenant_id` to `org_id`
|
||||
# Post-migration (orders): rename `tenant_id` to `org_id`
|
||||
org_id = order['tenant_id']
|
||||
items = {
|
||||
item['id']: int(item['quantity'])
|
||||
@@ -54,7 +54,7 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
|
||||
item={
|
||||
'id': f'vacancies#{org_id}',
|
||||
'sk': f'{order_id}#{uuid4()}',
|
||||
# Post-migration: uncomment the follow lines
|
||||
# Post-migration (orders): uncomment the follow lines
|
||||
# 'id': f'SLOT#ORG#{org_id}',
|
||||
# 'sk': f'ORDER#{order_id}#ENROLLMENT#{uuid4()}',
|
||||
'course': asdict(slot),
|
||||
@@ -81,8 +81,6 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
|
||||
class Course:
|
||||
id: str
|
||||
name: str
|
||||
# Post-migration: remove the following line
|
||||
time_in_days: int
|
||||
|
||||
|
||||
def _get_courses(ids: set) -> tuple[Course, ...]:
|
||||
@@ -95,8 +93,6 @@ def _get_courses(ids: set) -> tuple[Course, ...]:
|
||||
Course(
|
||||
id=idx,
|
||||
name=obj['name'],
|
||||
# Post-migration: remove the following line
|
||||
time_in_days=int(obj['access_period']),
|
||||
)
|
||||
for idx, obj in result.items()
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user