import { withCurrencySymbol, withTaxLabel } from "../../../regional/decorators" import type { RegionalLogic, RegionConfig } from "../../../regional/types" import { baseFormatAmount, baseValidateAmount } from "../default/logic" /** * UK logic factory. * Receives regionConfig at assembly time — never imports config statically. * * Composition: withTaxLabel wraps withCurrencySymbol wraps baseFormatAmount. * Result: baseFormatAmount(99) → "99" → "£99" → "£99 inc. VAT" */ export const createLogic = (config: RegionConfig): RegionalLogic => ({ formatAmount: withTaxLabel("inc. VAT")( withCurrencySymbol("£")(baseFormatAmount), ), // UK gates validation on showDetailsTab — false means data access is restricted validateAmount: (n) => baseValidateAmount(n) && config.features.showDetailsTab, })