Tests
Same vendor, amount, and date on more than one voucher.
A detail payment should not share vendor, amount, and check date with a different voucher number.
Same vendor and amount again inside the configured window.
The same vendor and amount should not recur on a different voucher within 30 days, unless that amount is a recurring fee (median of at least 3 payments per month).
Vendor share of exact-thousand payments sits far above the population.
Among vendors with at least 20 payments, the share of payments of at least $1,000 that are exact thousands should not sit 3 standard errors above the population share.
Payments bunch just under a procurement threshold.
DPS states that contracts over $100,000 require formal competitive sealed bidding. A vendor or department is flagged when the 5 percent band just under that threshold has at least 2 payments and at least twice as many as the band below it.
Several payments under a threshold, close together, sum to at least the threshold.
Two or more payments under $100,000 to the same vendor and department, within 7 days, should not sum to $100,000 or more.
Payment dated on a weekend or a listed city holiday.
A payment dated on a weekend or on a date in config/holidays.csv is reported for context. It is informational unless that vendor's rate is more than three times the population rate.
A vendor holds a large share of a department, or spend grew sharply year over year.
One vendor should not hold 50 percent or more of a department's detail-window spend, and year-over-year spend should not triple when the prior year was at least $50,000.
Direct-voucher payment above the configured percentile, outside expected categories.
A direct voucher (contract number DV) above the 99th percentile of direct-voucher amounts warrants follow-up, except utilities, debt service, and payroll processors listed in config/expected_dv_categories.yaml.
One vendor is stored under more than one differing name.
A vendor with two or more raw names whose punctuation-stripped forms still differ should be confirmed as one payee.
Largest payment is many times the next largest for that vendor.
TODO [KATE]
A payment is distant from that vendor's own median.
TODO [KATE]