fix(invoice): use shippingLine.deliveryCategory as primary pickup signal

Order 1032 on dev still rendered as 'Versandart: Lager Graz' because the
shipping line's title/code/source contained no 'pickup' keyword — only
`shippingLine.deliveryCategory == "pickup"` flagged it as a pickup.

`shippingLine.deliveryCategory` only requires `read_orders` (already
granted), so query and use it as the primary signal. Keep the regex on
title/code/source/carrier as a fallback for custom rates without a proper
pickup category.
This commit is contained in:
Gerhard Scheikl
2026-05-15 15:12:59 +02:00
parent 4e522f41df
commit 8a40bcbee6
25 changed files with 1619 additions and 16 deletions
@@ -83,6 +83,10 @@ export interface RawShippingLine {
code: string | null;
source: string | null;
carrierIdentifier: string | null;
/** Lowercase string like "shipping", "pickup", "local_pickup". Used as
* the primary pickup signal because it doesn't require the
* fulfillment-orders scope. */
deliveryCategory: string | null;
originalPriceSet: { shopMoney: RawMoney } | null;
discountedPriceSet: { shopMoney: RawMoney } | null;
taxLines: RawTaxLine[];
@@ -156,6 +160,7 @@ const QUERY = `#graphql
code
source
carrierIdentifier
deliveryCategory
originalPriceSet { shopMoney { amount currencyCode } }
discountedPriceSet { shopMoney { amount currencyCode } }
taxLines {