Skip to content

Commit

Permalink
fix date
Browse files Browse the repository at this point in the history
  • Loading branch information
khaliqgant committed Dec 20, 2024
1 parent a3aabe2 commit e81e441
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions flows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14358,9 +14358,9 @@ integrations:
updatedDateUtc: string
GeneralLedger:
id: string
date: string
date: string | null
number: number
createdDateUTC: string
createdDate: string | null
lines: LedgerLine[]
LedgerLine:
journalLineId: string
Expand Down
4 changes: 2 additions & 2 deletions integrations/xero/nango.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,9 @@ models:
# General Ledger
GeneralLedger:
id: string
date: string
date: string | null
number: number
createdDateUTC: string
createdDate: string | null
lines: LedgerLine[]
LedgerLine:
journalLineId: string
Expand Down
4 changes: 2 additions & 2 deletions integrations/xero/syncs/general-ledger.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ _No request body_
```json
{
"id": "<string>",
"date": "<string>",
"date": "<string | null>",
"number": "<number>",
"createdDateUTC": "<string>",
"createdDate": "<string | null>",
"lines": [
{
"journalLineId": "<string>",
Expand Down
5 changes: 3 additions & 2 deletions integrations/xero/syncs/general-ledger.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { NangoSync, GeneralLedger, LedgerLine, ProxyConfiguration } from '../../models';
import type { XeroJournal, XeroJournalLine } from '../types';
import { parseDate } from '../utils.js';
import { getTenantId } from '../helpers/get-tenant-id.js';

export default async function fetchData(nango: NangoSync): Promise<void> {
Expand Down Expand Up @@ -29,9 +30,9 @@ export default async function fetchData(nango: NangoSync): Promise<void> {
function mapXeroJournal(xeroJournal: XeroJournal): GeneralLedger {
return {
id: xeroJournal.JournalID,
date: xeroJournal.JournalDate,
date: xeroJournal.JournalDate ? parseDate(xeroJournal.JournalDate).toISOString() : null,
number: xeroJournal.JournalNumber,
createdDateUTC: xeroJournal.CreatedDateUTC,
createdDate: xeroJournal.CreatedDateUTC ? parseDate(xeroJournal.CreatedDateUTC).toISOString() : null,
lines: xeroJournal.JournalLines.map(mapJournalLine)
};
}
Expand Down

0 comments on commit e81e441

Please sign in to comment.