wip checkout
This commit is contained in:
@@ -20,6 +20,7 @@ dyn = DynamoDBPersistenceLayer(ENROLLMENT_TABLE, dynamodb_client)
|
||||
@logger.inject_lambda_context
|
||||
def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
|
||||
new_image = event.detail['new_image']
|
||||
# Copy metadata from the failed enrollment for reuse in the new enrollment
|
||||
metadata = dyn.collection.get_items(
|
||||
TransactKey(new_image['id'])
|
||||
+ SortKey(
|
||||
@@ -51,7 +52,7 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
|
||||
enrollment,
|
||||
org=metadata.get('org', None),
|
||||
subscription=subscription,
|
||||
# Transfer the deduplication window if it exists
|
||||
# Reuse the deduplication window if it exists
|
||||
deduplication_window={'offset_days': offset_days} if offset_days else None,
|
||||
linked_entities=frozenset(
|
||||
{
|
||||
|
||||
@@ -261,6 +261,31 @@ Resources:
|
||||
scope: [MULTI_USER]
|
||||
status: [PENDING]
|
||||
|
||||
EventAllocateSeatsFunction:
|
||||
Type: AWS::Serverless::Function
|
||||
Properties:
|
||||
Handler: events.allocate_seats.lambda_handler
|
||||
LoggingConfig:
|
||||
LogGroup: !Ref EventLog
|
||||
Policies:
|
||||
- DynamoDBCrudPolicy:
|
||||
TableName: !Ref OrderTable
|
||||
- DynamoDBCrudPolicy:
|
||||
TableName: !Ref EnrollmentTable
|
||||
- DynamoDBReadPolicy:
|
||||
TableName: !Ref CourseTable
|
||||
Events:
|
||||
DynamoDBEvent:
|
||||
Type: EventBridgeRule
|
||||
Properties:
|
||||
Pattern:
|
||||
resources: [!Ref OrderTable]
|
||||
detail-type: [INSERT]
|
||||
detail:
|
||||
new_image:
|
||||
sk: [SEATS_ALLOCATION]
|
||||
status: [PENDING]
|
||||
|
||||
SesPolicy:
|
||||
Type: AWS::IAM::ManagedPolicy
|
||||
Properties:
|
||||
|
||||
Reference in New Issue
Block a user