fix staged nation tax rate consumption

This commit is contained in:
2026-07-27 10:07:59 +00:00
parent de510da48e
commit 26e033665a
7 changed files with 118 additions and 49 deletions
+11
View File
@@ -0,0 +1,11 @@
import { asNumber } from '@sammo-ts/common';
const DEFAULT_NATION_RATE = 20;
export const resolveAppliedNationRate = (meta: Record<string, unknown>): number => {
const stagedRate = meta.rate_tmp;
if (typeof stagedRate === 'number' && Number.isFinite(stagedRate)) {
return stagedRate;
}
return asNumber(meta.rate, DEFAULT_NATION_RATE);
};