mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-24 17:38:40 -06:00
Merge eba1dae358
into 427c994993
This commit is contained in:
commit
3e078326c2
@ -0,0 +1,8 @@
|
|||||||
|
/*
|
||||||
|
Warnings:
|
||||||
|
|
||||||
|
- A unique constraint covering the columns `[instanceId,remoteJid]` on the table `Chat` will be added. If there are existing duplicate values, this will fail.
|
||||||
|
|
||||||
|
*/
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "Chat_instanceId_remoteJid_key" ON "Chat"("instanceId", "remoteJid");
|
@ -125,6 +125,8 @@ model Chat {
|
|||||||
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade)
|
||||||
instanceId String
|
instanceId String
|
||||||
unreadMessages Int @default(0)
|
unreadMessages Int @default(0)
|
||||||
|
|
||||||
|
@@unique([instanceId, remoteJid])
|
||||||
@@index([instanceId])
|
@@index([instanceId])
|
||||||
@@index([remoteJid])
|
@@index([remoteJid])
|
||||||
}
|
}
|
||||||
|
@ -702,6 +702,7 @@ export class ChannelStartupService {
|
|||||||
) as "updatedAt",
|
) as "updatedAt",
|
||||||
"Chat"."createdAt" as "windowStart",
|
"Chat"."createdAt" as "windowStart",
|
||||||
"Chat"."createdAt" + INTERVAL '24 hours' as "windowExpires",
|
"Chat"."createdAt" + INTERVAL '24 hours' as "windowExpires",
|
||||||
|
"Chat"."labels" as "labels",
|
||||||
CASE
|
CASE
|
||||||
WHEN "Chat"."createdAt" + INTERVAL '24 hours' > NOW() THEN true
|
WHEN "Chat"."createdAt" + INTERVAL '24 hours' > NOW() THEN true
|
||||||
ELSE false
|
ELSE false
|
||||||
@ -764,6 +765,7 @@ export class ChannelStartupService {
|
|||||||
windowExpires: contact.windowExpires,
|
windowExpires: contact.windowExpires,
|
||||||
windowActive: contact.windowActive,
|
windowActive: contact.windowActive,
|
||||||
lastMessage: lastMessage ? this.cleanMessageData(lastMessage) : undefined,
|
lastMessage: lastMessage ? this.cleanMessageData(lastMessage) : undefined,
|
||||||
|
labels: contact.labels,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user