feat(orders): a fifth verdict, 'bad', between ok and never again
ci / lint-test (push) Successful in 47s
ci / lint-test (push) Successful in 47s
The jump from "OK" to "Never again" is too big and most disappointments live in the gap (user, 2026-07-28) — so a merely poor meal either flattered itself as OK or got blacklisted. Only 'never' raises the warning on a future order. A blacklist that fires for every mediocre delivery is one nobody reads, so 'bad' records the disappointment without triggering the alarm. Both set order_again = false — you would not choose either again — and that split between "would I order it" and "warn me about it" is the point of the extra level. Migration widens the CHECK; nothing is removed, so no existing row needs mapping.
This commit is contained in:
@@ -92,6 +92,25 @@ describe("order verdicts — one per person", () => {
|
||||
expect(body.reviews[0].order_again).toBe(false);
|
||||
body = await (await PUT(req({ rating: "ok" }), params(txnId))).json();
|
||||
expect(body.reviews[0].order_again).toBe(true);
|
||||
// "bad" is also a no — you would not choose it again.
|
||||
body = await (await PUT(req({ rating: "bad" }), params(txnId))).json();
|
||||
expect(body.reviews[0].order_again).toBe(false);
|
||||
});
|
||||
|
||||
it("only `never` raises the warning, not `bad`", async () => {
|
||||
// The boundary the five-level scale exists for. A blacklist that fires for
|
||||
// every mediocre meal is one nobody reads, so "bad" records the
|
||||
// disappointment without triggering the alarm.
|
||||
const older = await seedOrder("Thai Palace", "2026-06-01");
|
||||
await PUT(req({ participant_id: ownerId, rating: "bad" }), params(older));
|
||||
|
||||
let body = await (await GET(req(), params(txnId))).json();
|
||||
expect(body.merchant.counts.bad).toBe(1);
|
||||
expect(body.merchant.warn).toBe(false);
|
||||
|
||||
await PUT(req({ participant_id: ownerId, rating: "never" }), params(older));
|
||||
body = await (await GET(req(), params(txnId))).json();
|
||||
expect(body.merchant.warn).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user