5477 - Introduce syncsubstatus in db to refactor gmail sync behavior (#5479)

Closes #5477
This commit is contained in:
bosiraphael 2024-05-20 17:19:21 +02:00 committed by GitHub
parent 737fffefbd
commit b5d3396ea9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 53 additions and 3 deletions

View File

@ -206,6 +206,7 @@ export const MESSAGE_CHANNEL_STANDARD_FIELD_IDS = {
syncCursor: '20202020-79d1-41cf-b738-bcf5ed61e256',
syncedAt: '20202020-263d-4c6b-ad51-137ada56f7d4',
syncStatus: '20202020-56a1-4f7e-9880-a8493bb899cc',
syncSubStatus: '20202020-7979-4b08-89fe-99cb5e698767',
ongoingSyncStartedAt: '20202020-8c61-4a42-ae63-73c1c3c52e06',
};

View File

@ -24,6 +24,14 @@ export enum MessageChannelSyncStatus {
FAILED = 'FAILED',
}
export enum MessageChannelSyncSubStatus {
FULL_MESSAGES_LIST_FETCH_PENDING = 'FULL_MESSAGES_LIST_FETCH_PENDING',
PARTIAL_MESSAGES_LIST_FETCH_PENDING = 'PARTIAL_MESSAGES_LIST_FETCH_PENDING',
MESSAGES_LIST_FETCH_ONGOING = 'MESSAGES_LIST_FETCH_ONGOING',
MESSAGES_IMPORT_PENDING = 'MESSAGES_IMPORT_PENDING',
MESSAGES_IMPORT_ONGOING = 'MESSAGES_IMPORT_ONGOING',
}
export enum MessageChannelVisibility {
METADATA = 'metadata',
SUBJECT = 'subject',
@ -151,9 +159,9 @@ export class MessageChannelWorkspaceEntity extends BaseWorkspaceEntity {
@WorkspaceField({
standardId: MESSAGE_CHANNEL_STANDARD_FIELD_IDS.syncStatus,
type: FieldMetadataType.SELECT,
label: 'Last sync status',
description: 'Last sync status',
icon: 'IconHistory',
label: 'Sync status',
description: 'Sync status',
icon: 'IconStatusChange',
options: [
{
value: MessageChannelSyncStatus.PENDING,
@ -184,6 +192,47 @@ export class MessageChannelWorkspaceEntity extends BaseWorkspaceEntity {
@WorkspaceIsNullable()
syncStatus: MessageChannelSyncStatus;
@WorkspaceField({
standardId: MESSAGE_CHANNEL_STANDARD_FIELD_IDS.syncSubStatus,
type: FieldMetadataType.SELECT,
label: 'Sync sub status',
description: 'Sync sub status',
icon: 'IconStatusChange',
options: [
{
value: MessageChannelSyncSubStatus.FULL_MESSAGES_LIST_FETCH_PENDING,
label: 'Full messages list fetch pending',
position: 0,
color: 'blue',
},
{
value: MessageChannelSyncSubStatus.PARTIAL_MESSAGES_LIST_FETCH_PENDING,
label: 'Partial messages list fetch pending',
position: 1,
color: 'blue',
},
{
value: MessageChannelSyncSubStatus.MESSAGES_LIST_FETCH_ONGOING,
label: 'Messages list fetch ongoing',
position: 2,
color: 'orange',
},
{
value: MessageChannelSyncSubStatus.MESSAGES_IMPORT_PENDING,
label: 'Messages import pending',
position: 3,
color: 'blue',
},
{
value: MessageChannelSyncSubStatus.MESSAGES_IMPORT_ONGOING,
label: 'Messages import ongoing',
position: 4,
color: 'orange',
},
],
})
syncSubStatus: MessageChannelSyncSubStatus;
@WorkspaceField({
standardId: MESSAGE_CHANNEL_STANDARD_FIELD_IDS.ongoingSyncStartedAt,
type: FieldMetadataType.DATE_TIME,