3369 rename messagerecipients table into messageparticipants (#3457)
* renaming * renaming
This commit is contained in:
@ -9,7 +9,7 @@ export enum CoreObjectNameSingular {
|
|||||||
Favorite = 'favorite',
|
Favorite = 'favorite',
|
||||||
Message = 'message',
|
Message = 'message',
|
||||||
MessageChannel = 'messageChannel',
|
MessageChannel = 'messageChannel',
|
||||||
MessageRecipient = 'messageRecipient',
|
MessageParticipant = 'messageParticipant',
|
||||||
MessageThread = 'messageThread',
|
MessageThread = 'messageThread',
|
||||||
Opportunity = 'opportunity',
|
Opportunity = 'opportunity',
|
||||||
Person = 'person',
|
Person = 'person',
|
||||||
|
|||||||
@ -244,9 +244,9 @@ export const graphqlMocks = {
|
|||||||
edges: mockWorkspaceMembers.map((member) => ({
|
edges: mockWorkspaceMembers.map((member) => ({
|
||||||
node: {
|
node: {
|
||||||
...member,
|
...member,
|
||||||
messageRecipients: {
|
messageParticipants: {
|
||||||
edges: [],
|
edges: [],
|
||||||
__typename: 'MessageRecipientConnection',
|
__typename: 'MessageParticipantConnection',
|
||||||
},
|
},
|
||||||
authoredAttachments: {
|
authoredAttachments: {
|
||||||
edges: [],
|
edges: [],
|
||||||
|
|||||||
@ -82,9 +82,9 @@ export const mockedPeopleMetadata = {
|
|||||||
__typename: 'field',
|
__typename: 'field',
|
||||||
id: 'c606dfb1-a24c-4f9b-b626-0df1c845e6e8',
|
id: 'c606dfb1-a24c-4f9b-b626-0df1c845e6e8',
|
||||||
type: 'RELATION',
|
type: 'RELATION',
|
||||||
name: 'messageRecipients',
|
name: 'messageParticipants',
|
||||||
label: 'Message Recipients',
|
label: 'Message Participants',
|
||||||
description: 'Message Recipients',
|
description: 'Message Participants',
|
||||||
icon: 'IconUserCircle',
|
icon: 'IconUserCircle',
|
||||||
isCustom: false,
|
isCustom: false,
|
||||||
isActive: true,
|
isActive: true,
|
||||||
@ -100,8 +100,8 @@ export const mockedPeopleMetadata = {
|
|||||||
__typename: 'object',
|
__typename: 'object',
|
||||||
id: 'dd41deae-84d5-4a66-8947-260b0c72677c',
|
id: 'dd41deae-84d5-4a66-8947-260b0c72677c',
|
||||||
dataSourceId: 'cabbcaa6-05d6-41f4-920f-9144172a4f08',
|
dataSourceId: 'cabbcaa6-05d6-41f4-920f-9144172a4f08',
|
||||||
nameSingular: 'messageRecipient',
|
nameSingular: 'messageParticipant',
|
||||||
namePlural: 'messageRecipients',
|
namePlural: 'messageParticipants',
|
||||||
},
|
},
|
||||||
toFieldMetadataId: '88ab56e5-828e-4fb2-a37c-314b8803f361',
|
toFieldMetadataId: '88ab56e5-828e-4fb2-a37c-314b8803f361',
|
||||||
},
|
},
|
||||||
@ -1883,17 +1883,17 @@ export const mockedFavoritesMetadata = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const mockedMessageRecipientsMetadata = {
|
export const mockedMessageParticipantsMetadata = {
|
||||||
__typename: 'objectEdge',
|
__typename: 'objectEdge',
|
||||||
node: {
|
node: {
|
||||||
__typename: 'object',
|
__typename: 'object',
|
||||||
id: 'dd41deae-84d5-4a66-8947-260b0c72677c',
|
id: 'dd41deae-84d5-4a66-8947-260b0c72677c',
|
||||||
dataSourceId: 'cabbcaa6-05d6-41f4-920f-9144172a4f08',
|
dataSourceId: 'cabbcaa6-05d6-41f4-920f-9144172a4f08',
|
||||||
nameSingular: 'messageRecipient',
|
nameSingular: 'messageParticipant',
|
||||||
namePlural: 'messageRecipients',
|
namePlural: 'messageParticipants',
|
||||||
labelSingular: 'Message Recipient',
|
labelSingular: 'Message Participant',
|
||||||
labelPlural: 'Message Recipients',
|
labelPlural: 'Message Participants',
|
||||||
description: 'Message Recipients',
|
description: 'Message Participants',
|
||||||
icon: 'IconUserCircle',
|
icon: 'IconUserCircle',
|
||||||
isCustom: false,
|
isCustom: false,
|
||||||
isActive: true,
|
isActive: true,
|
||||||
@ -3144,9 +3144,9 @@ export const mockedWorkspaceMembersMetadata = {
|
|||||||
__typename: 'field',
|
__typename: 'field',
|
||||||
id: 'f13cce91-5f98-4eb0-8c6e-c1cf41ad168f',
|
id: 'f13cce91-5f98-4eb0-8c6e-c1cf41ad168f',
|
||||||
type: 'RELATION',
|
type: 'RELATION',
|
||||||
name: 'messageRecipients',
|
name: 'messageParticipants',
|
||||||
label: 'Message Recipients',
|
label: 'Message Participants',
|
||||||
description: 'Message Recipients',
|
description: 'Message Participants',
|
||||||
icon: 'IconUserCircle',
|
icon: 'IconUserCircle',
|
||||||
isCustom: false,
|
isCustom: false,
|
||||||
isActive: true,
|
isActive: true,
|
||||||
@ -3162,8 +3162,8 @@ export const mockedWorkspaceMembersMetadata = {
|
|||||||
__typename: 'object',
|
__typename: 'object',
|
||||||
id: 'dd41deae-84d5-4a66-8947-260b0c72677c',
|
id: 'dd41deae-84d5-4a66-8947-260b0c72677c',
|
||||||
dataSourceId: 'cabbcaa6-05d6-41f4-920f-9144172a4f08',
|
dataSourceId: 'cabbcaa6-05d6-41f4-920f-9144172a4f08',
|
||||||
nameSingular: 'messageRecipient',
|
nameSingular: 'messageParticipant',
|
||||||
namePlural: 'messageRecipients',
|
namePlural: 'messageParticipants',
|
||||||
},
|
},
|
||||||
toFieldMetadataId: '22883ca2-34e2-40ab-9e7b-fde5836cb5d2',
|
toFieldMetadataId: '22883ca2-34e2-40ab-9e7b-fde5836cb5d2',
|
||||||
},
|
},
|
||||||
@ -3927,9 +3927,9 @@ export const mockedMessagesMetadata = {
|
|||||||
__typename: 'field',
|
__typename: 'field',
|
||||||
id: '9c58971b-4e40-4f49-b125-ff014f909744',
|
id: '9c58971b-4e40-4f49-b125-ff014f909744',
|
||||||
type: 'RELATION',
|
type: 'RELATION',
|
||||||
name: 'messageRecipients',
|
name: 'messageParticipants',
|
||||||
label: 'Message Recipients',
|
label: 'Message Participants',
|
||||||
description: 'Message Recipients',
|
description: 'Message Participants',
|
||||||
icon: 'IconUserCircle',
|
icon: 'IconUserCircle',
|
||||||
isCustom: false,
|
isCustom: false,
|
||||||
isActive: true,
|
isActive: true,
|
||||||
@ -3945,8 +3945,8 @@ export const mockedMessagesMetadata = {
|
|||||||
__typename: 'object',
|
__typename: 'object',
|
||||||
id: 'dd41deae-84d5-4a66-8947-260b0c72677c',
|
id: 'dd41deae-84d5-4a66-8947-260b0c72677c',
|
||||||
dataSourceId: 'cabbcaa6-05d6-41f4-920f-9144172a4f08',
|
dataSourceId: 'cabbcaa6-05d6-41f4-920f-9144172a4f08',
|
||||||
nameSingular: 'messageRecipient',
|
nameSingular: 'messageParticipant',
|
||||||
namePlural: 'messageRecipients',
|
namePlural: 'messageParticipants',
|
||||||
},
|
},
|
||||||
toFieldMetadataId: '663612f4-7eb8-4b21-886e-730f3b047ee7',
|
toFieldMetadataId: '663612f4-7eb8-4b21-886e-730f3b047ee7',
|
||||||
},
|
},
|
||||||
|
|||||||
@ -28,8 +28,8 @@ export class TimelineMessagingService {
|
|||||||
last_message_subject,
|
last_message_subject,
|
||||||
last_message_body,
|
last_message_body,
|
||||||
last_message_received_at,
|
last_message_received_at,
|
||||||
last_message_recipient_handle,
|
last_message_participant_handle,
|
||||||
last_message_recipient_displayName
|
last_message_participant_displayName
|
||||||
FROM (
|
FROM (
|
||||||
SELECT
|
SELECT
|
||||||
mt.*,
|
mt.*,
|
||||||
@ -37,15 +37,15 @@ export class TimelineMessagingService {
|
|||||||
FIRST_VALUE(m."subject") OVER (PARTITION BY mt."id" ORDER BY m."receivedAt" DESC) AS last_message_subject,
|
FIRST_VALUE(m."subject") OVER (PARTITION BY mt."id" ORDER BY m."receivedAt" DESC) AS last_message_subject,
|
||||||
FIRST_VALUE(m."body") OVER (PARTITION BY mt."id" ORDER BY m."receivedAt" DESC) AS last_message_body,
|
FIRST_VALUE(m."body") OVER (PARTITION BY mt."id" ORDER BY m."receivedAt" DESC) AS last_message_body,
|
||||||
FIRST_VALUE(m."receivedAt") OVER (PARTITION BY mt."id" ORDER BY m."receivedAt" DESC) AS last_message_received_at,
|
FIRST_VALUE(m."receivedAt") OVER (PARTITION BY mt."id" ORDER BY m."receivedAt" DESC) AS last_message_received_at,
|
||||||
FIRST_VALUE(mr."handle") OVER (PARTITION BY mt."id" ORDER BY m."receivedAt" DESC) AS last_message_recipient_handle,
|
FIRST_VALUE(mr."handle") OVER (PARTITION BY mt."id" ORDER BY m."receivedAt" DESC) AS last_message_participant_handle,
|
||||||
FIRST_VALUE(mr."displayName") OVER (PARTITION BY mt."id" ORDER BY m."receivedAt" DESC) AS last_message_recipient_displayName,
|
FIRST_VALUE(mr."displayName") OVER (PARTITION BY mt."id" ORDER BY m."receivedAt" DESC) AS last_message_participant_displayName,
|
||||||
ROW_NUMBER() OVER (PARTITION BY mt."id" ORDER BY m."receivedAt" DESC) AS rn
|
ROW_NUMBER() OVER (PARTITION BY mt."id" ORDER BY m."receivedAt" DESC) AS rn
|
||||||
FROM
|
FROM
|
||||||
${dataSourceMetadata.schema}."messageThread" mt
|
${dataSourceMetadata.schema}."messageThread" mt
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
${dataSourceMetadata.schema}."message" m ON mt."id" = m."messageThreadId"
|
${dataSourceMetadata.schema}."message" m ON mt."id" = m."messageThreadId"
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
${dataSourceMetadata.schema}."messageRecipient" mr ON m."id" = mr."messageId"
|
${dataSourceMetadata.schema}."messageParticipant" mr ON m."id" = mr."messageId"
|
||||||
WHERE
|
WHERE
|
||||||
mr."personId" IN (SELECT unnest($1::uuid[]))
|
mr."personId" IN (SELECT unnest($1::uuid[]))
|
||||||
) AS subquery
|
) AS subquery
|
||||||
@ -61,7 +61,7 @@ export class TimelineMessagingService {
|
|||||||
const formattedMessageThreads = messageThreads.map((messageThread) => {
|
const formattedMessageThreads = messageThreads.map((messageThread) => {
|
||||||
return {
|
return {
|
||||||
read: true,
|
read: true,
|
||||||
senderName: messageThread.last_message_recipient_handle,
|
senderName: messageThread.last_message_participant_handle,
|
||||||
senderPictureUrl: '',
|
senderPictureUrl: '',
|
||||||
numberOfMessagesInThread: messageThread.message_count,
|
numberOfMessagesInThread: messageThread.message_count,
|
||||||
subject: messageThread.last_message_subject,
|
subject: messageThread.last_message_subject,
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { simpleParser, AddressObject } from 'mailparser';
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
GmailMessage,
|
GmailMessage,
|
||||||
Recipient,
|
Participant,
|
||||||
} from 'src/workspace/messaging/types/gmailMessage';
|
} from 'src/workspace/messaging/types/gmailMessage';
|
||||||
import { MessageQuery } from 'src/workspace/messaging/types/messageOrThreadQuery';
|
import { MessageQuery } from 'src/workspace/messaging/types/messageOrThreadQuery';
|
||||||
import { GmailMessageParsedResponse } from 'src/workspace/messaging/types/gmailMessageParsedResponse';
|
import { GmailMessageParsedResponse } from 'src/workspace/messaging/types/gmailMessageParsedResponse';
|
||||||
@ -190,11 +190,11 @@ export class FetchMessagesByBatchesService {
|
|||||||
if (!from) throw new Error('From value is missing');
|
if (!from) throw new Error('From value is missing');
|
||||||
if (!to) throw new Error('To value is missing');
|
if (!to) throw new Error('To value is missing');
|
||||||
|
|
||||||
const recipients = [
|
const participants = [
|
||||||
...this.formatAddressObjectAsRecipients(from, 'from'),
|
...this.formatAddressObjectAsParticipants(from, 'from'),
|
||||||
...this.formatAddressObjectAsRecipients(to, 'to'),
|
...this.formatAddressObjectAsParticipants(to, 'to'),
|
||||||
...this.formatAddressObjectAsRecipients(cc, 'cc'),
|
...this.formatAddressObjectAsParticipants(cc, 'cc'),
|
||||||
...this.formatAddressObjectAsRecipients(bcc, 'bcc'),
|
...this.formatAddressObjectAsParticipants(bcc, 'bcc'),
|
||||||
];
|
];
|
||||||
|
|
||||||
const messageFromGmail: GmailMessage = {
|
const messageFromGmail: GmailMessage = {
|
||||||
@ -206,7 +206,7 @@ export class FetchMessagesByBatchesService {
|
|||||||
internalDate,
|
internalDate,
|
||||||
fromHandle: from.value[0].address || '',
|
fromHandle: from.value[0].address || '',
|
||||||
fromDisplayName: from.value[0].name || '',
|
fromDisplayName: from.value[0].name || '',
|
||||||
recipients,
|
participants,
|
||||||
text: text || '',
|
text: text || '',
|
||||||
html: html || '',
|
html: html || '',
|
||||||
attachments,
|
attachments,
|
||||||
@ -234,14 +234,14 @@ export class FetchMessagesByBatchesService {
|
|||||||
return Array.isArray(addressObject) ? addressObject : [addressObject];
|
return Array.isArray(addressObject) ? addressObject : [addressObject];
|
||||||
}
|
}
|
||||||
|
|
||||||
formatAddressObjectAsRecipients(
|
formatAddressObjectAsParticipants(
|
||||||
addressObject: AddressObject | AddressObject[] | undefined,
|
addressObject: AddressObject | AddressObject[] | undefined,
|
||||||
role: 'from' | 'to' | 'cc' | 'bcc',
|
role: 'from' | 'to' | 'cc' | 'bcc',
|
||||||
): Recipient[] {
|
): Participant[] {
|
||||||
if (!addressObject) return [];
|
if (!addressObject) return [];
|
||||||
const addressObjects = this.formatAddressObjectAsArray(addressObject);
|
const addressObjects = this.formatAddressObjectAsArray(addressObject);
|
||||||
|
|
||||||
const recipients = addressObjects.map((addressObject) => {
|
const participants = addressObjects.map((addressObject) => {
|
||||||
const emailAdresses = addressObject.value;
|
const emailAdresses = addressObject.value;
|
||||||
|
|
||||||
return emailAdresses.map((emailAddress) => {
|
return emailAdresses.map((emailAddress) => {
|
||||||
@ -255,7 +255,7 @@ export class FetchMessagesByBatchesService {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
return recipients.flat();
|
return participants.flat();
|
||||||
}
|
}
|
||||||
|
|
||||||
async formatBatchResponsesAsGmailMessages(
|
async formatBatchResponsesAsGmailMessages(
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import { DataSourceService } from 'src/metadata/data-source/data-source.service'
|
|||||||
import { DataSourceEntity } from 'src/metadata/data-source/data-source.entity';
|
import { DataSourceEntity } from 'src/metadata/data-source/data-source.entity';
|
||||||
import {
|
import {
|
||||||
GmailMessage,
|
GmailMessage,
|
||||||
Recipient,
|
Participant,
|
||||||
} from 'src/workspace/messaging/types/gmailMessage';
|
} from 'src/workspace/messaging/types/gmailMessage';
|
||||||
import { GmailThread } from 'src/workspace/messaging/types/gmailThread';
|
import { GmailThread } from 'src/workspace/messaging/types/gmailThread';
|
||||||
import { MessageQuery } from 'src/workspace/messaging/types/messageOrThreadQuery';
|
import { MessageQuery } from 'src/workspace/messaging/types/messageOrThreadQuery';
|
||||||
@ -79,7 +79,7 @@ export class MessagingUtilsService {
|
|||||||
internalDate,
|
internalDate,
|
||||||
fromHandle,
|
fromHandle,
|
||||||
fromDisplayName,
|
fromDisplayName,
|
||||||
recipients,
|
participants,
|
||||||
text,
|
text,
|
||||||
} = message;
|
} = message;
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ export class MessagingUtilsService {
|
|||||||
);
|
);
|
||||||
|
|
||||||
await manager.query(
|
await manager.query(
|
||||||
`INSERT INTO ${dataSourceMetadata.schema}."messageRecipient" ("messageId", "role", "handle", "displayName", "personId", "workspaceMemberId") VALUES ($1, $2, $3, $4, $5, $6)`,
|
`INSERT INTO ${dataSourceMetadata.schema}."messageParticipant" ("messageId", "role", "handle", "displayName", "personId", "workspaceMemberId") VALUES ($1, $2, $3, $4, $5, $6)`,
|
||||||
[
|
[
|
||||||
messageId,
|
messageId,
|
||||||
'from',
|
'from',
|
||||||
@ -138,8 +138,8 @@ export class MessagingUtilsService {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
await this.saveMessageRecipients(
|
await this.saveMessageParticipants(
|
||||||
recipients,
|
participants,
|
||||||
dataSourceMetadata,
|
dataSourceMetadata,
|
||||||
messageId,
|
messageId,
|
||||||
manager,
|
manager,
|
||||||
@ -148,40 +148,40 @@ export class MessagingUtilsService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async saveMessageRecipients(
|
public async saveMessageParticipants(
|
||||||
recipients: Recipient[],
|
participants: Participant[],
|
||||||
dataSourceMetadata: DataSourceEntity,
|
dataSourceMetadata: DataSourceEntity,
|
||||||
messageId: string,
|
messageId: string,
|
||||||
manager: EntityManager,
|
manager: EntityManager,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (!recipients) return;
|
if (!participants) return;
|
||||||
|
|
||||||
for (const recipient of recipients) {
|
for (const participant of participants) {
|
||||||
const recipientPerson = await manager.query(
|
const participantPerson = await manager.query(
|
||||||
`SELECT * FROM ${dataSourceMetadata.schema}."person" WHERE "email" = $1`,
|
`SELECT * FROM ${dataSourceMetadata.schema}."person" WHERE "email" = $1`,
|
||||||
[recipient.handle],
|
[participant.handle],
|
||||||
);
|
);
|
||||||
|
|
||||||
const recipientPersonId = recipientPerson[0]?.id;
|
const participantPersonId = participantPerson[0]?.id;
|
||||||
|
|
||||||
const workspaceMember = await manager.query(
|
const workspaceMember = await manager.query(
|
||||||
`SELECT "workspaceMember"."id" FROM ${dataSourceMetadata.schema}."workspaceMember"
|
`SELECT "workspaceMember"."id" FROM ${dataSourceMetadata.schema}."workspaceMember"
|
||||||
JOIN ${dataSourceMetadata.schema}."connectedAccount" ON ${dataSourceMetadata.schema}."workspaceMember"."id" = ${dataSourceMetadata.schema}."connectedAccount"."accountOwnerId"
|
JOIN ${dataSourceMetadata.schema}."connectedAccount" ON ${dataSourceMetadata.schema}."workspaceMember"."id" = ${dataSourceMetadata.schema}."connectedAccount"."accountOwnerId"
|
||||||
WHERE ${dataSourceMetadata.schema}."connectedAccount"."handle" = $1`,
|
WHERE ${dataSourceMetadata.schema}."connectedAccount"."handle" = $1`,
|
||||||
[recipient.handle],
|
[participant.handle],
|
||||||
);
|
);
|
||||||
|
|
||||||
const recipientWorkspaceMemberId = workspaceMember[0]?.id;
|
const participantWorkspaceMemberId = workspaceMember[0]?.id;
|
||||||
|
|
||||||
await manager.query(
|
await manager.query(
|
||||||
`INSERT INTO ${dataSourceMetadata.schema}."messageRecipient" ("messageId", "role", "handle", "displayName", "personId", "workspaceMemberId") VALUES ($1, $2, $3, $4, $5, $6)`,
|
`INSERT INTO ${dataSourceMetadata.schema}."messageParticipant" ("messageId", "role", "handle", "displayName", "personId", "workspaceMemberId") VALUES ($1, $2, $3, $4, $5, $6)`,
|
||||||
[
|
[
|
||||||
messageId,
|
messageId,
|
||||||
recipient.role,
|
participant.role,
|
||||||
recipient.handle,
|
participant.handle,
|
||||||
recipient.displayName,
|
participant.displayName,
|
||||||
recipientPersonId,
|
participantPersonId,
|
||||||
recipientWorkspaceMemberId,
|
participantWorkspaceMemberId,
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,13 +9,13 @@ export type GmailMessage = {
|
|||||||
internalDate: string;
|
internalDate: string;
|
||||||
fromHandle: string;
|
fromHandle: string;
|
||||||
fromDisplayName: string;
|
fromDisplayName: string;
|
||||||
recipients: Recipient[];
|
participants: Participant[];
|
||||||
text: string;
|
text: string;
|
||||||
html: string;
|
html: string;
|
||||||
attachments: Attachment[];
|
attachments: Attachment[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Recipient = {
|
export type Participant = {
|
||||||
role: 'from' | 'to' | 'cc' | 'bcc';
|
role: 'from' | 'to' | 'cc' | 'bcc';
|
||||||
handle: string;
|
handle: string;
|
||||||
displayName: string;
|
displayName: string;
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import { CompanyObjectMetadata } from 'src/workspace/workspace-sync-metadata/sta
|
|||||||
import { ConnectedAccountObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/connected-account.object-metadata';
|
import { ConnectedAccountObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/connected-account.object-metadata';
|
||||||
import { FavoriteObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/favorite.object-metadata';
|
import { FavoriteObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/favorite.object-metadata';
|
||||||
import { MessageChannelObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/message-channel.object-metadata';
|
import { MessageChannelObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/message-channel.object-metadata';
|
||||||
import { MessageRecipientObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/message-recipient.object-metadata';
|
import { MessageParticipantObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/message-participant.object-metadata';
|
||||||
import { MessageThreadObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/message-thread.object-metadata';
|
import { MessageThreadObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/message-thread.object-metadata';
|
||||||
import { MessageObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/message.object-metadata';
|
import { MessageObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/message.object-metadata';
|
||||||
import { OpportunityObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/opportunity.object-metadata';
|
import { OpportunityObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/opportunity.object-metadata';
|
||||||
@ -41,5 +41,5 @@ export const standardObjectMetadata = [
|
|||||||
MessageThreadObjectMetadata,
|
MessageThreadObjectMetadata,
|
||||||
MessageObjectMetadata,
|
MessageObjectMetadata,
|
||||||
MessageChannelObjectMetadata,
|
MessageChannelObjectMetadata,
|
||||||
MessageRecipientObjectMetadata,
|
MessageParticipantObjectMetadata,
|
||||||
];
|
];
|
||||||
|
|||||||
@ -10,17 +10,17 @@ import { PersonObjectMetadata } from 'src/workspace/workspace-sync-metadata/stan
|
|||||||
import { WorkspaceMemberObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/workspace-member.object-metadata';
|
import { WorkspaceMemberObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/workspace-member.object-metadata';
|
||||||
|
|
||||||
@ObjectMetadata({
|
@ObjectMetadata({
|
||||||
namePlural: 'messageRecipients',
|
namePlural: 'messageParticipants',
|
||||||
labelSingular: 'Message Recipient',
|
labelSingular: 'Message Participant',
|
||||||
labelPlural: 'Message Recipients',
|
labelPlural: 'Message Participants',
|
||||||
description: 'Message Recipients',
|
description: 'Message Participants',
|
||||||
icon: 'IconUserCircle',
|
icon: 'IconUserCircle',
|
||||||
})
|
})
|
||||||
@Gate({
|
@Gate({
|
||||||
featureFlag: 'IS_MESSAGING_ENABLED',
|
featureFlag: 'IS_MESSAGING_ENABLED',
|
||||||
})
|
})
|
||||||
@IsSystem()
|
@IsSystem()
|
||||||
export class MessageRecipientObjectMetadata extends BaseObjectMetadata {
|
export class MessageParticipantObjectMetadata extends BaseObjectMetadata {
|
||||||
@FieldMetadata({
|
@FieldMetadata({
|
||||||
type: FieldMetadataType.RELATION,
|
type: FieldMetadataType.RELATION,
|
||||||
label: 'Message',
|
label: 'Message',
|
||||||
@ -7,7 +7,7 @@ import { IsSystem } from 'src/workspace/workspace-sync-metadata/decorators/is-sy
|
|||||||
import { ObjectMetadata } from 'src/workspace/workspace-sync-metadata/decorators/object-metadata.decorator';
|
import { ObjectMetadata } from 'src/workspace/workspace-sync-metadata/decorators/object-metadata.decorator';
|
||||||
import { RelationMetadata } from 'src/workspace/workspace-sync-metadata/decorators/relation-metadata.decorator';
|
import { RelationMetadata } from 'src/workspace/workspace-sync-metadata/decorators/relation-metadata.decorator';
|
||||||
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
|
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
|
||||||
import { MessageRecipientObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/message-recipient.object-metadata';
|
import { MessageParticipantObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/message-participant.object-metadata';
|
||||||
import { MessageThreadObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/message-thread.object-metadata';
|
import { MessageThreadObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/message-thread.object-metadata';
|
||||||
|
|
||||||
@ObjectMetadata({
|
@ObjectMetadata({
|
||||||
@ -90,15 +90,15 @@ export class MessageObjectMetadata extends BaseObjectMetadata {
|
|||||||
|
|
||||||
@FieldMetadata({
|
@FieldMetadata({
|
||||||
type: FieldMetadataType.RELATION,
|
type: FieldMetadataType.RELATION,
|
||||||
label: 'Message Recipients',
|
label: 'Message Participants',
|
||||||
description: 'Message Recipients',
|
description: 'Message Participants',
|
||||||
icon: 'IconUserCircle',
|
icon: 'IconUserCircle',
|
||||||
})
|
})
|
||||||
@RelationMetadata({
|
@RelationMetadata({
|
||||||
type: RelationMetadataType.ONE_TO_MANY,
|
type: RelationMetadataType.ONE_TO_MANY,
|
||||||
objectName: 'messageRecipient',
|
objectName: 'messageParticipant',
|
||||||
inverseSideFieldName: 'message',
|
inverseSideFieldName: 'message',
|
||||||
})
|
})
|
||||||
@IsNullable()
|
@IsNullable()
|
||||||
messageRecipients: MessageRecipientObjectMetadata[];
|
messageParticipants: MessageParticipantObjectMetadata[];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,7 +13,7 @@ import { AttachmentObjectMetadata } from 'src/workspace/workspace-sync-metadata/
|
|||||||
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
|
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
|
||||||
import { CompanyObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/company.object-metadata';
|
import { CompanyObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/company.object-metadata';
|
||||||
import { FavoriteObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/favorite.object-metadata';
|
import { FavoriteObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/favorite.object-metadata';
|
||||||
import { MessageRecipientObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/message-recipient.object-metadata';
|
import { MessageParticipantObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/message-participant.object-metadata';
|
||||||
import { OpportunityObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/opportunity.object-metadata';
|
import { OpportunityObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/opportunity.object-metadata';
|
||||||
|
|
||||||
@ObjectMetadata({
|
@ObjectMetadata({
|
||||||
@ -176,18 +176,18 @@ export class PersonObjectMetadata extends BaseObjectMetadata {
|
|||||||
|
|
||||||
@FieldMetadata({
|
@FieldMetadata({
|
||||||
type: FieldMetadataType.RELATION,
|
type: FieldMetadataType.RELATION,
|
||||||
label: 'Message Recipients',
|
label: 'Message Participants',
|
||||||
description: 'Message Recipients',
|
description: 'Message Participants',
|
||||||
icon: 'IconUserCircle',
|
icon: 'IconUserCircle',
|
||||||
})
|
})
|
||||||
@RelationMetadata({
|
@RelationMetadata({
|
||||||
type: RelationMetadataType.ONE_TO_MANY,
|
type: RelationMetadataType.ONE_TO_MANY,
|
||||||
objectName: 'messageRecipient',
|
objectName: 'messageParticipant',
|
||||||
inverseSideFieldName: 'person',
|
inverseSideFieldName: 'person',
|
||||||
})
|
})
|
||||||
@Gate({
|
@Gate({
|
||||||
featureFlag: 'IS_MESSAGING_ENABLED',
|
featureFlag: 'IS_MESSAGING_ENABLED',
|
||||||
})
|
})
|
||||||
@IsNullable()
|
@IsNullable()
|
||||||
messageRecipients: MessageRecipientObjectMetadata[];
|
messageParticipants: MessageParticipantObjectMetadata[];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,7 +14,7 @@ import { CommentObjectMetadata } from 'src/workspace/workspace-sync-metadata/sta
|
|||||||
import { CompanyObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/company.object-metadata';
|
import { CompanyObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/company.object-metadata';
|
||||||
import { ConnectedAccountObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/connected-account.object-metadata';
|
import { ConnectedAccountObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/connected-account.object-metadata';
|
||||||
import { FavoriteObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/favorite.object-metadata';
|
import { FavoriteObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/favorite.object-metadata';
|
||||||
import { MessageRecipientObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/message-recipient.object-metadata';
|
import { MessageParticipantObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/message-participant.object-metadata';
|
||||||
|
|
||||||
@ObjectMetadata({
|
@ObjectMetadata({
|
||||||
namePlural: 'workspaceMembers',
|
namePlural: 'workspaceMembers',
|
||||||
@ -178,18 +178,18 @@ export class WorkspaceMemberObjectMetadata extends BaseObjectMetadata {
|
|||||||
|
|
||||||
@FieldMetadata({
|
@FieldMetadata({
|
||||||
type: FieldMetadataType.RELATION,
|
type: FieldMetadataType.RELATION,
|
||||||
label: 'Message Recipients',
|
label: 'Message Participants',
|
||||||
description: 'Message Recipients',
|
description: 'Message Participants',
|
||||||
icon: 'IconUserCircle',
|
icon: 'IconUserCircle',
|
||||||
})
|
})
|
||||||
@RelationMetadata({
|
@RelationMetadata({
|
||||||
type: RelationMetadataType.ONE_TO_MANY,
|
type: RelationMetadataType.ONE_TO_MANY,
|
||||||
objectName: 'messageRecipient',
|
objectName: 'messageParticipant',
|
||||||
inverseSideFieldName: 'workspaceMember',
|
inverseSideFieldName: 'workspaceMember',
|
||||||
})
|
})
|
||||||
@Gate({
|
@Gate({
|
||||||
featureFlag: 'IS_MESSAGING_ENABLED',
|
featureFlag: 'IS_MESSAGING_ENABLED',
|
||||||
})
|
})
|
||||||
@IsNullable()
|
@IsNullable()
|
||||||
messageRecipients: MessageRecipientObjectMetadata[];
|
messageParticipants: MessageParticipantObjectMetadata[];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user