Skip to content

Test suite for the billing engine #5

Description

@solomon2773

The billing engine (src/lib/billing.ts, src/lib/services/orders.ts) has clear pure-ish logic worth locking in with tests: renewal invoice generation windows, suspension/termination cutoffs, proration math for upgrades, coupon scoping, multi-currency conversion and locking.

Proposal: vitest + a Postgres test container (or mocked Prisma client for the pure parts). Start with computeTotals — it's a pure function given mocked coupon/tax lookups.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions