2021-03-12 12:14:18 +00:00
|
|
|
import * as homePage from "../apiRequests/HomePage";
|
2021-04-26 07:49:55 +00:00
|
|
|
import { getDatePeriod } from "./misc";
|
2021-03-12 12:14:18 +00:00
|
|
|
|
|
|
|
export function getOrdersReadyToFulfill(channelSlug) {
|
|
|
|
return homePage
|
|
|
|
.getOrdersWithStatus("READY_TO_FULFILL", channelSlug)
|
|
|
|
.its("body.data.orders.totalCount");
|
|
|
|
}
|
|
|
|
export function getOrdersReadyForCapture(channelSlug) {
|
|
|
|
return homePage
|
|
|
|
.getOrdersWithStatus("READY_TO_CAPTURE", channelSlug)
|
|
|
|
.its("body.data.orders.totalCount");
|
|
|
|
}
|
|
|
|
export function getProductsOutOfStock(channelSlug) {
|
|
|
|
return homePage
|
|
|
|
.getProductsOutOfStock(channelSlug)
|
|
|
|
.its("body.data.products.totalCount");
|
|
|
|
}
|
|
|
|
export function getSalesAmount(channelSlug) {
|
|
|
|
return homePage
|
|
|
|
.getSalesForChannel(channelSlug, "TODAY")
|
|
|
|
.its("body.data.ordersTotal.gross.amount");
|
|
|
|
}
|
|
|
|
export function getTodaysOrders(channelSlug) {
|
2021-04-26 07:49:55 +00:00
|
|
|
const today = getDatePeriod(1);
|
|
|
|
|
2021-03-12 12:14:18 +00:00
|
|
|
return homePage
|
2021-04-26 07:49:55 +00:00
|
|
|
.getOrdersForChannel(channelSlug, today)
|
2021-03-12 12:14:18 +00:00
|
|
|
.its("body.data.orders.totalCount");
|
2021-02-15 09:44:50 +00:00
|
|
|
}
|