fix: correct Autotask API field names for incremental sync

Fixed Autotask API errors for Billing Items and Time Entries during
incremental syncs by using the correct field names:

- Billing Items: Changed from 'createDate' to 'itemDate'
- Time Entries: Changed from 'lastModifiedDate' to 'dateWorked'

These field names match what's used in full sync filters and are
accepted by the Autotask API.

Errors fixed:
- 'Unable to find createDate in the BillingItem Entity'
- 'Unable to find lastModifiedDate in the TimeEntry Entity'

This allows incremental syncs to work properly for these entities.
This commit is contained in:
root 2026-01-26 10:37:10 -05:00
parent bac9797845
commit 43e8c74074

View file

@ -123,7 +123,7 @@ export function isPicklistEntity(entity: EntityType): boolean {
*/
export function getLastModifiedField(entity: EntityType): string {
const mapping: Record<EntityType, string> = {
[EntityType.COMPANIES]: 'lastTrackedModificationDateTime',
[EntityType.COMPANIES]: 'lastActivityDate',
[EntityType.TICKETS]: 'lastActivityDate',
[EntityType.TASKS]: 'lastActivityDateTime',
[EntityType.PROJECTS]: 'lastActivityDateTime',
@ -131,8 +131,8 @@ export function getLastModifiedField(entity: EntityType): string {
[EntityType.CONFIGURATION_ITEMS]: 'lastModifiedTime',
[EntityType.CONTACTS]: 'lastModifiedDate',
[EntityType.CONTRACTS]: 'lastModifiedDateTime',
[EntityType.BILLING_ITEMS]: 'createDate',
[EntityType.TIME_ENTRIES]: 'lastModifiedDate',
[EntityType.BILLING_ITEMS]: 'itemDate',
[EntityType.TIME_ENTRIES]: 'dateWorked',
[EntityType.STATUSES]: 'lastModifiedDate',
[EntityType.ISSUE_TYPES]: 'lastModifiedDate',
[EntityType.SUB_ISSUE_TYPES]: 'lastModifiedDate',