diff --git a/packages/twenty-server/src/database/typeorm-seeds/workspace/message-channel-message-associations.ts b/packages/twenty-server/src/database/typeorm-seeds/workspace/message-channel-message-associations.ts index 3e857301a..e4ab29ec6 100644 --- a/packages/twenty-server/src/database/typeorm-seeds/workspace/message-channel-message-associations.ts +++ b/packages/twenty-server/src/database/typeorm-seeds/workspace/message-channel-message-associations.ts @@ -2,6 +2,7 @@ import { EntityManager } from 'typeorm'; import { DEV_SEED_MESSAGE_CHANNEL_IDS } from 'src/database/typeorm-seeds/workspace/message-channels'; import { DEV_SEED_MESSAGE_IDS } from 'src/database/typeorm-seeds/workspace/messages'; +import { MessageDirection } from 'src/modules/messaging/common/enums/message-direction.enum'; const tableName = 'messageChannelMessageAssociation'; @@ -27,6 +28,7 @@ export const seedMessageChannelMessageAssociation = async ( 'messageExternalId', 'messageId', 'messageChannelId', + 'direction', ]) .orIgnore() .values([ @@ -39,6 +41,7 @@ export const seedMessageChannelMessageAssociation = async ( messageExternalId: null, messageId: DEV_SEED_MESSAGE_IDS.MESSAGE_1, messageChannelId: DEV_SEED_MESSAGE_CHANNEL_IDS.TIM, + direction: MessageDirection.OUTGOING, }, { id: DEV_SEED_MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_IDS.MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_2, @@ -49,6 +52,7 @@ export const seedMessageChannelMessageAssociation = async ( messageExternalId: null, messageId: DEV_SEED_MESSAGE_IDS.MESSAGE_2, messageChannelId: DEV_SEED_MESSAGE_CHANNEL_IDS.TIM, + direction: MessageDirection.OUTGOING, }, { id: DEV_SEED_MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_IDS.MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_3, @@ -59,6 +63,7 @@ export const seedMessageChannelMessageAssociation = async ( messageExternalId: null, messageId: DEV_SEED_MESSAGE_IDS.MESSAGE_3, messageChannelId: DEV_SEED_MESSAGE_CHANNEL_IDS.TIM, + direction: MessageDirection.INCOMING, }, ]) .execute(); diff --git a/packages/twenty-server/src/database/typeorm-seeds/workspace/messages.ts b/packages/twenty-server/src/database/typeorm-seeds/workspace/messages.ts index f549d43ae..b8e0c1af8 100644 --- a/packages/twenty-server/src/database/typeorm-seeds/workspace/messages.ts +++ b/packages/twenty-server/src/database/typeorm-seeds/workspace/messages.ts @@ -1,7 +1,6 @@ import { EntityManager } from 'typeorm'; import { DEV_SEED_MESSAGE_THREAD_IDS } from 'src/database/typeorm-seeds/workspace/message-threads'; -import { MessageDirection } from 'src/modules/messaging/common/enums/message-direction.enum'; const tableName = 'message'; @@ -26,7 +25,6 @@ export const seedMessage = async ( 'receivedAt', 'text', 'subject', - 'direction', 'messageThreadId', 'headerMessageId', ]) @@ -40,7 +38,6 @@ export const seedMessage = async ( receivedAt: new Date(), text: 'Hello, \n I hope this email finds you well. I am writing to request a meeting. I believe it would be beneficial for both parties to collaborate and explore potential opportunities. Would you be available for a meeting sometime next week? Please let me know your availability, and I will arrange a suitable time. \n Looking forward to your response.\n Best regards', subject: 'Meeting Request', - direction: MessageDirection.OUTGOING, messageThreadId: DEV_SEED_MESSAGE_THREAD_IDS.MESSAGE_THREAD_1, headerMessageId: '99ef24a8-2b8a-405d-8f42-e820ca921421', }, @@ -52,7 +49,6 @@ export const seedMessage = async ( receivedAt: new Date(), text: 'Good Morning,\n I am writing to inquire about information. Could you please provide me with details regarding this topic? \n Your assistance in this matter would be greatly appreciated. Thank you in advance for your prompt response. \n Best regards,Tim', subject: 'Inquiry Regarding Topic', - direction: MessageDirection.OUTGOING, messageThreadId: DEV_SEED_MESSAGE_THREAD_IDS.MESSAGE_THREAD_2, headerMessageId: '8f804a9a-04c8-4f24-93f2-764948e95014', }, @@ -64,7 +60,6 @@ export const seedMessage = async ( receivedAt: new Date(), text: 'Good Evening,\nI wanted to extend my sincere gratitude for taking the time to meet with me earlier today. It was a pleasure discussing with you, and I am excited about the potential opportunities for collaboration. \n Please feel free to reach out if you have any further questions or require additional information. I look forward to our continued communication. Best regards.', subject: 'Thank You for the Meeting', - direction: MessageDirection.INCOMING, messageThreadId: DEV_SEED_MESSAGE_THREAD_IDS.MESSAGE_THREAD_1, headerMessageId: '3939d68a-ac6b-4f86-87a2-5f5f9d1b6481', },