fix(orders): don't restate a platform the merchant already names
ci / lint-test (push) Failing after 41s

Trip rows read "Order - Uber Trip (Uber)". The suffix exists so you can tell
where to go and look; when the merchant is literally "Uber Trip" it says
nothing. What identifies a trip is its two addresses, and those are in the
Order details panel. Existing rows updated in prod.
This commit is contained in:
2026-07-27 11:33:37 +10:00
parent c656f5d26b
commit 6161ddc9de
2 changed files with 23 additions and 1 deletions
@@ -6,6 +6,7 @@ import {
validateOrderTotals,
resolveCategory,
NotAReceiptError,
orderDescription,
type MessageMeta,
type ParsedOrder,
} from "../../lib/order-ingestion";
@@ -303,3 +304,19 @@ describe("Uber trips", () => {
expect(() => trip("ut-summary")).toThrow(NotAReceiptError);
});
});
describe("orderDescription", () => {
it("names the platform", () => {
expect(orderDescription("doordash", "Mad Mex")).toBe("Order - Mad Mex (DoorDash)");
expect(orderDescription("ubereats", "Coles (Wyndham Vale)")).toBe(
"Order - Coles (Wyndham Vale) (Uber Eats)"
);
});
it("does not restate a platform the merchant already names", () => {
// A trip's merchant is literally "Uber Trip"; "(Uber)" after it says
// nothing. What identifies a trip is its addresses, and those live in the
// Order details panel.
expect(orderDescription("uber", "Uber Trip")).toBe("Order - Uber Trip");
});
});