From 8c71d8267cc23f2d9ecb4c1b069ff8430d0041a0 Mon Sep 17 00:00:00 2001 From: Adam Moussa <166072409+amoussa1229@users.noreply.github.com> Date: Mon, 13 Apr 2026 15:42:27 -0400 Subject: [PATCH] docs: update README for PO and work order KB syncs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ref #4 — documents the new po-sync and workorder-sync Lambdas, EventBridge schedules, DynamoDB data sources, and manual trigger instructions. --- README.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f9db1bb..831bf83 100644 --- a/README.md +++ b/README.md @@ -18,14 +18,15 @@ slack-processor Lambda ← calls Bedrock Agent, logs to DynamoDB, posts r │ ▼ Bedrock Agent (Claude Sonnet 4.5) - ├── Knowledge Base (AOSS + S3) ← SA8000 docs, SOPs, employee handbook, Notion pages + ├── Knowledge Base (AOSS + S3) ← SA8000 docs, SOPs, employee handbook, Notion pages, POs, work orders ├── QBO_Lookup action group ← QuickBooks vendor search └── Google_Maps_Lookup action group ← fallback vendor search EventBridge (daily 02:00 UTC) │ - ▼ -notion-sync Lambda ← exports Office Operations Notion pages → S3 → KB ingestion + ├── notion-sync Lambda ← exports Office Operations Notion pages → S3 → KB ingestion + ├── po-sync Lambda ← exports purchase-orders DynamoDB → S3 → KB ingestion + └── workorder-sync Lambda ← exports WorkOrders + Comments DynamoDB → S3 → KB ingestion ``` ### Vendor Query Priority @@ -43,6 +44,8 @@ notion-sync Lambda ← exports Office Operations Notion pages → S3 | Embeddings | Amazon Titan Embed Text V2 (1024 dimensions) | | Vector Store | OpenSearch Serverless (VECTORSEARCH) | | Conversation Log | DynamoDB `seahaven-conversations` (90-day TTL) | +| PO Data Source | DynamoDB `purchase-orders` (via po-ingest) | +| Work Order Data Source | DynamoDB `WorkOrders` + `WorkOrderComments` (via workorder-ingest) | | Webhook URL | `https://bot.seahaven.com/slack/events` | ## Prerequisites @@ -143,12 +146,16 @@ lib/ slack-handler.ts API Gateway + webhook/processor Lambdas conversation-log.ts DynamoDB table notion-sync.ts EventBridge daily cron + notion-sync Lambda + Secrets Manager + po-sync.ts EventBridge daily cron + po-sync Lambda + workorder-sync.ts EventBridge daily cron + workorder-sync Lambda lambda/ slack-webhook/ Verifies Slack signature, fires processor async slack-processor/ Calls agent, writes DynamoDB, posts Slack reply qbo-lookup/ Bedrock action group — QuickBooks vendor search maps-lookup/ Bedrock action group — Google Maps Places search notion-sync/ Daily Notion → S3 export, triggers KB ingestion + po-sync/ Daily purchase-orders DynamoDB → S3 export, triggers KB ingestion + workorder-sync/ Daily WorkOrders DynamoDB → S3 export, triggers KB ingestion scripts/ create-aoss-index.ts Manual fallback for AOSS index creation (not needed in normal deploy) ``` @@ -157,4 +164,6 @@ scripts/ - **QBO refresh token** expires after 100 days of inactivity. Rotate via the [Intuit OAuth Playground](https://developer.intuit.com/app/developer/playground) and update the `seahaven/qbo/oauth` secret. - **Notion sync** runs daily at 02:00 UTC automatically. To trigger an immediate sync, invoke `seahaven-notion-sync` manually via the Lambda console or CLI. +- **PO sync** runs daily at 02:00 UTC. Scans the `purchase-orders` DynamoDB table (from [po-ingest](https://github.com/Sea-Haven-Industries/po-ingest)) and exports each PO as markdown to the KB. Manual trigger: invoke `seahaven-po-sync`. +- **Work order sync** runs daily at 02:00 UTC. Scans `WorkOrders` and `WorkOrderComments` DynamoDB tables (from [workorder-ingest](https://github.com/Sea-Haven-Industries/workorder-ingest)) and exports each work order + comment history as markdown to the KB. Manual trigger: invoke `seahaven-workorder-sync`. - **KB sync for manual S3 uploads** (non-Notion docs) must still be triggered manually after uploading new documents to the S3 bucket.