Raise NTE to $400 when a new WO space opens, align /createWO defaults with SC_WO_OPEN_MIN_NTE, limit the daily digest to all non-invoiced COMPLETED WOs, and add unit tests. Co-authored-by: Cursor <cursoragent@cursor.com>
28 lines
820 B
JavaScript
28 lines
820 B
JavaScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import { isCloseoutDigestCandidate } from '../src/services/closeoutDigestEligibility.js';
|
|
|
|
test('isCloseoutDigestCandidate rejects when isInvoiced is true', () => {
|
|
assert.equal(
|
|
isCloseoutDigestCandidate({ isInvoiced: true, invoiceId: null }),
|
|
false
|
|
);
|
|
});
|
|
|
|
test('isCloseoutDigestCandidate rejects when invoiceId is set', () => {
|
|
assert.equal(
|
|
isCloseoutDigestCandidate({ isInvoiced: false, invoiceId: 12345 }),
|
|
false
|
|
);
|
|
});
|
|
|
|
test('isCloseoutDigestCandidate accepts non-invoiced WO', () => {
|
|
assert.equal(
|
|
isCloseoutDigestCandidate({ isInvoiced: false, invoiceId: null }),
|
|
true
|
|
);
|
|
});
|
|
|
|
test('isCloseoutDigestCandidate rejects null statusInfo', () => {
|
|
assert.equal(isCloseoutDigestCandidate(null), false);
|
|
});
|