File tree Expand file tree Collapse file tree
src/products/components/OrderDiscountProviders Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,14 +9,19 @@ import {
99import { type AutomaticDiscountInfo , type OrderLineDiscountData } from "./types" ;
1010import { getAutomaticLineDiscounts , getOrderLineDiscount } from "./utils" ;
1111
12+ /** Minimal order line shape for these tests; cast to full fragment at the boundary. */
13+ type OrderDetailsLineStub = Partial < OrderDetailsFragment [ "lines" ] [ number ] > &
14+ Pick < OrderDetailsFragment [ "lines" ] [ number ] , "id" > ;
15+
1216type OrderLinePriceStub = Pick <
1317 OrderDetailsFragment [ "lines" ] [ number ] ,
1418 "id" | "unitPrice" | "undiscountedUnitPrice"
1519> ;
1620
17- const orderAsDetails = (
18- partial : Pick < OrderDetailsFragment , "lines" | "discounts" > ,
19- ) : OrderDetailsFragment => partial as OrderDetailsFragment ;
21+ const orderAsDetails = ( partial : {
22+ lines : OrderDetailsLineStub [ ] ;
23+ discounts : OrderDetailsFragment [ "discounts" ] ;
24+ } ) : OrderDetailsFragment => partial as OrderDetailsFragment ;
2025
2126const lineBase = (
2227 id : string ,
You can’t perform that action at this time.
0 commit comments