test(accounting): unit tests for expense markup / disposition logic
Covers the silently-regressable money + classification bits of the re-bill flow (the maintainer's "thin CRM test coverage" concern). Pure functions via a new expenseService._internal export — no DB, no date-harness pitfalls: - computeMarkupMinor: percent rounding, flat, none/null. - resolveMarkup precedence: override > expense clause > none. - buildExpenseInsert: bad-disposition guard, tax_treatment/status defaults, declined -> status+reason, markup field matches type, parked -> status. 11 tests, all green (npx jest expenseService.markup).
This commit is contained in:
@@ -533,4 +533,6 @@ module.exports = {
|
||||
TAX_TREATMENTS,
|
||||
MARKUP_TYPES,
|
||||
PAYMENT_METHODS,
|
||||
// exposed for unit tests
|
||||
_internal: { computeMarkupMinor, resolveMarkup, buildExpenseInsert, transformExpense, transformInbound },
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user