4736 add listener on calendarchannel isautocontactcreationenabled (#4913)

Closes #4736
This commit is contained in:
bosiraphael
2024-04-11 17:57:19 +02:00
committed by GitHub
parent 7211730570
commit 8853408264
11 changed files with 186 additions and 62 deletions

View File

@ -7,10 +7,7 @@ import { PersonRepository } from 'src/modules/person/repositories/person.reposit
import { PersonObjectMetadata } from 'src/modules/person/standard-objects/person.object-metadata';
import { WorkspaceDataSourceService } from 'src/engine/workspace-datasource/workspace-datasource.service';
import { getFlattenedValuesAndValuesStringForBatchRawQuery } from 'src/modules/calendar/utils/getFlattenedValuesAndValuesStringForBatchRawQuery.util';
import {
CalendarEventParticipant,
CalendarEventParticipantWithId,
} from 'src/modules/calendar/types/calendar-event';
import { CalendarEventParticipant } from 'src/modules/calendar/types/calendar-event';
import { AddPersonIdAndWorkspaceMemberIdService } from 'src/modules/connected-account/services/add-person-id-and-workspace-member-id/add-person-id-and-workspace-member-id.service';
import { CalendarEventParticipantRepository } from 'src/modules/calendar/repositories/calendar-event-participant.repository';
import { CalendarEventParticipantObjectMetadata } from 'src/modules/calendar/standard-objects/calendar-event-participant.object-metadata';
@ -26,11 +23,15 @@ export class CalendarEventParticipantService {
private readonly addPersonIdAndWorkspaceMemberIdService: AddPersonIdAndWorkspaceMemberIdService,
) {}
public async updateCalendarEventParticipantsAfterContactCreation(
participants: CalendarEventParticipantWithId[],
public async updateCalendarEventParticipantsAfterPeopleCreation(
workspaceId: string,
transactionManager?: EntityManager,
): Promise<void> {
const participants =
await this.calendarEventParticipantRepository.getWithoutPersonIdAndWorkspaceMemberId(
workspaceId,
);
if (!participants) return;
const dataSourceSchema =