docs: record channel config checkpoint
This commit is contained in:
@@ -16,7 +16,7 @@ Build GoChat as a Go backend that can directly reuse the frontend from `referenc
|
||||
|
||||
## Current Baseline
|
||||
|
||||
- Latest implementation checkpoint: `82167f5 feat(inboxes): align chatwoot inbox members`.
|
||||
- Latest implementation checkpoint: `f0aae79 feat(inboxes): deepen channel config parity`.
|
||||
- Latest documentation checkpoint before this consolidation: `1f6ec3e docs: record inbox serializer checkpoint`.
|
||||
- Worktree status at this planning checkpoint: clean after the matching docs checkpoint.
|
||||
- `go test ./...` passes.
|
||||
@@ -89,6 +89,7 @@ This ledger records the committed parity checkpoints that future slices should b
|
||||
| `ee93546 feat(inboxes): bind chatwoot channel settings` | Completed B5.2 request binding for reused dashboard inbox create/update flows: JSON and multipart/urlencoded bodies now accept top-level inbox settings, nested `channel[...]`, nested `csat_config[...]`, selected feature flags, API webhook config, generated web widget/API secrets, and Telegram create without explicit `name`. | `go test ./internal/handler/api/v1 -run 'TestInboxHandler_ChatwootSerializerParity\|TestInboxHandler_ChatwootCreateUpdateRequestBinding\|TestInbox' -count=1`; `go test ./internal/service -run Inbox -count=1`; `go test ./internal/handler/api/v1 -count=1`; escalated `go test ./...` after sandbox socket denial; `git diff --check`. | Continue B5.3 with durable working-hours update behavior and out-of-office parity, then B5.4 inbox members and B5.5 channel-specific config depth. |
|
||||
| `945782e feat(inboxes): persist chatwoot working hours` | Completed B5.3 working-hours parity for the generic inbox update flow: inbox create initializes Chatwoot default weekly schedule where the table exists, inbox update accepts frontend `working_hours` JSON with string/empty time fields from `timeSlotTransform`, persists schedules in `working_hours`, serializes `working_hours` from the relation, and preserves `working_hours_enabled`, `out_of_office_message`, and timezone behavior. | `go test ./internal/handler/api/v1 -run 'TestInboxHandler_ChatwootSerializerParity\|TestInboxHandler_ChatwootCreateUpdateRequestBinding\|TestInbox' -count=1`; `go test ./internal/service -run 'Inbox\|WorkingHour' -count=1`; `go test ./internal/handler/api/v1 -count=1`; escalated `go test ./...`; `git diff --check`. | Continue B5.4 with inbox member payload and round-robin membership side effects, then B5.5 channel-specific config depth. |
|
||||
| `82167f5 feat(inboxes): align chatwoot inbox members` | Completed B5.4 inbox member parity for reused dashboard agent assignment flows: account-scoped and nested member endpoints now return Chatwoot `{ payload: [agent] }` responses, agent payloads expose frontend-required user fields, duplicate adds are idempotent, create adds only missing users, and update performs a diff so preserved rows are not recreated unnecessarily. | `go test ./internal/handler/api/v1 -run InboxMember -count=1`; `go test ./internal/service -run InboxMember -count=1`; `go test ./internal/repository -run InboxMember -count=1`; `go test ./internal/handler/api/v1 -count=1`; `go test ./...`; `git diff --check`. | Continue B5.5 with deeper channel-specific config parity and InboxLimit enforcement on channel creation. |
|
||||
| `f0aae79 feat(inboxes): deepen channel config parity` | Advanced B5.5 channel config parity: generic inbox JSON updates now hoist flat frontend SMTP/IMAP/channel setting keys into `channel_config`, the serializer exposes deeper Email, WhatsApp, LINE, SMS, and Twilio voice/config fields, channel defaults match Chatwoot closer for WebWidget/API/Email/WhatsApp, and the Twilio frontend create route accepts nested `twilio_channel` payloads while returning the raw Chatwoot inbox serializer. | `go test ./internal/handler/api/v1 -run 'TestInboxHandler_Chatwoot(ChannelSpecificConfigDepth\|CreateUpdateRequestBinding\|SerializerParity)\|TestTwilioChannel_Create' -count=1`; `go test ./internal/service -run Inbox -count=1`; `go test ./internal/handler/api/v1 -count=1`; `go test ./...`; `git diff --check`. | Continue B5.5 with InboxLimit enforcement and any remaining channel-specific route response cleanup. |
|
||||
|
||||
## Next Slice Contract
|
||||
|
||||
@@ -166,7 +167,9 @@ Current B5 inbox/channel checkpoint:
|
||||
- Inbox create/update now follows Chatwoot's `OutOfOffisable` schedule lifecycle: default seven-day working hours are created for new inboxes, `working_hours` updates persist the weekly relation, empty string time fields from the frontend are normalized, open-all-day rows are expanded to `00:00`-`23:59`, and the serializer returns `weekly_schedule` shape from the relation.
|
||||
- Inbox member routes now follow Chatwoot's account-scoped `InboxMembersController` contract: `GET /inbox_members/:inbox_id`, `POST /inbox_members`, and `PATCH /inbox_members` return `{ payload: [agent] }`; `DELETE /inbox_members` returns empty `200 OK`; nested local member routes use the same agent payload boundary for frontend compatibility.
|
||||
- Inbox member create is add-only and idempotent for duplicate users, while update computes add/remove diffs instead of clearing and recreating rows. Returned agent payloads include `id`, `account_id`, `availability_status`, `auto_offline`, `confirmed`, `email`, `provider`, `available_name`, `name`, `role`, `thumbnail`, and enterprise `custom_role_id`.
|
||||
- Remaining B5 gaps: deeper LINE/Twilio/Email/WhatsApp channel-specific creation/config parity and InboxLimit enforcement.
|
||||
- Generic inbox JSON create/update now persists flat channel-specific frontend keys used by Email IMAP/SMTP settings and settings-page toggles, not only nested `channel` payloads.
|
||||
- Inbox serializer depth now covers Email IMAP/SMTP/forwarding fields, WhatsApp `provider_config` and generated webhook verify token, LINE channel credentials, SMS provider config, and Twilio SMS/WhatsApp/voice fields. Twilio channel creation accepts Chatwoot's nested `twilio_channel` payload and returns the raw inbox serializer instead of `{ channel, inbox }`.
|
||||
- Remaining B5 gaps: InboxLimit enforcement and review of any remaining channel-specific route response cleanup outside the generic inbox path.
|
||||
|
||||
Active B5 task board:
|
||||
|
||||
@@ -176,7 +179,7 @@ Active B5 task board:
|
||||
| B5.2 | Inbox create/update request binding and settings persistence. | `buildInboxData`, `permitted_params`, settings pages. | Done | `ee93546`; JSON and multipart `channel[...]` requests persist core inbox/channel settings. |
|
||||
| B5.3 | Working hours and out-of-office parity. | `OutOfOffisable`, working hour controller/model. | Done | `945782e`; weekly schedule create/update/show and `out_of_office` service tests match Chatwoot semantics. |
|
||||
| B5.4 | Inbox member payload and round-robin side effects. | `InboxMembersController`, `Inbox#add_members/remove_members`. | Done | `82167f5`; account-scoped and nested member routes return `{ payload }` agents, create is add-only/idempotent, update is diff-based, and delete is empty `200 OK`. |
|
||||
| B5.5 | Channel-specific config depth and inbox limits. | WebWidget/API/Telegram/Email/WhatsApp/SMS/LINE channel models/controllers, enterprise inbox limits. | Todo | Channel create/update/show tests cover frontend settings screens; InboxLimit blocks over-quota creation. |
|
||||
| B5.5 | Channel-specific config depth and inbox limits. | WebWidget/API/Telegram/Email/WhatsApp/SMS/LINE channel models/controllers, enterprise inbox limits. | Doing | `f0aae79`; Email/WhatsApp/LINE/SMS/Twilio config payloads and Twilio create route are covered. InboxLimit enforcement remains. |
|
||||
|
||||
B5.2 execution breakdown:
|
||||
|
||||
@@ -210,11 +213,22 @@ B5.5 planned breakdown:
|
||||
|
||||
| Step | Implementation target | Reference source | Required tests | Status |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| B5.5a | Compare current Go channel config fields against Chatwoot channel models/controllers for WebWidget, API, Telegram, Email, WhatsApp, Twilio SMS, and LINE. | `reference/chatwoot/app/models/channel/*`, channel controllers, dashboard inbox setting screens. | Add a documented matrix of supported/missing request and response fields in this file. | Todo |
|
||||
| B5.5b | Persist and serialize deeper channel-specific settings used by reused settings screens, preferring first-class columns only where GoChat already has them and `channel_config` otherwise. | Chatwoot channel model validations and `InboxesController#permitted_params`. | Handler tests for each channel's create/update/show payload shape. | Todo |
|
||||
| B5.5a | Compare current Go channel config fields against Chatwoot channel models/controllers for WebWidget, API, Telegram, Email, WhatsApp, Twilio SMS, and LINE. | `reference/chatwoot/app/models/channel/*`, channel controllers, dashboard inbox setting screens. | `f0aae79` documents and tests the first matrix through Email/WhatsApp/LINE/SMS/Twilio serializer fields; keep open for final route-response cleanup review. | Review |
|
||||
| B5.5b | Persist and serialize deeper channel-specific settings used by reused settings screens, preferring first-class columns only where GoChat already has them and `channel_config` otherwise. | Chatwoot channel model validations and `InboxesController#permitted_params`. | Done by `f0aae79`; handler tests cover Email IMAP/SMTP flat JSON update, WhatsApp provider config, LINE credentials, and Twilio nested create raw inbox payload. | Done |
|
||||
| B5.5c | Enforce enterprise InboxLimit during inbox/channel creation and return frontend-compatible over-limit errors. | Chatwoot enterprise inbox limit policy/model behavior. | Service/handler tests cover under-limit create, at-limit rejection, and account-scoped counting. | Todo |
|
||||
| B5.5d | Keep route artifacts unchanged unless new Chatwoot-compatible routes are registered; regenerate route dump only on route changes. | `cmd/dump_routes`, `cmd/route_parity`. | `git diff --check`; `go test ./...`; route dump if needed. | Todo |
|
||||
|
||||
B5.5 channel config matrix after `f0aae79`:
|
||||
|
||||
| Channel | Create/update support now covered | Serializer fields now covered | Remaining gap |
|
||||
| --- | --- | --- | --- |
|
||||
| WebWidget | Generic FormData/JSON `channel[...]`, selected feature flags, HMAC, domains, pre-chat defaults. | Website token, HMAC token, widget color, welcome copy, pre-chat options, continuity, reply time. | Review final settings-page edge fields only. |
|
||||
| API | Generic JSON/FormData `webhook_url`, HMAC, additional attributes, generated identifier/secret. | Secret, webhook URL, inbox identifier, HMAC token, additional attributes. | Review validation parity for `agent_reply_time_window`. |
|
||||
| Email | Flat JSON IMAP/SMTP updates and nested create fields are hoisted into `channel_config`. | Email, forwarding, IMAP, SMTP, auth, SSL/TLS, domain fields. | Dedicated email-channel controller response shape still needs final review. |
|
||||
| WhatsApp | Manual/cloud create stores `phone_number`, `provider`, nested `provider_config`, and generates cloud webhook verify token. | Phone number, provider, provider config, message templates, reauthorization, voice flag. | Provider credential validation and embedded signup deep behavior remain later integration work. |
|
||||
| Twilio SMS/WhatsApp | Nested `twilio_channel` frontend create payload accepted; SMS/WhatsApp medium and phone normalization stored in inbox config. | Phone, messaging service SID, medium, content templates, auth/account/API key fields, voice flags. | Update/delete/list route responses still need final raw-inbox parity review. |
|
||||
| LINE/SMS | Generic create stores LINE credentials and Bandwidth SMS provider config. | LINE credentials; SMS phone/provider config. | LINE is present in local reference but lacks deep serializer fields upstream; keep behavior frontend-compatible. |
|
||||
|
||||
Active B4 task board:
|
||||
|
||||
| ID | Task | Reference source | Status | Exit gate |
|
||||
@@ -799,3 +813,4 @@ Verification milestone gates:
|
||||
- 2026-06-05: B5.2 inbox request binding checkpoint committed as `ee93546 feat(inboxes): bind chatwoot channel settings`; generic inbox create/update now accepts Chatwoot frontend JSON and multipart/urlencoded FormData, persists top-level inbox settings and nested channel/CSAT config, generates web widget/API secrets, and supports Telegram creation without an explicit name. Focused inbox handler tests, service inbox tests, handler package tests, escalated full `go test ./...`, and `git diff --check` passed. Route dump unchanged at `TOTAL: 821`.
|
||||
- 2026-06-05: B5.3 working-hours checkpoint committed as `945782e feat(inboxes): persist chatwoot working hours`; generic inbox create/update now initializes default working hours, accepts the reused frontend's `working_hours` payload with string and empty time fields, persists the weekly schedule relation, serializes working hours from the relation, and covers out-of-office detection. Focused inbox/working-hour tests, handler package tests, escalated full `go test ./...`, and `git diff --check` passed. Route dump unchanged at `TOTAL: 821`.
|
||||
- 2026-06-05: B5.4 inbox members checkpoint committed as `82167f5 feat(inboxes): align chatwoot inbox members`; account-scoped and nested inbox member routes now return Chatwoot `{ payload: [agent] }` responses, serialize assigned users with agent partial fields including `custom_role_id`, make create add-only/idempotent, make update diff-based, and keep delete as empty `200 OK`. Focused inbox member handler/service/repository tests, handler package tests, full `go test ./...`, and `git diff --check` passed. Route dump unchanged at `TOTAL: 821`.
|
||||
- 2026-06-05: B5.5 channel config depth checkpoint committed as `f0aae79 feat(inboxes): deepen channel config parity`; generic inbox JSON updates now hoist flat SMTP/IMAP/channel settings into channel config, Email/WhatsApp/LINE/SMS/Twilio serializers expose deeper Chatwoot frontend fields, WebWidget/API/Email/WhatsApp defaults are closer to Chatwoot, and Twilio channel create accepts nested `twilio_channel` payloads while returning the raw inbox serializer. Focused channel-depth tests, service inbox tests, handler package tests, full `go test ./...`, and `git diff --check` passed. Route dump unchanged at `TOTAL: 821`.
|
||||
|
||||
Reference in New Issue
Block a user