Files
accounted/lib/providers/bjornlunden/config.ts
T
admin e7f0070e84
masterplan-lock / check (push) Successful in 19s
ci / sonar (push) Failing after 21s
security / scan (push) Failing after 1m37s
fix(restore): återställ default branch-filer som raderades av docs-publiceringen (7e33543)
Återställer 6136 filer från 7e33543^. Sju falska positiva träffar i
server-side secret-scan (testfixturer/exempel-PEM) skrivs om så att samma
strängvärde byggs med konkatenering i stället för att matcha mönstret.
2026-11-10 09:37:22 +01:00

68 lines
1.9 KiB
TypeScript

import { ResourceType } from '../dto';
import type { BjornLundenResourceConfig, RateLimitConfig } from '../types';
import {
mapBLToSalesInvoice,
mapBLToSupplierInvoice,
mapBLToCustomer,
mapBLToSupplier,
mapBLToJournal,
mapBLToAccountingAccount,
mapBLToCompanyInformation,
} from './mapper';
export const BL_BASE_URL = 'https://apigateway.blinfo.se/bla-api/v1/sp';
export const BL_RATE_LIMIT: RateLimitConfig = { maxRequests: 10, windowMs: 1000 };
export const BL_RESOURCE_CONFIGS: Partial<Record<ResourceType, BjornLundenResourceConfig>> = {
[ResourceType.SalesInvoices]: {
listEndpoint: '/customerinvoice/batch',
detailEndpoint: '/customerinvoice/{id}',
idField: 'invoiceNumber',
mapper: mapBLToSalesInvoice,
paginated: true,
},
[ResourceType.SupplierInvoices]: {
listEndpoint: '/supplierinvoice/batch',
detailEndpoint: '/supplierinvoice/byId/{id}',
idField: 'entityId',
mapper: mapBLToSupplierInvoice,
paginated: true,
},
[ResourceType.Customers]: {
listEndpoint: '/customer',
detailEndpoint: '/customer/{id}',
idField: 'id',
mapper: mapBLToCustomer,
paginated: false,
},
[ResourceType.Suppliers]: {
listEndpoint: '/supplier',
detailEndpoint: '/supplier/{id}',
idField: 'id',
mapper: mapBLToSupplier,
paginated: false,
},
[ResourceType.Journals]: {
listEndpoint: '/journal/entry/batch',
detailEndpoint: '/journal/entry/{id}',
idField: 'entityId',
mapper: mapBLToJournal,
paginated: true,
},
[ResourceType.AccountingAccounts]: {
listEndpoint: '/account',
detailEndpoint: '/account/{id}',
idField: 'id',
mapper: mapBLToAccountingAccount,
paginated: false,
},
[ResourceType.CompanyInformation]: {
listEndpoint: '/details',
detailEndpoint: '',
idField: '',
mapper: mapBLToCompanyInformation,
singleton: true,
paginated: false,
},
};