feat(billing): USD offline bank-transfer payments

This commit is contained in:
Marshal
2026-08-08 13:37:05 +00:00
parent 83b9e32670
commit a42d32c27c
31 changed files with 923 additions and 11 deletions

View File

@@ -0,0 +1,35 @@
import { WagonReadiness } from '@edr/types';
import {
requiredWagonReadiness,
wagonReadinessMatchesSchedule,
} from './wagon-readiness.util';
describe('wagonReadinessMatchesSchedule', () => {
it('requires IMPORT_READY for IMPORT schedules', () => {
expect(requiredWagonReadiness('IMPORT')).toBe(WagonReadiness.ImportReady);
expect(
wagonReadinessMatchesSchedule(WagonReadiness.ImportReady, 'IMPORT'),
).toBe(true);
expect(
wagonReadinessMatchesSchedule(WagonReadiness.ExportReady, 'IMPORT'),
).toBe(false);
});
it('requires EXPORT_READY for EXPORT schedules', () => {
expect(requiredWagonReadiness('EXPORT')).toBe(WagonReadiness.ExportReady);
expect(
wagonReadinessMatchesSchedule(WagonReadiness.ExportReady, 'EXPORT'),
).toBe(true);
expect(
wagonReadinessMatchesSchedule(WagonReadiness.ImportReady, 'EXPORT'),
).toBe(false);
});
it('allows any readiness for DOMESTIC schedules', () => {
expect(requiredWagonReadiness('DOMESTIC')).toBeNull();
expect(
wagonReadinessMatchesSchedule(WagonReadiness.ExportReady, 'DOMESTIC'),
).toBe(true);
});
});