Chats: show which order a provider writes about, or that there is no order
- Provider messages store the order that was current when they wrote: a started order first, otherwise the nearest assigned one within -4h..+12h; none — "no order". - Admin chat: order tag above each provider message, "now / next" order strip in the conversation header, order number (or "no order") in the thread list. - Telegram notification to the team gets an order line or "no current order". - Test for the order-picking rule; demo shows both cases. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
23ffb2bf1d
commit
2772837e29
14 files changed
+321
-13
No files matched your search
@@ -0,0 +1,6 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "ConciergeMessage" ADD COLUMN "orderId" TEXT;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "ConciergeMessage" ADD CONSTRAINT "ConciergeMessage_orderId_fkey" FOREIGN KEY ("orderId") REFERENCES "Order"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
@@ -465,6 +465,7 @@ model Order {
|
||||
offers OrderOffer[]
|
||||
files OrderFile[]
|
||||
messages Message[]
|
||||
chatMessages ConciergeMessage[]
|
||||
estimates Estimate[]
|
||||
rating Rating?
|
||||
lessons LessonPackage?
|
||||
@@ -1152,6 +1153,9 @@ model ConciergeMessage {
|
||||
size Int?
|
||||
/// не удалось доставить в Telegram (клиент заблокировал бота и т.п.)
|
||||
deliveryError String?
|
||||
/// исполнитель писал по этому заказу (текущий заказ в момент сообщения); null — заказа тогда не было
|
||||
orderId String?
|
||||
order Order? @relation(fields: [orderId], references: [id], onDelete: SetNull)
|
||||
/// оператор прочитал сообщение клиента
|
||||
readAt DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
Reference in new issue
Block a user