add user id to order

This commit is contained in:
2025-07-23 01:05:21 -03:00
parent 896e0f1054
commit edecbce356
7 changed files with 41 additions and 113 deletions

View File

@@ -42,10 +42,10 @@ Resources:
Properties:
RetentionInDays: 90
EventAssignTenantCnpjFunction:
EventAssignOrgIdFunction:
Type: AWS::Serverless::Function
Properties:
Handler: events.assign_tenant_cnpj.lambda_handler
Handler: events.assign_org_id.lambda_handler
LoggingConfig:
LogGroup: !Ref EventLog
Policies:
@@ -65,7 +65,34 @@ Resources:
sk: ["0"]
cnpj:
- exists: true
metadata__tenant_id:
# Post-migration: rename `tenant_id` to `org_id`
tenant_id:
- exists: false
EventAssignUserIdFunction:
Type: AWS::Serverless::Function
Properties:
Handler: events.assign_user_id.lambda_handler
LoggingConfig:
LogGroup: !Ref EventLog
Policies:
- DynamoDBCrudPolicy:
TableName: !Ref UserTable
- DynamoDBCrudPolicy:
TableName: !Ref OrderTable
Events:
Event:
Type: EventBridgeRule
Properties:
Pattern:
resources: [!Ref OrderTable]
detail-type: [INSERT]
detail:
new_image:
sk: ["0"]
cpf:
- exists: true
user_id:
- exists: false
EventRemoveSlotsIfCanceledFunction: