Files
marqdo/tests/applications/invoice/consumer.js
cflmyandCursor 8f1010f967 Ship oracle journal values, bytecode/frontend hardening, and replay-policy Lean.
Host exposes oracle journals as language values with refuse/copy gates; bytecode and foreign session paths get modularized; applications and verification replay-policy sources land with Lake builds ignored.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-06 15:04:27 +08:00

11 lines
412 B
JavaScript

var totals = new Map();
for (var row of bridge) {
var value = totals.get(row.region) || [0, 0];
value[0] += 1;
value[1] += Math.floor(row.units * row.cents * (10000-row.discount) / 10000);
totals.set(row.region, value);
}
var answer = [...totals].sort((a,b) => Buffer.compare(Buffer.from(a[0]),Buffer.from(b[0])))
.map(([region, value]) => ({region, invoices: value[0], net_cents: value[1]}));
answer;