feat(chatwoot): read last message on WhatsApp when a message is sent from Chatwoot

This commit is contained in:
jaison-x
2024-03-12 11:56:14 -03:00
parent 901954de33
commit 072171da18
5 changed files with 41 additions and 1 deletions

View File

@@ -15,6 +15,7 @@ class ChatwootMessage {
inboxId?: number;
conversationId?: number;
contactInbox?: { sourceId: string };
isRead?: boolean;
}
export class MessageRaw {
@@ -36,8 +37,9 @@ export class MessageRaw {
type MessageRawBoolean<T> = {
[P in keyof T]?: 0 | 1;
};
export type MessageRawSelect = Omit<MessageRawBoolean<MessageRaw>, 'key'> & {
export type MessageRawSelect = Omit<Omit<MessageRawBoolean<MessageRaw>, 'key'>, 'chatwoot'> & {
key?: MessageRawBoolean<Key>;
chatwoot?: MessageRawBoolean<ChatwootMessage>;
};
const messageSchema = new Schema<MessageRaw>({
@@ -60,6 +62,7 @@ const messageSchema = new Schema<MessageRaw>({
inboxId: { type: Number },
conversationId: { type: Number },
contactInbox: { type: Object },
isRead: { type: Boolean },
},
});