Conversation
…ated process transaction function to use this
…ntinued processing
…count Signed-off-by: edinstance <edinstance@gmail.com>
…e monthly reports state machine Signed-off-by: edinstance <edinstance@gmail.com>
…th a dlq destination
Signed-off-by: edinstance <edinstance@gmail.com>
Signed-off-by: edinstance <edinstance@gmail.com>
Signed-off-by: edinstance <edinstance@gmail.com>
Signed-off-by: edinstance <edinstance@gmail.com>
Signed-off-by: edinstance <edinstance@gmail.com>
Signed-off-by: edinstance <edinstance@gmail.com>
Docstrings generation was requested by @edinstance. * #36 (comment) The following files were modified: * `functions/accounts/get_account_transactions/get_account_transactions/app.py` * `functions/accounts/get_account_transactions/get_account_transactions/date_helpers.py` * `functions/accounts/get_account_transactions/get_account_transactions/transaction_helpers.py` * `functions/monthly_reports/accounts/create_report/create_report/app.py` * `functions/monthly_reports/accounts/create_report/create_report/generate_pdf.py` * `functions/monthly_reports/accounts/notify_client/notify_client/app.py` * `functions/monthly_reports/accounts/notify_client/notify_client/date_helpers.py` * `functions/monthly_reports/accounts/notify_client/notify_client/processing.py` * `functions/monthly_reports/accounts/notify_client/notify_client/send_report.py` * `functions/monthly_reports/accounts/process_pending_reports/process_pending_reports/app.py` * `functions/monthly_reports/accounts/trigger/trigger/app.py` * `functions/transactions/process_transactions/process_transactions/app.py` * `functions/transactions/process_transactions/process_transactions/sqs.py` * `layers/python/authentication/authentication/user_details.py` * `layers/python/helpers/dynamodb.py` * `layers/python/helpers/s3.py` * `layers/python/helpers/ses.py` * `layers/python/helpers/sfn.py` * `layers/python/helpers/sqs.py` * `layers/python/monthly_reports/monthly_reports/helpers.py` * `layers/python/monthly_reports/monthly_reports/metrics.py` * `layers/python/monthly_reports/monthly_reports/processing.py` * `layers/python/monthly_reports/monthly_reports/responses.py` * `layers/python/monthly_reports/monthly_reports/sfn.py` * `layers/python/monthly_reports/monthly_reports/sqs.py` * `tests/conftest.py` * `tests/functions/accounts/get_account_transactions/conftest.py` * `tests/functions/accounts/get_account_transactions/test_app.py` * `tests/functions/accounts/get_account_transactions/test_date_helpers.py` * `tests/functions/monthly_reports/accounts/create_report/conftest.py` * `tests/functions/monthly_reports/accounts/create_report/test_app.py` * `tests/functions/monthly_reports/accounts/create_report/test_exceptions.py` * `tests/functions/monthly_reports/accounts/create_report/test_generate_pdf.py` * `tests/functions/monthly_reports/accounts/notify_client/conftest.py` * `tests/functions/monthly_reports/accounts/notify_client/test_app.py` * `tests/functions/monthly_reports/accounts/trigger_tests/conftest.py`
Signed-off-by: edinstance <edinstance@gmail.com>
Signed-off-by: edinstance <edinstance@gmail.com>
|
Caution Review failedThe pull request is closed. WalkthroughAdds a monthly account reports pipeline (State Machine, Lambdas, SQS queues, S3 bucket, layer utilities), a new GetAccountTransactions Lambda with HTTP and direct invocation paths, refactors transaction DLQ handling to generic SQS messaging, updates helper libraries (SES/S3/SFN/SQS/DynamoDB), bumps dependencies, and introduces extensive tests. Template gains SES_NO_REPLY_EMAIL and a DynamoDB GSI. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Cron as EventBridge (cron)
participant Trigger as Lambda: Trigger
participant DDB as DynamoDB: Accounts
participant SQS as SQS: Continuation
participant SFN as Step Functions: StateMachine
participant GAT as Lambda: GetAccountTransactions
participant CR as Lambda: CreateReport
participant NC as Lambda: NotifyClient
participant S3 as S3: MonthlyReportsBucket
participant SES as SES
participant Cognito as Cognito IdP
Cron->>Trigger: Invoke (monthly)
Trigger->>DDB: Scan (paged)
alt Has pages and time left
Trigger->>SFN: StartExecution per account
else Low remaining time
Trigger-->>SQS: Send continuation message
Trigger-->>Cron: Return TIMEOUT_CONTINUATION
end
par StateMachine execution
SFN->>GAT: Invoke (accountId, period)
GAT->>DDB: Query AccountDateIndex
SFN->>CR: Invoke (transactions, balance, period)
CR->>S3: PutObject (PDF)
CR->>S3: Get presigned URL
SFN->>NC: Invoke (accountId, userId, period)
NC->>Cognito: AdminGetUser (email/name)
NC->>S3: HeadObject (size)
alt Size <= threshold
NC->>S3: GetObject (PDF bytes)
NC->>SES: SendRawEmail (attachment)
else Large object
NC->>S3: Get presigned URL
NC->>SES: SendEmail (link)
end
and On error
SFN-->>SQS: Send to Creation DLQ
end
sequenceDiagram
autonumber
actor User as API Client
participant API as API Gateway
participant GAT as Lambda: GetAccountTransactions
participant DDB as DynamoDB: Transactions (GSI)
User->>API: GET /accounts/{id}/transactions[?period|start|end]
API->>GAT: Proxy event
GAT->>DDB: Query AccountDateIndex (id, date range)
DDB-->>GAT: Items
GAT-->>API: 200 { transactions, statementPeriod }
note over GAT: Non-HTTP invocation<br/>expects { accountId, ... } and returns merged { transactions }
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
Poem
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Summary by CodeRabbit