Interface: SingleOrderRequester
Implement this interface for implementing an api which requests single orders.
See
AppFeature
Methods
processSingleOrderRequest
▸ processSingleOrderRequest(request): Promise<{ attributeValues?: Record<string, unknown> = ZAttributeValues; filters?: { field?: string ; operation?: FilterOperation ; value?: unknown }[] }>
Handle the incoming request and transform it to a QueryOrderRequest.
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?: { field?: string ; operation?: FilterOperation ; value?: unknown }[] }>
Defined in
src/contracts/pull-order/handler/single-order-requester.ts:16
provideSingleOrder
▸ provideSingleOrder(result): Promise<{ body?: string ; headers?: Record<string, string> ; statusCode?: number }>
Transform the result to the expected response.
Parameters
| Name | Type | Default value |
|---|---|---|
result | Object | undefined |
result.attributeValues? | Record<string, unknown> | ZAttributeValues |
result.customer? | { id?: string; mailAddress?: string; phoneNumber?: string; vatId?: string; attributeValues?: Record<string, unknown>; } | undefined |
result.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<...>; } | undefined |
result.id? | string | undefined |
result.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<...>; } | undefined |
result.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<...>; }[] | undefined |
result.orderDate? | string | ZDateTimeString |
result.orderNumber? | string | undefined |
result.paymentStatus? | "OPEN" | "IN_PROGRESS" | "PARTIALLY_PAID" | "PAID" | "PARTIALLY_REFUNDED" | "REFUNDED" | ZPaymentStatus |
result.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<...>; }[] | undefined |
result.status? | "OPEN" | "CONFIRMED" | "PROCESSING" | "CANCELED" | "COMPLETED" | ZOrderStatus |
result.transactions? | { id?: string; date?: string; type?: "PAYMENT" | "REFUND"; method?: string; amount?: { value?: number; divisor?: number; currencyCode?: string; }; attributeValues?: Record<string, unknown>; }[] | undefined |
Returns
Promise<{ body?: string ; headers?: Record<string, string> ; statusCode?: number }>
Defined in
src/contracts/pull-order/handler/single-order-requester.ts:21