From 239b8c195f05dfca48c21b78076915ed7ed767b0 Mon Sep 17 00:00:00 2001 From: "Joseph T. French" Date: Wed, 25 Nov 2026 17:12:02 -0600 Subject: [PATCH] feat(ledger): listUnmappedElements names the concept a contra nets against --- clients/LedgerClient.test.ts | 31 +++++++++++++++++++ clients/graphql/generated/graphql.ts | 19 ++++++++++++ .../queries/ledger/unmappedElements.ts | 6 ++++ 3 files changed, 56 insertions(+) diff --git a/clients/LedgerClient.test.ts b/clients/LedgerClient.test.ts index 41ba074..b8a5a85 100644 --- a/clients/LedgerClient.test.ts +++ b/clients/LedgerClient.test.ts @@ -657,6 +657,37 @@ describe('LedgerClient', () => { }) }) + describe('listUnmappedElements', () => { + it('names the concept a contra account nets against', async () => { + mockFetch.mockResolvedValueOnce( + gqlResponse({ + unmappedElements: [ + { + id: 'elem_3', + code: '1420', + name: 'Accumulated Amortization', + trait: 'contraAsset', + balanceType: 'credit', + externalSource: 'qb', + suggestedTargets: [], + netsAgainst: { + elementId: 'elem_intangibles', + qname: 'rs-gaap:IntangibleAssetsNetExcludingGoodwill', + name: 'Intangible Assets, Net (Excluding Goodwill)', + confidence: null, + }, + }, + ], + }) + ) + const [contra] = await client.listUnmappedElements('graph_1', { mappingId: 'map_1' }) + expect(contra.netsAgainst?.qname).toBe('rs-gaap:IntangibleAssetsNetExcludingGoodwill') + const body = JSON.parse((mockFetch.mock.calls[0][1] as RequestInit).body as string) + expect(body.query).toContain('netsAgainst') + expect(body.variables.mappingId).toBe('map_1') + }) + }) + describe('getAccountRegister', () => { it('forwards the account, window, slice and cursor', async () => { mockFetch.mockResolvedValueOnce( diff --git a/clients/graphql/generated/graphql.ts b/clients/graphql/generated/graphql.ts index 1eec169..9061193 100644 --- a/clients/graphql/generated/graphql.ts +++ b/clients/graphql/generated/graphql.ts @@ -2729,6 +2729,12 @@ export type ListLedgerUnmappedElementsQuery = { name: string confidence: number | null }> + netsAgainst: { + elementId: string + qname: string + name: string + confidence: number | null + } | null }> } @@ -10629,6 +10635,19 @@ export const ListLedgerUnmappedElementsDocument = { ], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'netsAgainst' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'elementId' } }, + { kind: 'Field', name: { kind: 'Name', value: 'qname' } }, + { kind: 'Field', name: { kind: 'Name', value: 'name' } }, + { kind: 'Field', name: { kind: 'Name', value: 'confidence' } }, + ], + }, + }, ], }, }, diff --git a/clients/graphql/queries/ledger/unmappedElements.ts b/clients/graphql/queries/ledger/unmappedElements.ts index 679133f..3528191 100644 --- a/clients/graphql/queries/ledger/unmappedElements.ts +++ b/clients/graphql/queries/ledger/unmappedElements.ts @@ -22,6 +22,12 @@ export const LIST_UNMAPPED_ELEMENTS = gql` name confidence } + netsAgainst { + elementId + qname + name + confidence + } } } `