🧪 fix: Align Pricing Spec Dep Signatures with TxDeps

This commit is contained in:
Danny Avila 2026-06-10 23:36:10 -04:00
parent 2c7f5c38af
commit 698649eda5

View file

@ -5,9 +5,11 @@ import type { EndpointTokenConfig } from '~/types';
import { matchModelName, findMatchingPattern } from '~/utils';
import { buildTokenConfigMap } from './pricing';
/** Adapters: TxDeps types are looser than the utils signatures (string endpoint, undefined miss) */
const { getValueKey, getMultiplier, getCacheMultiplier } = createTxMethods(mongoose, {
matchModelName,
findMatchingPattern,
matchModelName: (model, endpoint) => matchModelName(model, endpoint as EModelEndpoint),
findMatchingPattern: (model, values) =>
findMatchingPattern(model, values as Record<string, number>) ?? undefined,
});
const deps = { getValueKey, getMultiplier, getCacheMultiplier };