wip reporting

This commit is contained in:
2025-07-25 11:20:01 -03:00
parent 57cee90187
commit 5eae098098
15 changed files with 269 additions and 213 deletions

View File

@@ -42,6 +42,30 @@ Resources:
Properties:
RetentionInDays: 90
EventReportingAddItemFunction:
Type: AWS::Serverless::Function
Properties:
Handler: events.reporting.add_item.lambda_handler
LoggingConfig:
LogGroup: !Ref EventLog
Policies:
- DynamoDBCrudPolicy:
TableName: !Ref OrderTable
- DynamoDBReadPolicy:
TableName: !Ref EnrollmentTable
- DynamoDBReadPolicy:
TableName: !Ref CourseTable
Events:
Event:
Type: EventBridgeRule
Properties:
Pattern:
resources: [!Ref EnrollmentTable]
detail-type: [INSERT]
detail:
new_image:
sk: ["METADATA#BILLING_TERMS"]
EventAppendOrgIdFunction:
Type: AWS::Serverless::Function
Properties:
@@ -120,7 +144,7 @@ Resources:
- exists: true
status: [CANCELED, EXPIRED]
EventSetAsPaidFunction:
EventStopgapSetAsPaidFunction:
Type: AWS::Serverless::Function
Properties:
Handler: events.stopgap.set_as_paid.lambda_handler
@@ -145,50 +169,7 @@ Resources:
status: [CREATING, PENDING]
payment_method: [MANUAL]
EventSetAsExpiredFunction:
Type: AWS::Serverless::Function
Properties:
Handler: events.set_as_expired.lambda_handler
LoggingConfig:
LogGroup: !Ref EventLog
Policies:
- DynamoDBWritePolicy:
TableName: !Ref OrderTable
Events:
Event:
Type: EventBridgeRule
Properties:
Pattern:
resources: [!Ref OrderTable]
detail-type: [EXPIRE]
detail:
new_image:
sk: [schedules#set_as_expired]
EventScheduleExpiredFunction:
Type: AWS::Serverless::Function
Properties:
Handler: events.stopgap.schedule_expired.lambda_handler
LoggingConfig:
LogGroup: !Ref EventLog
Policies:
- DynamoDBWritePolicy:
TableName: !Ref OrderTable
Events:
Event:
Type: EventBridgeRule
Properties:
Pattern:
resources: [!Ref OrderTable]
detail-type: [INSERT]
detail:
new_image:
sk: ["0"]
payment_method: [MANUAL]
due_date:
- exists: true
EventRemoveSlotsFunction:
EventStopgapRemoveSlotsFunction:
Type: AWS::Serverless::Function
Properties:
Handler: events.stopgap.remove_slots.lambda_handler