Interface: OrderRequester
Implement this interface for implementing an api which requests orders.
See
AppFeature
Methods
processOrdersRequest
▸ processOrdersRequest(request
): Promise
<{ attributeValues?
: Record
<string
, unknown
> = ZAttributeValues; filters?
: { value?: unknown; field?: string; operation?: FilterOperation; }[] ; pageSize?
: number
; pageToken?
: string
}>
Handle the incoming request and transform it to a QueryOrdersRequest.
Parameters
Name | Type |
---|---|
request | Object |
request.body? | string |
request.headers? | Record <string , string > |
request.method? | string |
request.url? | string |
Returns
Promise
<{ attributeValues?
: Record
<string
, unknown
> = ZAttributeValues; filters?
: { value?: unknown; field?: string; operation?: FilterOperation; }[] ; pageSize?
: number
; pageToken?
: string
}>
Defined in
src/contracts/pull-orders/handler/order-requester.ts:16
provideOrders
▸ provideOrders(result
): Promise
<{ body?
: string
; headers?
: Record
<string
, string
> ; statusCode?
: number
}>
Transform the result to the expected response.
Parameters
Name | Type |
---|---|
result | Object |
result.data? | { attributeValues? : Record <string , unknown > = ZAttributeValues; customer? : { id?: string; mailAddress?: string; phoneNumber?: string; vatId?: string; attributeValues?: Record<string, unknown>; } ; deliveryAddress? : { id?: string; company?: string; firstName?: string; surname?: string; line2?: string; street?: string; houseNumber?: string; zipCode?: string; city?: string; countryCode?: string; state?: string; attributeValues?: Record<...>; } ; id? : string ; invoiceAddress? : { id?: string; company?: string; firstName?: string; surname?: string; line2?: string; street?: string; houseNumber?: string; zipCode?: string; city?: string; countryCode?: string; state?: string; attributeValues?: Record<...>; } ; items? : { id?: string; name?: string; description?: string; sku?: string; amount?: number; singleNetPrice?: { value?: number; divisor?: number; currencyCode?: string; }; singleGrossPrice?: { value?: number; divisor?: number; currencyCode?: string; }; taxRate?: number; attributeValues?: Record<...>; }[] ; orderDate? : string = ZDateTimeString; orderNumber? : string ; paymentStatus? : "OPEN" | "IN_PROGRESS" | "PARTIALLY_PAID" | "PAID" | "PARTIALLY_REFUNDED" | "REFUNDED" = ZPaymentStatus; shipments? : { id?: string; date?: string; sourceCountryCode?: string; method?: string; netPrice?: { value?: number; divisor?: number; currencyCode?: string; }; grossPrice?: { value?: number; divisor?: number; currencyCode?: string; }; taxRate?: number; attributeValues?: Record<...>; }[] ; status? : "OPEN" | "CONFIRMED" | "PROCESSING" | "CANCELED" | "COMPLETED" = ZOrderStatus; transactions? : { id?: string; date?: string; type?: "PAYMENT" | "REFUND"; method?: string; amount?: { value?: number; divisor?: number; currencyCode?: string; }; attributeValues?: Record<string, unknown>; }[] }[] |
result.nextPageToken? | string |
result.pageSize? | number |
result.pageToken? | string |
Returns
Promise
<{ body?
: string
; headers?
: Record
<string
, string
> ; statusCode?
: number
}>
Defined in
src/contracts/pull-orders/handler/order-requester.ts:21