feat: add Autotask tags sync (tag groups, tags, ticket tag associations)
- Migration 057: autotask_tag_groups, autotask_tags, and junction tables (ticket_tags, company_tags, configuration_item_tags, contact_tags) - Add TAG_GROUPS and TAGS to EntityType enum and dependency map - Add mapTagGroup() and mapTag() entity mapper functions - Add syncTagGroups(), syncTags(), syncTicketTagAssociations() methods - Wire TicketTagAssociations bulk sync into full/incremental sync flow - Add 'exist' operator to QueryFilter type - No FK on ticket_id (tagged tickets may be outside 2yr sync window) Synced: 26 tag groups, 7299 tags, 10141 ticket-tag associations
This commit is contained in:
parent
fe9f806c50
commit
ff9e34cafe
8 changed files with 238 additions and 3 deletions
|
|
@ -69,6 +69,8 @@ export function getAllEntitiesInOrder(): EntityType[] {
|
|||
EntityType.AUTOTASK_SERVICES,
|
||||
EntityType.BILLING_ITEMS,
|
||||
EntityType.TIME_ENTRIES,
|
||||
EntityType.TAG_GROUPS,
|
||||
EntityType.TAGS,
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
@ -122,6 +124,8 @@ export function getAutotaskEntityName(entity: EntityType): string {
|
|||
[EntityType.AUTOTASK_SERVICES]: 'Services',
|
||||
[EntityType.TIME_ENTRIES]: 'TimeEntries',
|
||||
[EntityType.TICKET_NOTES]: 'TicketNotes',
|
||||
[EntityType.TAG_GROUPS]: 'TagGroups',
|
||||
[EntityType.TAGS]: 'Tags',
|
||||
};
|
||||
|
||||
return mapping[entity] || entity;
|
||||
|
|
@ -171,6 +175,8 @@ export function getLastModifiedField(entity: EntityType): string {
|
|||
[EntityType.QUEUES]: 'lastModifiedDate',
|
||||
[EntityType.PRIORITIES]: 'lastModifiedDate',
|
||||
[EntityType.TICKET_CATEGORIES]: 'lastModifiedDate',
|
||||
[EntityType.TAG_GROUPS]: 'lastModifiedDate',
|
||||
[EntityType.TAGS]: 'lastModifiedDateTime',
|
||||
};
|
||||
|
||||
return mapping[entity] || 'lastModifiedDate';
|
||||
|
|
@ -203,6 +209,8 @@ export function getActiveField(entity: EntityType): string | null {
|
|||
[EntityType.QUEUES]: 'isActive',
|
||||
[EntityType.PRIORITIES]: 'isActive',
|
||||
[EntityType.TICKET_CATEGORIES]: 'isActive',
|
||||
[EntityType.TAG_GROUPS]: 'isActive',
|
||||
[EntityType.TAGS]: 'isActive',
|
||||
};
|
||||
|
||||
return mapping[entity] || null;
|
||||
|
|
@ -288,6 +296,8 @@ export function buildDateRangeFilter(
|
|||
[EntityType.CONTACTS]: null,
|
||||
[EntityType.CONFIGURATION_ITEMS]: null,
|
||||
[EntityType.TICKET_NOTES]: null,
|
||||
[EntityType.TAG_GROUPS]: null,
|
||||
[EntityType.TAGS]: null,
|
||||
[EntityType.STATUSES]: null,
|
||||
[EntityType.ISSUE_TYPES]: null,
|
||||
[EntityType.SUB_ISSUE_TYPES]: null,
|
||||
|
|
@ -486,6 +496,8 @@ export function getEntityDisplayName(entity: EntityType): string {
|
|||
[EntityType.AUTOTASK_SERVICES]: 'Autotask Services',
|
||||
[EntityType.TIME_ENTRIES]: 'Time Entries',
|
||||
[EntityType.TICKET_NOTES]: 'Ticket Notes',
|
||||
[EntityType.TAG_GROUPS]: 'Tag Groups',
|
||||
[EntityType.TAGS]: 'Tags',
|
||||
};
|
||||
|
||||
return mapping[entity] || entity;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue