Backoffice stage 2: chats (support + concierge, files)

- ChatThread per client/provider and channel; messages get files, internal notes,
  source (bot/mini app) and delivery errors; reply templates. Migration moves old
  concierge messages into threads.
- Routing: subscribers write to the concierge, others to support; /support and
  /concierge in the client bot; staff can take, transfer, close and move threads.
- Telegram: photos/documents from clients and providers, replies with the channel
  header, files sent from storage, notifications only to the assignee or the
  channel's staff, "Reply" into a specific thread.
- New admin: /chats with list, conversation, notes, files, templates, client panel;
  "Message" button on the client card; dashboard counts threads awaiting reply.
- Client mini app: in-app chat screen sharing the same conversation.
- Old admin keeps working on the same data (notes hidden there).
- Tests for routing, notes, assign/close/move, lists, recipients; separate test DB
  via TEST_DB_NAME; dev:chats-demo script.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
zabudko-ruandClaude Opus 5.5 committed 2026-10-21 01:50:37 +04:00
1 parent d452824c62
commit 23ffb2bf1d
46 files changed
+4176 -144

No files matched your search

+30 -4
View File
@@ -442,7 +442,9 @@
"PROVIDER_NOT_LINKED": "The provider hasn’t opened the work bot via the invite yet — nowhere to send messages.",
"CARD_EXPIRED": "The QR is out of date or invalid — ask the client to reopen the card.",
"OFFER_NOT_AVAILABLE": "This offer isn’t available at the client’s level.",
"OFFER_LIMIT_REACHED": "The limit for this offer is already used up."
"OFFER_LIMIT_REACHED": "The limit for this offer is already used up.",
"CONCIERGE_SUBSCRIBERS_ONLY": "The personal concierge is for Barev+ and Barev Elite members. For now, write to support — we will help too.",
"ASSIGNEE_NO_ACCESS": "This team member has no access to this channel."
},
"client": {
"nav": {
@@ -654,6 +656,20 @@
"used_ONCE": "already used",
"used_WEEK": "again next week",
"used_MONTH": "again next month"
},
"chat": {
"title": "Chat with Barev Club",
"support": "Support",
"concierge": "Personal concierge",
"hint": "This is the same conversation as in the bot chat: replies arrive here and in Telegram.",
"empty": "Tell us how we can help — we’ll reply here.",
"placeholder": "Message…",
"send": "Send",
"attach": "Attach a photo or file",
"conciergeOnly": "The personal concierge comes with Barev+ and Barev Elite",
"team": "Barev Club",
"fileTooBig": "The file is larger than 10 MB",
"file": "File"
}
},
"pro": {
@@ -815,7 +831,12 @@
"cmdHelp": "Help",
"webRequestOrdered": "Request No. {{request}} received and booked as order No. {{order}} for {{date}}. Track the status in the app.",
"webRequestLinked": "Request No. {{request}} received. An operator will contact you to confirm the time.",
"conciergeReceived": "Passed to the concierge — we'll reply here, in this chat."
"conciergeReceived": "Passed to the concierge — we'll reply here, in this chat.",
"supportReceived": "Passed to support — we'll reply here, in this chat.",
"channelSupport": "You are now writing to support. Just send a message, photo or file.",
"channelConcierge": "You are now writing to your personal concierge. Just send a message, photo or file.",
"cmdSupport": "Write to support",
"cmdConcierge": "Write to the concierge (Barev+)"
},
"pro": {
"notLinked": "This bot is for Barev Club specialists. Ask the operator for an invite link.",
@@ -844,7 +865,11 @@
"newRequest": "App request #{{number}}",
"newWebRequest": "Site request #{{number}}",
"loginOk": "Sign-in confirmed — go back to your browser.",
"loginExpired": "The sign-in link has expired — reload the admin page."
"loginExpired": "The sign-in link has expired — reload the admin page.",
"channelSupport": "Support",
"channelConcierge": "Concierge",
"file": "file",
"chatAssigned": "{{by}} passed you a conversation: {{name}}"
},
"partner": {
"valid": "{{name}} — {{level}}, card is valid",
@@ -948,7 +973,8 @@
"openPlan": "Open the app",
"concierge": "Barev Club concierge",
"subscriptionActivated": "{{plan}} is on until {{date}}. Discounts are already in service prices.",
"operator": "Barev Club operator"
"operator": "Barev Club operator",
"support": "Barev Club support"
},
"admin": {
"nav": {