Milestone 0: import zappier billing, Verae middleware, and Zapier research
Compose-ready workspace: packages/zappier (rate card, portal, Stripe), packages/verae-zapier-middleware (timestamp + NATS), packages/verae-zapier (CLI app), vendor/zapier-platform, and research/zapier vendor corpus. Gate 0 structure checks pass. Product code and research are not yet wired.
This commit is contained in:
commit
b4150c8250
1364 changed files with 6814366 additions and 0 deletions
19
packages/zappier/tests/billing-delta.test.ts
Normal file
19
packages/zappier/tests/billing-delta.test.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { computeDelta } from '../src/billing/stripe';
|
||||
|
||||
describe('computeDelta', () => {
|
||||
it('returns the difference when billable exceeds prior', () => {
|
||||
expect(computeDelta(800, 500)).toBe(300);
|
||||
});
|
||||
|
||||
it('returns 0 when billable equals prior', () => {
|
||||
expect(computeDelta(500, 500)).toBe(0);
|
||||
});
|
||||
|
||||
it('never returns a negative value when billable is below prior', () => {
|
||||
expect(computeDelta(300, 500)).toBe(0);
|
||||
});
|
||||
|
||||
it('returns the full billable amount when nothing was reported before', () => {
|
||||
expect(computeDelta(500, 0)).toBe(500);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue