fix(orders): don't restate a platform the merchant already names
ci / lint-test (push) Failing after 41s
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:
@@ -27,7 +27,12 @@ export const PLATFORM_LABEL: Record<ParsedOrder["platform"], string> = {
|
||||
* platform is the one thing the parser always knows and used to discard.
|
||||
*/
|
||||
export function orderDescription(platform: ParsedOrder["platform"], merchant: string): string {
|
||||
return `Order - ${merchant} (${PLATFORM_LABEL[platform]})`;
|
||||
const label = PLATFORM_LABEL[platform];
|
||||
// A trip's merchant is literally "Uber Trip", so the suffix would restate it
|
||||
// — "Order - Uber Trip (Uber)". The addresses that actually identify a trip
|
||||
// are in the Order details panel, not squeezed into the description.
|
||||
if (merchant.toLowerCase().includes(label.toLowerCase())) return `Order - ${merchant}`;
|
||||
return `Order - ${merchant} (${label})`;
|
||||
}
|
||||
|
||||
export interface IngestResult {
|
||||
|
||||
Reference in New Issue
Block a user