Skip to content

The open alternative to Salesforce, designed for AI.

5613 add throttlepauseuntil and throttlefailurecount fields to messagechannel and calendarchannel (#5713)

bosiraphael2d12984db487
diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids.ts b/packages/twenty-server/src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids.ts
index c051213ae07..0acd8fe31f9 100644
--- a/packages/twenty-server/src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids.ts
@@ -70,6 +70,8 @@ export const CALENDAR_CHANNEL_STANDARD_FIELD_IDS = {
isSyncEnabled: '20202020-fe19-4818-8854-21f7b1b43395',
syncCursor: '20202020-bac2-4852-a5cb-7a7898992b70',
calendarChannelEventAssociations: '20202020-afb0-4a9f-979f-2d5087d71d09',
+ throttlePauseUntil: '20202020-16e8-40ca-be79-a3af4787af2c',
+ throttleFailureCount: '20202020-525c-4b76-b9bd-0dd57fd11d61',
};
export const CALENDAR_EVENT_PARTICIPANT_STANDARD_FIELD_IDS = {
@@ -208,6 +210,8 @@ export const MESSAGE_CHANNEL_STANDARD_FIELD_IDS = {
syncStatus: '20202020-56a1-4f7e-9880-a8493bb899cc',
syncSubStatus: '20202020-7979-4b08-89fe-99cb5e698767',
ongoingSyncStartedAt: '20202020-8c61-4a42-ae63-73c1c3c52e06',
+ throttlePauseUntil: '20202020-a8cb-475b-868c-b83538614df4',
+ throttleFailureCount: '20202020-0291-42be-9ad0-d578a51684ab',
};
export const MESSAGE_PARTICIPANT_STANDARD_FIELD_IDS = {
diff --git a/packages/twenty-server/src/modules/calendar/standard-objects/calendar-channel.workspace-entity.ts b/packages/twenty-server/src/modules/calendar/standard-objects/calendar-channel.workspace-entity.ts
index 0fff9a88643..0bf11a6ae74 100644
--- a/packages/twenty-server/src/modules/calendar/standard-objects/calendar-channel.workspace-entity.ts
+++ b/packages/twenty-server/src/modules/calendar/standard-objects/calendar-channel.workspace-entity.ts
@@ -15,6 +15,7 @@ import { WorkspaceIsSystem } from 'src/engine/twenty-orm/decorators/workspace-is
import { WorkspaceIsNotAuditLogged } from 'src/engine/twenty-orm/decorators/workspace-is-not-audit-logged.decorator';
import { WorkspaceField } from 'src/engine/twenty-orm/decorators/workspace-field.decorator';
import { WorkspaceRelation } from 'src/engine/twenty-orm/decorators/workspace-relation.decorator';
+import { WorkspaceIsNullable } from 'src/engine/twenty-orm/decorators/workspace-is-nullable.decorator';
export enum CalendarChannelVisibility {
METADATA = 'METADATA',
@@ -96,6 +97,26 @@ export class CalendarChannelWorkspaceEntity extends BaseWorkspaceEntity {
})
syncCursor: string;
+ @WorkspaceField({
+ standardId: CALENDAR_CHANNEL_STANDARD_FIELD_IDS.throttlePauseUntil,
+ type: FieldMetadataType.DATE_TIME,
+ label: 'Throttle Pause Until',
+ description: 'Throttle Pause Until',
+ icon: 'IconPlayerPause',
+ })
+ @WorkspaceIsNullable()
+ throttlePauseUntil: Date;
+
+ @WorkspaceField({
+ standardId: CALENDAR_CHANNEL_STANDARD_FIELD_IDS.throttleFailureCount,
+ type: FieldMetadataType.NUMBER,
+ label: 'Throttle Failure Count',
+ description: 'Throttle Failure Count',
+ icon: 'IconX',
+ defaultValue: 0,
+ })
+ throttleFailureCount: number;
+
@WorkspaceRelation({
standardId: CALENDAR_CHANNEL_STANDARD_FIELD_IDS.connectedAccount,
type: RelationMetadataType.MANY_TO_ONE,
diff --git a/packages/twenty-server/src/modules/messaging/common/standard-objects/message-channel.workspace-entity.ts b/packages/twenty-server/src/modules/messaging/common/standard-objects/message-channel.workspace-entity.ts
index b457677a6b2..ae24cc6020e 100644
--- a/packages/twenty-server/src/modules/messaging/common/standard-objects/message-channel.workspace-entity.ts
+++ b/packages/twenty-server/src/modules/messaging/common/standard-objects/message-channel.workspace-entity.ts
@@ -284,6 +284,26 @@ export class MessageChannelWorkspaceEntity extends BaseWorkspaceEntity {
@WorkspaceIsNullable()
ongoingSyncStartedAt: string;
+ @WorkspaceField({
+ standardId: MESSAGE_CHANNEL_STANDARD_FIELD_IDS.throttlePauseUntil,
+ type: FieldMetadataType.DATE_TIME,
+ label: 'Throttle Pause Until',
+ description: 'Throttle Pause Until',
+ icon: 'IconPlayerPause',
+ })
+ @WorkspaceIsNullable()
+ throttlePauseUntil: Date;
+
+ @WorkspaceField({
+ standardId: MESSAGE_CHANNEL_STANDARD_FIELD_IDS.throttleFailureCount,
+ type: FieldMetadataType.NUMBER,
+ label: 'Throttle Failure Count',
+ description: 'Throttle Failure Count',
+ icon: 'IconX',
+ defaultValue: 0,
+ })
+ throttleFailureCount: number;
+
@WorkspaceRelation({
standardId: MESSAGE_CHANNEL_STANDARD_FIELD_IDS.connectedAccount,
type: RelationMetadataType.MANY_TO_ONE,