diff --git a/README.md b/README.md index 5a8dcea..5775dc8 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,12 @@ Slack reaction-driven expense approval router. Replaces the Pipedream `expenses_ A user reacts ✅ to a message in an expense channel. The bot: 1. Maps the source channel to the next stage's channel. -2. Copies the message text (stripped of any prior "react to advance" hint) into the next channel, with a permalink back to the original on the first advance. -3. Replies in-thread on the original message with `➡️ Advanced to {Stage}`. +2. Copies the message text (stripped of any prior "react to advance" hint) into the next channel. When advancing out of **Submitted**, the copy also gets a permalink back to the user's original message. +3. Depending on where we're advancing *from*: + - **From Submitted:** keeps the user's original message in place and posts a threaded `➡️ Advanced to {Stage}` reply. The Submitted channel is the permanent audit trail. + - **From Processed or Authorized:** deletes the old copy so each intermediate channel stays a clean "current work" queue. -Channel chain: Submitted → Processed → Authorized → Matched. +Channel chain: Submitted → Processed → Authorized → Matched. The bot can only delete its own posts, which is why the Submitted original (a real user message) is preserved by design. ## Architecture @@ -49,7 +51,12 @@ Runtime: Python 3.12 on arm64, no third-party dependencies (stdlib `urllib` for ## Configuration -The channel → stage mapping lives in `src/processor/app.py` (`STAGES`). Update there if channels change. The "on first advance, include a permalink" check is keyed on the Processed-stage channel ID — update that too if the first-stage channel changes. +Channel IDs live in `src/processor/app.py`: + +- `SUBMITTED_CHANNEL` — the user-authored origin channel. Controls both the "include a permalink" behavior and the "preserve vs delete source" branch. +- `STAGES` — the full chain mapping each source channel to its `next` channel and human-readable `label`. + +If the Submitted channel changes, update `SUBMITTED_CHANNEL` and the first key of `STAGES`. For any other stage change, update `STAGES` only. ## Manual testing