@figuredev/orders-sdk
Advanced tools
Comparing version
import { Maybe } from "fgr-lib-backend/lib/types"; | ||
import { InventoryInfoDTO } from "./inventory"; | ||
import { OrderDTO } from "./orderV3"; | ||
import { OrderDTO, OrderPreviewDTO } from "./orderV3"; | ||
import { ReportPreparationTimeByItemDTO, ReportPreparationTimeHourlyDTO } from "./report"; | ||
@@ -23,2 +23,8 @@ import { IsoDate, IsoDateTime } from "./types"; | ||
getOrder(ctx: UserContext, id: string): Promise<OrderDTO>; | ||
getOrdersPreviews(ctx: UserContext, params: { | ||
from?: IsoDateTime; | ||
limit: number; | ||
serviceId?: string; | ||
customerId?: string; | ||
}): Promise<OrderPreviewDTO[]>; | ||
getOrdersCount(ctx: UserContext, params: { | ||
@@ -25,0 +31,0 @@ source?: string; |
@@ -59,2 +59,18 @@ "use strict"; | ||
} | ||
getOrdersPreviews(ctx, params) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return yield http_1.createHttpRequest({ | ||
baseURL: this.config.baseUrl, | ||
method: "POST", | ||
url: "/order-previews", | ||
headers: this.prepareHeaders(ctx), | ||
params: { | ||
from: params.from, | ||
limit: params.limit, | ||
serviceId: params.serviceId, | ||
customerId: params.customerId, | ||
}, | ||
}).then((r) => r.data); | ||
}); | ||
} | ||
getOrdersCount(ctx, params) { | ||
@@ -61,0 +77,0 @@ return __awaiter(this, void 0, void 0, function* () { |
@@ -31,2 +31,19 @@ import { AddressDTO, IsoDateTime, Maybe, RecipientDTO } from "./types"; | ||
}; | ||
export declare type OrderPreviewDTO = { | ||
id: string; | ||
accountId: string; | ||
serviceId: string; | ||
orderNumber: string; | ||
state: OrderStateDTO; | ||
source?: Maybe<OrderSourceDTO>; | ||
sourceName?: Maybe<OrderSourceNameDTO>; | ||
paymentMethod?: Maybe<OrderPaymentMethodDTO>; | ||
fulfillmentType?: Maybe<OrderFulfillmentTypeDTO>; | ||
scheduledFor?: Maybe<IsoDateTime>; | ||
customerId?: Maybe<string>; | ||
note?: Maybe<string>; | ||
placedAt: IsoDateTime; | ||
totals: OrderTotalsDTO; | ||
items?: OrderItemPreviewDTO[]; | ||
}; | ||
export declare type OrderMetadataDTO = { | ||
@@ -287,2 +304,7 @@ businessDayStartsAt?: Maybe<string>; | ||
}; | ||
export declare type OrderItemPreviewDTO = { | ||
id: string; | ||
quantity?: Maybe<number>; | ||
name: string; | ||
}; | ||
export declare type OrderItemAuditDTO = { | ||
@@ -289,0 +311,0 @@ type: string; |
{ | ||
"name": "@figuredev/orders-sdk", | ||
"version": "0.12.57", | ||
"version": "0.12.58", | ||
"license": "ISC", | ||
@@ -5,0 +5,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
56604
3.45%1103
4.15%