Tahesab: show raw data from Tahesab, invoice-style document view with metal labels
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -6,7 +6,7 @@ import {
|
||||
import { Prisma } from '@prisma/client';
|
||||
import { PrismaService } from '../../prisma/prisma.service';
|
||||
import { TahesabConnectionsService } from './connections.service';
|
||||
import { normalizeMandehResponse } from './tahesab-methods';
|
||||
import { extractMandehRaw, normalizeMandehResponse } from './tahesab-methods';
|
||||
|
||||
@Injectable()
|
||||
export class TahesabBalanceService {
|
||||
@@ -78,11 +78,14 @@ export class TahesabBalanceService {
|
||||
data: { lastBalanceSyncedAt: cache.fetchedAt },
|
||||
});
|
||||
|
||||
const rawView = extractMandehRaw(raw);
|
||||
return {
|
||||
connectionId: resolvedId,
|
||||
connectionLabel: link.connection.label,
|
||||
dbName: link.connection.dbName,
|
||||
moshtariCode: link.moshtariCode,
|
||||
mandehFields: rawView.fields,
|
||||
mandehDetailRaw: rawView.details,
|
||||
goldBalance: normalized.goldBalance,
|
||||
rialBalance: normalized.rialBalance,
|
||||
currencyBalance: normalized.currencyBalance,
|
||||
@@ -116,11 +119,14 @@ export class TahesabBalanceService {
|
||||
return this.getAssets(organizationId, personId, connectionId);
|
||||
}
|
||||
const c = link.balanceCache;
|
||||
const rawView = extractMandehRaw(c.rawResponse);
|
||||
return {
|
||||
connectionId: resolvedId,
|
||||
connectionLabel: link.connection.label,
|
||||
dbName: link.connection.dbName,
|
||||
moshtariCode: link.moshtariCode,
|
||||
mandehFields: rawView.fields,
|
||||
mandehDetailRaw: rawView.details,
|
||||
goldBalance: c.goldBalance,
|
||||
rialBalance: c.rialBalance,
|
||||
currencyBalance: c.currencyBalance,
|
||||
|
||||
Reference in New Issue
Block a user