Commit graph

32 commits

Author SHA1 Message Date
Adam Moussa
efb6278b1f
Merge pull request #8 from Sea-Haven-Industries/dependabot/npm_and_yarn/aws-sdk/client-sqs-3.1041.0
Bump @aws-sdk/client-sqs from 3.1039.0 to 3.1041.0
2026-05-02 17:23:11 -04:00
dependabot[bot]
24e49b2a8b
Bump @aws-sdk/client-sqs from 3.1039.0 to 3.1041.0
Bumps [@aws-sdk/client-sqs](https://github.com/aws/aws-sdk-js-v3/tree/HEAD/clients/client-sqs) from 3.1039.0 to 3.1041.0.
- [Release notes](https://github.com/aws/aws-sdk-js-v3/releases)
- [Changelog](https://github.com/aws/aws-sdk-js-v3/blob/main/clients/client-sqs/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-js-v3/commits/v3.1041.0/clients/client-sqs)

---
updated-dependencies:
- dependency-name: "@aws-sdk/client-sqs"
  dependency-version: 3.1041.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-02 21:17:30 +00:00
Adam Moussa
c8b09b1ea9
Merge pull request #6 from Sea-Haven-Industries/feature/add-dependabot-config
Add Dependabot version update configuration
2026-05-02 17:15:47 -04:00
Adam Moussa
d9cc89c7e9 Add Dependabot version update configuration 2026-05-02 17:14:26 -04:00
Adam Moussa
df14849dbb Update README with payroll email pipeline documentation 2026-04-30 14:19:06 -04:00
Adam Moussa
5bebd954bd Fix Lambda compliance and rename SQS queue
- Switch runtime to nodejs22.x and architecture to arm64
- Add explicit CloudWatch log groups with 60-day retention for all Lambdas
- Rename SQS queue from payments-contractor-batch to payments-payroll-batch
  (now handles both employee and contractor batching)
- Remove stale comment
2026-04-30 14:15:05 -04:00
Adam Moussa
fe7c9cebca Replace Dataddo/Aurora payroll pipeline with email-triggered notifications
SES receives Gusto payroll emails at payroll@int.seahaven.com, stores
to S3, Lambda parses and posts a combined Slack notification (employee
payroll + contractor payments in one message) after a 10-minute SQS
batching window.

Removes Aurora Serverless, notifyPayroll Lambda, and @aws-sdk/client-rds-data.
Adds mailparser, SQS delay queue, and processPayrollEmail Lambda.
2026-04-30 14:04:48 -04:00
Adam Moussa
8f409d0e63 Add .claude configuration directory 2026-04-27 19:14:54 -04:00
Adam Moussa
3583e2fc11 Add payroll notification Lambda for Gusto payroll via Dataddo
Queries Aurora for new payroll runs and contractor payments, sends
formatted Slack message with gross pay breakdown and total bank
withdrawal amount. Runs weekdays at 2pm ET, tracks notified payrolls
in DynamoDB to avoid duplicates.
2026-04-24 16:39:50 -04:00
Adam Moussa
c9163e9f60 Add Aurora Serverless v2 PostgreSQL for Gusto payroll ingestion via Dataddo
Adds public subnet in second AZ, Aurora security group, DB subnet group,
and Serverless v2 cluster with Data API enabled and Secrets Manager credentials.
2026-04-24 15:05:43 -04:00
Adam Moussa
b242df15b5 Log BoA submissions to DDB and surface in Slack App Home
Capture response headers, body, and transactionId on every check-issue
API call; persist as boa_txn#<ts>#<action> records with 90-day TTL.
Add "Recent BoA Submissions" section to App Home showing the last 10
with click-to-copy transactionId.

Motivation: BoA support asked for a transactionId from a past
successful call and we had no way to recover it from CloudWatch
summary logs alone.

Also adds simulate-csv.cjs (dry-run preview) and stampli-uploader.sh
(launchd-invoked S3 uploader), and gitignores debug artifacts.
2026-04-20 17:40:55 -04:00
Adam Moussa
e6fbd3de1b
Merge pull request #2 from Sea-Haven-Industries/feature/boa-api-integration
Add BoA CashPro API integration
2026-04-14 20:18:33 -04:00
Adam Moussa
c849280705 Improve BoA API error logging and update .gitignore
Read response as text before JSON parsing to capture non-JSON error
responses from BoA API. Add .DS_Store, BofA API Resources, and CSV
files to .gitignore.
2026-04-14 20:15:41 -04:00
Adam Moussa
ffd46c4bda Fix BoA transaction matching, add status progression protection, enable daily schedule
- Fix transaction code mapping (475=Cleared, 255=Returned) in fetchBoaTransactions
- Match on customerReference instead of bankReference for check number matching
- Add bank-confirmed protection: CSV cannot override status once bank confirms Cleared
- Add status progression guard: CSV cannot regress status backward in lifecycle
- Cleared status is permanent — cannot be voided, cancelled, or changed
- Enable daily fetchBoaTransactions schedule (9am ET weekdays)
- Add production test script and dry run simulation script
2026-04-14 17:43:13 -04:00
Adam Moussa
d065b320eb Merge master into feature/boa-api-integration
Brings in dashboard UI improvements (drill-down modals, redesign,
ACH reference labels) while preserving BoA OAuth integration code.
2026-04-13 16:28:17 -04:00
Adam Moussa
c445fa947a Update integration code with correct BoA CashPro API specs and add README
- Add OAuth client-credentials token exchange to both Lambda handlers
- Fix sandbox/prod base URL (api-sb.bofa.com / api.bofa.com)
- Fix issueAction casing to add_Issue / cancel_Issue per API docs
- Fix transaction inquiry response parsing (accountTransactions array)
- Move all BoA config (app IDs, bank ID) from env vars to SSM params
- Update template.yaml with correct SSM param names and policies
- Add project README with architecture, API details, and SSM param reference
2026-04-13 16:24:20 -04:00
Adam Moussa
957fb726ab Add OAuth token exchange to BoA sandbox test script
Use correct sandbox base URL (api-sb.bofa.com), proper OAuth
client-credentials flow with applicationID, and routing number
for transaction inquiries. Both APIs now return 200 in sandbox.
2026-04-13 16:08:57 -04:00
Adam Moussa
a9ad5f7dd1 Add BoA CashPro sandbox test script and update seed script
- Add standalone test script to validate sandbox API connectivity
  for check management and account info endpoints
- Update seed-bank-status to persist amount, issueDate, and method fields
- Add data/ to gitignore
2026-04-13 15:34:01 -04:00
Adam Moussa
cb07421282 Show Reference # instead of Check # for ACH payments in modal 2026-04-10 18:14:22 -04:00
Adam Moussa
f769ea5872 Fix base64 body decoding for Slack interactivity payloads 2026-04-10 18:11:54 -04:00
Adam Moussa
941cd094fc Add drill-down modals: View buttons open payment detail for each row 2026-04-10 18:08:06 -04:00
Adam Moussa
7f94eee308 Redesign dashboard: 6 outstanding age buckets, summary bar, improved layout 2026-04-10 18:03:10 -04:00
Adam Moussa
fc37c6e8f9 Add seed scripts from master (seed-from-csv, seed-bank-status) 2026-04-10 17:35:57 -04:00
Adam Moussa
7d1686bf94 Update dashboard: split scheduled by method, outstanding checks with 90-day buckets, remove cleared section 2026-04-10 17:35:47 -04:00
Adam Moussa
3b8c201444 Add ACH auto-clear and expanded cancel status list
ACH payments auto-marked as Cleared when send date has passed.
Cancel statuses expanded to include "canceled" and "marked as void".
2026-04-10 17:31:27 -04:00
Adam Moussa
53842f0821 Update dashboard: split scheduled by method, outstanding checks by age
- Scheduled section split into Scheduled Checks and Scheduled ACH
- Remove Cleared section from dashboard
- Outstanding renamed to Outstanding Checks with <=90 day and >90 day totals
2026-04-10 17:28:01 -04:00
Adam Moussa
c43228831d Add unified payment status, ACH auto-clear, and categorized dashboard
- processPaymentCsv: switch from BatchWrite to upsert, auto-mark ACH
  payments as Cleared when send date has passed
- slackAppHome: categorize payments into Scheduled/Outstanding/Cleared
  sections using unified status field
- Add seed scripts for bulk-loading Stampli and bank CSV exports
2026-04-10 17:23:54 -04:00
Adam Moussa
33cd9759b4 Add CashPro check issue/cancel on CSV upload
- CSV processor detects new checks and submits add_issue to CashPro
- Checks updated to voided/cancelled trigger cancel_issue to CashPro
- Added SSM params for boa-api-token, boa-account-number, boa-company-id
  to both processPaymentCsv and fetchBoaTransactions Lambdas
- Increased CSV processor timeout to 120s for API calls
2026-04-09 15:14:51 -04:00
Adam Moussa
8e262c3b88 Merge returned into outstanding, exclude voided/cancelled payments 2026-04-09 15:03:09 -04:00
Adam Moussa
44a6cd1b63 Add BoA CashPro integration and payment status tracking
- New fetchBoaTransactions Lambda: daily 9am ET schedule (disabled until API key set)
  Calls CashPro Previous Day Transaction Inquiry, filters for codes 255/475,
  matches bankReference to check_number, updates clear_status in DynamoDB
- CSV processor switched to UpdateCommand to preserve clearing data on re-upload
- Slack dashboard now shows Scheduled, Outstanding, Cleared, and Returned sections
- ACH payments auto-assumed cleared once past due date
2026-04-09 14:59:39 -04:00
Adam Moussa
7150028bd3 Add VPC/NAT for static IP, dedup payments by check number, SSM token
- VPC with NAT Gateway for static outbound IP (52.86.95.107) for BoA API
- Payments stored as individual DynamoDB items keyed by check number
- Slack bot token fetched from SSM at runtime instead of CF parameter
- Slack Lambda scans payment items instead of reading single blob
2026-04-09 14:27:34 -04:00
Adam Moussa
f1c2063f52 Initial SAM stack: payments CSV to Slack App Home
Two Lambda functions:
- processPaymentCsv: S3 trigger, parses CSV, stores dashboard in DynamoDB
- slackAppHome: API Gateway endpoint for Slack events, publishes Home tab view
2026-04-09 13:29:28 -04:00