Merge pull request #967 from mirumee/feature/unconfirmed-order-line-manipulation

Unconfirmed order line manipulation
This commit is contained in:
Marcin Gębala 2021-04-07 11:40:15 +02:00 committed by GitHub
commit 31b2f048f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 10311 additions and 39440 deletions

View file

@ -28,6 +28,7 @@ All notable, unreleased changes to this project will be documented in this file.
- Update CollectionBulkDelete error type - #1030 by @d-wysocki
- Remove mailing settings - #1027 by @dominik-zeglen
- Update schema to contain email plugin changes - #1029 by @dominik-zeglen
- Unconfirmed order manipulation - #967 by @tomaszszymanski129
# 2.11.1

View file

@ -11,7 +11,7 @@ export function markOrderAsPaid(orderId) {
export function addProductToOrder(orderId, variantId, quantity = 1) {
const mutation = `mutation{
draftOrderLinesCreate(id:"${orderId}", input:{
orderLinesCreate(id:"${orderId}", input:{
quantity:${quantity}
variantId: "${variantId}"
}){

View file

@ -3559,6 +3559,10 @@
"context": "order history message",
"string": "Note was added to the order"
},
"src_dot_orders_dot_components_dot_OrderHistory_dot_2308853031": {
"context": "order history message",
"string": "Order placed information was sent to customer"
},
"src_dot_orders_dot_components_dot_OrderHistory_dot_2369495522": {
"context": "order history message",
"string": "Order confirmation was sent to customer"
@ -3571,6 +3575,10 @@
"context": "order history message",
"string": "Payment was voided"
},
"src_dot_orders_dot_components_dot_OrderHistory_dot_2607524598": {
"context": "order history message",
"string": "Products were deleted from an order"
},
"src_dot_orders_dot_components_dot_OrderHistory_dot_2655541129": {
"context": "order history message",
"string": "Order was fully paid"
@ -3603,14 +3611,14 @@
"context": "order history message",
"string": "Payment was refunded"
},
"src_dot_orders_dot_components_dot_OrderHistory_dot_3506022286": {
"context": "order history message",
"string": "Products were added to draft order"
},
"src_dot_orders_dot_components_dot_OrderHistory_dot_3731274949": {
"context": "order history message",
"string": "Order was refunded by {refundedBy}"
},
"src_dot_orders_dot_components_dot_OrderHistory_dot_3796744261": {
"context": "order history message",
"string": "Products were added to an order"
},
"src_dot_orders_dot_components_dot_OrderHistory_dot_393045022": {
"context": "order history message",
"string": "Invoice no. {invoiceNumber} was updated"
@ -3622,10 +3630,6 @@
"context": "order history message",
"string": "Oversold {quantity} items"
},
"src_dot_orders_dot_components_dot_OrderHistory_dot_4067959693": {
"context": "order history message",
"string": "Products were deleted from draft order"
},
"src_dot_orders_dot_components_dot_OrderHistory_dot_4121987561": {
"context": "order history message",
"string": "Order refund information was sent to customer"
@ -4204,19 +4208,23 @@
"src_dot_orders_dot_views_dot_OrderDetails_dot_55607988": {
"string": "Invoice is Generating"
},
"src_dot_orders_dot_views_dot_OrderDetails_dot_580490159": {
"context": "window title",
"string": "Order #{orderNumber}"
},
"src_dot_orders_dot_views_dot_OrderDetails_dot_617145655": {
"string": "Shipping method successfully updated"
},
"src_dot_orders_dot_views_dot_OrderDetails_dot_694622335": {
"src_dot_orders_dot_views_dot_OrderDetails_dot_927945225": {
"string": "Fulfillment successfully cancelled"
},
"src_dot_orders_dot_views_dot_OrderDetails_dot_OrderDraftDetails_dot_694622335": {
"context": "window title",
"string": "Draft Order #{orderNumber}"
},
"src_dot_orders_dot_views_dot_OrderDetails_dot_927945225": {
"string": "Fulfillment successfully cancelled"
"src_dot_orders_dot_views_dot_OrderDetails_dot_OrderNormalDetails_dot_580490159": {
"context": "window title",
"string": "Order #{orderNumber}"
},
"src_dot_orders_dot_views_dot_OrderDetails_dot_OrderUnconfirmedDetails_dot_580490159": {
"context": "window title",
"string": "Order #{orderNumber}"
},
"src_dot_orders_dot_views_dot_OrderDraftList_dot_1161115149": {
"context": "dialog header",
@ -6600,6 +6608,10 @@
"src_dot_utils_dot_errors_dot_graphqlError": {
"string": "API error"
},
"src_dot_utils_dot_errors_dot_insufficientStock": {
"context": "error message",
"string": "Cannot change the quantity because of insufficient stock"
},
"src_dot_utils_dot_errors_dot_invalid": {
"string": "Invalid value"
},

47050
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1823,33 +1823,12 @@ input DraftOrderInput {
redirectUrl: String
}
type DraftOrderLineDelete {
errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
order: Order
orderLine: OrderLine
orderErrors: [OrderError!]!
}
type DraftOrderLineUpdate {
errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
order: Order
orderErrors: [OrderError!]!
orderLine: OrderLine
}
type DraftOrderLinesBulkDelete {
errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
count: Int!
orderErrors: [OrderError!]!
}
type DraftOrderLinesCreate {
errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
order: Order
orderLines: [OrderLine!]
orderErrors: [OrderError!]!
}
type DraftOrderUpdate {
errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
orderErrors: [OrderError!]!
@ -2725,9 +2704,6 @@ type Mutation {
draftOrderDelete(id: ID!): DraftOrderDelete
draftOrderBulkDelete(ids: [ID]!): DraftOrderBulkDelete
draftOrderLinesBulkDelete(ids: [ID]!): DraftOrderLinesBulkDelete
draftOrderLinesCreate(id: ID!, input: [OrderLineCreateInput]!): DraftOrderLinesCreate
draftOrderLineDelete(id: ID!): DraftOrderLineDelete
draftOrderLineUpdate(id: ID!, input: OrderLineInput!): DraftOrderLineUpdate
draftOrderUpdate(id: ID!, input: DraftOrderInput!): DraftOrderUpdate
orderAddNote(order: ID!, input: OrderAddNoteInput!): OrderAddNote
orderCancel(id: ID!): OrderCancel
@ -2738,6 +2714,9 @@ type Mutation {
orderFulfillmentUpdateTracking(id: ID!, input: FulfillmentUpdateTrackingInput!): FulfillmentUpdateTracking
orderFulfillmentRefundProducts(input: OrderRefundProductsInput!, order: ID!): FulfillmentRefundProducts
orderFulfillmentReturnProducts(input: OrderReturnProductsInput!, order: ID!): FulfillmentReturnProducts
orderLinesCreate(id: ID!, input: [OrderLineCreateInput]!): OrderLinesCreate
orderLineDelete(id: ID!): OrderLineDelete
orderLineUpdate(id: ID!, input: OrderLineInput!): OrderLineUpdate
orderDiscountAdd(input: OrderDiscountCommonInput!, orderId: ID!): OrderDiscountAdd
orderDiscountUpdate(discountId: ID!, input: OrderDiscountCommonInput!): OrderDiscountUpdate
orderDiscountDelete(discountId: ID!): OrderDiscountDelete
@ -3168,8 +3147,8 @@ enum OrderEventsEmailsEnum {
enum OrderEventsEnum {
DRAFT_CREATED
DRAFT_CREATED_FROM_REPLACE
DRAFT_ADDED_PRODUCTS
DRAFT_REMOVED_PRODUCTS
ADDED_PRODUCTS
REMOVED_PRODUCTS
PLACED
PLACED_FROM_DRAFT
OVERSOLD_ITEMS
@ -3268,6 +3247,13 @@ input OrderLineCreateInput {
variantId: ID!
}
type OrderLineDelete {
errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
order: Order
orderLine: OrderLine
orderErrors: [OrderError!]!
}
type OrderLineDiscountRemove {
errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
orderLine: OrderLine
@ -3286,6 +3272,20 @@ input OrderLineInput {
quantity: Int!
}
type OrderLineUpdate {
errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
order: Order
orderErrors: [OrderError!]!
orderLine: OrderLine
}
type OrderLinesCreate {
errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
order: Order
orderLines: [OrderLine!]
orderErrors: [OrderError!]!
}
type OrderMarkAsPaid {
errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
order: Order

View file

@ -26,6 +26,8 @@ import { OrderStatus } from "../../../types/globalTypes";
import { OrderDetails_order } from "../../types/OrderDetails";
import OrderCustomer from "../OrderCustomer";
import OrderCustomerNote from "../OrderCustomerNote";
import OrderDraftDetails from "../OrderDraftDetails/OrderDraftDetails";
import { FormData as OrderDraftDetailsProductsFormData } from "../OrderDraftDetailsProducts";
import OrderFulfilledProductsCard from "../OrderFulfilledProductsCard";
import OrderHistory, { FormData as HistoryFormData } from "../OrderHistory";
import OrderInvoiceList from "../OrderInvoiceList";
@ -62,6 +64,13 @@ export interface OrderDetailsPageProps extends UserPermissionProps {
}>;
disabled: boolean;
saveButtonBarState: ConfirmButtonTransitionState;
onOrderLineAdd?: () => void;
onOrderLineChange?: (
id: string,
data: OrderDraftDetailsProductsFormData
) => void;
onOrderLineRemove?: (id: string) => void;
onShippingMethodEdit?: () => void;
onBack();
onBillingAddressEdit();
onFulfillmentCancel(id: string);
@ -121,6 +130,10 @@ const OrderDetailsPage: React.FC<OrderDetailsPageProps> = props => {
onInvoiceGenerate,
onInvoiceSend,
onOrderReturn,
onOrderLineAdd,
onOrderLineChange,
onOrderLineRemove,
onShippingMethodEdit,
onSubmit
} = props;
const classes = useStyles(props);
@ -132,10 +145,11 @@ const OrderDetailsPage: React.FC<OrderDetailsPageProps> = props => {
makeChangeHandler: makeMetadataChangeHandler
} = useMetadataChangeTrigger();
const canCancel = maybe(() => order.status) !== OrderStatus.CANCELED;
const canEditAddresses = maybe(() => order.status) !== OrderStatus.CANCELED;
const canFulfill = maybe(() => order.status) !== OrderStatus.CANCELED;
const unfulfilled = maybe(() => order.lines, []).filter(
const isOrderUnconfirmed = order?.status === OrderStatus.UNCONFIRMED;
const canCancel = order?.status !== OrderStatus.CANCELED;
const canEditAddresses = order?.status !== OrderStatus.CANCELED;
const canFulfill = order?.status !== OrderStatus.CANCELED;
const unfulfilled = (order?.lines || []).filter(
line => line.quantityFulfilled < line.quantity
);
@ -156,16 +170,16 @@ const OrderDetailsPage: React.FC<OrderDetailsPageProps> = props => {
privateMetadata: order?.privateMetadata.map(mapMetadataItemToInput)
};
const saveLabel =
order?.status === OrderStatus.UNCONFIRMED
const saveLabel = isOrderUnconfirmed
? intl.formatMessage(messages.confirmOrder)
: undefined;
const allowSave = (hasChanged: boolean) => {
if (order?.status !== OrderStatus.UNCONFIRMED) {
if (!isOrderUnconfirmed) {
return disabled || !hasChanged;
} else if (!order?.lines?.length) {
return true;
}
return disabled;
};
@ -214,11 +228,24 @@ const OrderDetailsPage: React.FC<OrderDetailsPageProps> = props => {
</div>
<Grid>
<div>
{!isOrderUnconfirmed ? (
<OrderUnfulfilledProductsCard
canFulfill={canFulfill}
lines={unfulfilled}
onFulfill={onOrderFulfill}
/>
) : (
<>
<OrderDraftDetails
order={order}
onOrderLineAdd={onOrderLineAdd}
onOrderLineChange={onOrderLineChange}
onOrderLineRemove={onOrderLineRemove}
onShippingMethodEdit={onShippingMethodEdit}
/>
<CardSpacer />
</>
)}
{order?.fulfillments?.map(fulfillment => (
<React.Fragment key={fulfillment.id}>
<OrderFulfilledProductsCard
@ -234,6 +261,8 @@ const OrderDetailsPage: React.FC<OrderDetailsPageProps> = props => {
/>
</React.Fragment>
))}
{!isOrderUnconfirmed && (
<>
<OrderPayment
order={order}
onCapture={onPaymentCapture}
@ -243,6 +272,8 @@ const OrderDetailsPage: React.FC<OrderDetailsPageProps> = props => {
/>
<CardSpacer />
<Metadata data={data} onChange={changeMetadata} />
</>
)}
<OrderHistory
history={order?.events}
orderCurrency={order?.total?.gross.currency}
@ -264,7 +295,7 @@ const OrderDetailsPage: React.FC<OrderDetailsPageProps> = props => {
selectedChannelName={order?.channel?.name}
/>
<CardSpacer />
{order?.status !== OrderStatus.UNCONFIRMED && (
{!isOrderUnconfirmed && (
<>
<OrderInvoiceList
invoices={order?.invoices}

View file

@ -32,9 +32,9 @@ export const getEventMessage = (
defaultMessage: "Order was cancelled",
description: "order history message"
});
case OrderEventsEnum.DRAFT_ADDED_PRODUCTS:
case OrderEventsEnum.ADDED_PRODUCTS:
return intl.formatMessage({
defaultMessage: "Products were added to draft order",
defaultMessage: "Products were added to an order",
description: "order history message"
});
case OrderEventsEnum.DRAFT_CREATED:
@ -42,9 +42,9 @@ export const getEventMessage = (
defaultMessage: "Draft order was created",
description: "order history message"
});
case OrderEventsEnum.DRAFT_REMOVED_PRODUCTS:
case OrderEventsEnum.REMOVED_PRODUCTS:
return intl.formatMessage({
defaultMessage: "Products were deleted from draft order",
defaultMessage: "Products were deleted from an order",
description: "order history message"
});
case OrderEventsEnum.EMAIL_SENT:
@ -59,7 +59,7 @@ export const getEventMessage = (
defaultMessage: "Fulfillment confirmation was sent to customer",
description: "order history message"
});
case OrderEventsEmailsEnum.ORDER_CONFIRMATION:
case OrderEventsEmailsEnum.CONFIRMED:
return intl.formatMessage({
defaultMessage: "Order confirmation was sent to customer",
description: "order history message"
@ -84,6 +84,11 @@ export const getEventMessage = (
defaultMessage: "Order cancel information was sent to customer",
description: "order history message"
});
case OrderEventsEmailsEnum.ORDER_CONFIRMATION:
return intl.formatMessage({
defaultMessage: "Order placed information was sent to customer",
description: "order history message"
});
case OrderEventsEmailsEnum.ORDER_REFUND:
return intl.formatMessage({
defaultMessage: "Order refund information was sent to customer",

View file

@ -99,6 +99,7 @@ export const OrderList: React.FC<OrderListProps> = props => {
return (
<ResponsiveTable>
<TableHead>
<TableRow>
<TableCellHeader
direction={
sort.sort === OrderListUrlSortField.number
@ -170,6 +171,7 @@ export const OrderList: React.FC<OrderListProps> = props => {
description="total order price"
/>
</TableCellHeader>
</TableRow>
</TableHead>
<TableFooter>
<TableRow>

View file

@ -189,9 +189,8 @@ const OrderProductAddDialog: React.FC<OrderProductAddDialogProps> = props => {
onClose: () => setVariants([])
});
const productChoices = products.filter(
product => product.variants?.length > 0
);
const productChoices =
products?.filter(product => product.variants?.length > 0) || [];
const selectedVariantsToProductsMap = productChoices
? productChoices.map(product =>
product.variants.map(variant => isVariantSelected(variant, variants))
@ -332,10 +331,12 @@ const OrderProductAddDialog: React.FC<OrderProductAddDialogProps> = props => {
</div>
</TableCell>
<TableCell className={classes.textRight}>
{variant?.channelListings[0]?.price && (
<Money
money={variant.channelListings[0].price}
/>
{variant.channelListings.map(
listing =>
listing.channel.id ===
selectedChannelId && (
<Money money={listing.price} />
)
)}
</TableCell>
</TableRow>

View file

@ -552,6 +552,36 @@ const orderShippingMethodUpdateMutation = gql`
...OrderErrorFragment
}
order {
availableShippingMethods {
id
name
}
total {
tax {
amount
currency
}
gross {
amount
currency
}
}
id
shippingMethod {
id
name
price {
amount
currency
}
}
shippingMethodName
shippingPrice {
gross {
amount
currency
}
}
...OrderDetailsFragment
}
}
@ -584,7 +614,7 @@ const orderLineDeleteMutation = gql`
${fragmentOrderDetails}
${orderErrorFragment}
mutation OrderLineDelete($id: ID!) {
draftOrderLineDelete(id: $id) {
orderLineDelete(id: $id) {
errors: orderErrors {
...OrderErrorFragment
}
@ -603,7 +633,7 @@ const orderLinesAddMutation = gql`
${fragmentOrderDetails}
${orderErrorFragment}
mutation OrderLinesAdd($id: ID!, $input: [OrderLineCreateInput]!) {
draftOrderLinesCreate(id: $id, input: $input) {
orderLinesCreate(id: $id, input: $input) {
errors: orderErrors {
...OrderErrorFragment
}
@ -622,7 +652,7 @@ const orderLineUpdateMutation = gql`
${fragmentOrderDetails}
${orderErrorFragment}
mutation OrderLineUpdate($id: ID!, $input: OrderLineInput!) {
draftOrderLineUpdate(id: $id, input: $input) {
orderLineUpdate(id: $id, input: $input) {
errors: orderErrors {
...OrderErrorFragment
}

View file

@ -9,36 +9,36 @@ import { OrderErrorCode, OrderDiscountType, DiscountValueTypeEnum, OrderEventsEm
// GraphQL mutation operation: OrderLineDelete
// ====================================================
export interface OrderLineDelete_draftOrderLineDelete_errors {
export interface OrderLineDelete_orderLineDelete_errors {
__typename: "OrderError";
code: OrderErrorCode;
field: string | null;
}
export interface OrderLineDelete_draftOrderLineDelete_order_metadata {
export interface OrderLineDelete_orderLineDelete_order_metadata {
__typename: "MetadataItem";
key: string;
value: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_privateMetadata {
export interface OrderLineDelete_orderLineDelete_order_privateMetadata {
__typename: "MetadataItem";
key: string;
value: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_billingAddress_country {
export interface OrderLineDelete_orderLineDelete_order_billingAddress_country {
__typename: "CountryDisplay";
code: string;
country: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_billingAddress {
export interface OrderLineDelete_orderLineDelete_order_billingAddress {
__typename: "Address";
city: string;
cityArea: string;
companyName: string;
country: OrderLineDelete_draftOrderLineDelete_order_billingAddress_country;
country: OrderLineDelete_orderLineDelete_order_billingAddress_country;
countryArea: string;
firstName: string;
id: string;
@ -49,52 +49,52 @@ export interface OrderLineDelete_draftOrderLineDelete_order_billingAddress {
streetAddress2: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_discounts_amount {
export interface OrderLineDelete_orderLineDelete_order_discounts_amount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_discounts {
export interface OrderLineDelete_orderLineDelete_order_discounts {
__typename: "OrderDiscount";
id: string;
type: OrderDiscountType;
calculationMode: DiscountValueTypeEnum;
value: any;
reason: string | null;
amount: OrderLineDelete_draftOrderLineDelete_order_discounts_amount;
amount: OrderLineDelete_orderLineDelete_order_discounts_amount;
}
export interface OrderLineDelete_draftOrderLineDelete_order_events_discount_amount {
export interface OrderLineDelete_orderLineDelete_order_events_discount_amount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_events_discount_oldAmount {
export interface OrderLineDelete_orderLineDelete_order_events_discount_oldAmount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_events_discount {
export interface OrderLineDelete_orderLineDelete_order_events_discount {
__typename: "OrderEventDiscountObject";
valueType: DiscountValueTypeEnum;
value: any;
reason: string | null;
amount: OrderLineDelete_draftOrderLineDelete_order_events_discount_amount | null;
amount: OrderLineDelete_orderLineDelete_order_events_discount_amount | null;
oldValueType: DiscountValueTypeEnum | null;
oldValue: any | null;
oldAmount: OrderLineDelete_draftOrderLineDelete_order_events_discount_oldAmount | null;
oldAmount: OrderLineDelete_orderLineDelete_order_events_discount_oldAmount | null;
}
export interface OrderLineDelete_draftOrderLineDelete_order_events_relatedOrder {
export interface OrderLineDelete_orderLineDelete_order_events_relatedOrder {
__typename: "Order";
id: string;
number: string | null;
}
export interface OrderLineDelete_draftOrderLineDelete_order_events_user {
export interface OrderLineDelete_orderLineDelete_order_events_user {
__typename: "User";
id: string;
email: string;
@ -102,45 +102,45 @@ export interface OrderLineDelete_draftOrderLineDelete_order_events_user {
lastName: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_events_lines_discount_amount {
export interface OrderLineDelete_orderLineDelete_order_events_lines_discount_amount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_events_lines_discount_oldAmount {
export interface OrderLineDelete_orderLineDelete_order_events_lines_discount_oldAmount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_events_lines_discount {
export interface OrderLineDelete_orderLineDelete_order_events_lines_discount {
__typename: "OrderEventDiscountObject";
valueType: DiscountValueTypeEnum;
value: any;
reason: string | null;
amount: OrderLineDelete_draftOrderLineDelete_order_events_lines_discount_amount | null;
amount: OrderLineDelete_orderLineDelete_order_events_lines_discount_amount | null;
oldValueType: DiscountValueTypeEnum | null;
oldValue: any | null;
oldAmount: OrderLineDelete_draftOrderLineDelete_order_events_lines_discount_oldAmount | null;
oldAmount: OrderLineDelete_orderLineDelete_order_events_lines_discount_oldAmount | null;
}
export interface OrderLineDelete_draftOrderLineDelete_order_events_lines_orderLine {
export interface OrderLineDelete_orderLineDelete_order_events_lines_orderLine {
__typename: "OrderLine";
id: string;
productName: string;
variantName: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_events_lines {
export interface OrderLineDelete_orderLineDelete_order_events_lines {
__typename: "OrderEventOrderLineObject";
quantity: number | null;
itemName: string | null;
discount: OrderLineDelete_draftOrderLineDelete_order_events_lines_discount | null;
orderLine: OrderLineDelete_draftOrderLineDelete_order_events_lines_orderLine | null;
discount: OrderLineDelete_orderLineDelete_order_events_lines_discount | null;
orderLine: OrderLineDelete_orderLineDelete_order_events_lines_orderLine | null;
}
export interface OrderLineDelete_draftOrderLineDelete_order_events {
export interface OrderLineDelete_orderLineDelete_order_events {
__typename: "OrderEvent";
id: string;
amount: number | null;
@ -149,195 +149,195 @@ export interface OrderLineDelete_draftOrderLineDelete_order_events {
email: string | null;
emailType: OrderEventsEmailsEnum | null;
invoiceNumber: string | null;
discount: OrderLineDelete_draftOrderLineDelete_order_events_discount | null;
relatedOrder: OrderLineDelete_draftOrderLineDelete_order_events_relatedOrder | null;
discount: OrderLineDelete_orderLineDelete_order_events_discount | null;
relatedOrder: OrderLineDelete_orderLineDelete_order_events_relatedOrder | null;
message: string | null;
quantity: number | null;
transactionReference: string | null;
type: OrderEventsEnum | null;
user: OrderLineDelete_draftOrderLineDelete_order_events_user | null;
lines: (OrderLineDelete_draftOrderLineDelete_order_events_lines | null)[] | null;
user: OrderLineDelete_orderLineDelete_order_events_user | null;
lines: (OrderLineDelete_orderLineDelete_order_events_lines | null)[] | null;
}
export interface OrderLineDelete_draftOrderLineDelete_order_fulfillments_lines_orderLine_variant {
export interface OrderLineDelete_orderLineDelete_order_fulfillments_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
}
export interface OrderLineDelete_draftOrderLineDelete_order_fulfillments_lines_orderLine_unitDiscount {
export interface OrderLineDelete_orderLineDelete_order_fulfillments_lines_orderLine_unitDiscount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_fulfillments_lines_orderLine_undiscountedUnitPrice_gross {
export interface OrderLineDelete_orderLineDelete_order_fulfillments_lines_orderLine_undiscountedUnitPrice_gross {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_fulfillments_lines_orderLine_undiscountedUnitPrice_net {
export interface OrderLineDelete_orderLineDelete_order_fulfillments_lines_orderLine_undiscountedUnitPrice_net {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_fulfillments_lines_orderLine_undiscountedUnitPrice {
export interface OrderLineDelete_orderLineDelete_order_fulfillments_lines_orderLine_undiscountedUnitPrice {
__typename: "TaxedMoney";
currency: string;
gross: OrderLineDelete_draftOrderLineDelete_order_fulfillments_lines_orderLine_undiscountedUnitPrice_gross;
net: OrderLineDelete_draftOrderLineDelete_order_fulfillments_lines_orderLine_undiscountedUnitPrice_net;
gross: OrderLineDelete_orderLineDelete_order_fulfillments_lines_orderLine_undiscountedUnitPrice_gross;
net: OrderLineDelete_orderLineDelete_order_fulfillments_lines_orderLine_undiscountedUnitPrice_net;
}
export interface OrderLineDelete_draftOrderLineDelete_order_fulfillments_lines_orderLine_unitPrice_gross {
export interface OrderLineDelete_orderLineDelete_order_fulfillments_lines_orderLine_unitPrice_gross {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_fulfillments_lines_orderLine_unitPrice_net {
export interface OrderLineDelete_orderLineDelete_order_fulfillments_lines_orderLine_unitPrice_net {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_fulfillments_lines_orderLine_unitPrice {
export interface OrderLineDelete_orderLineDelete_order_fulfillments_lines_orderLine_unitPrice {
__typename: "TaxedMoney";
gross: OrderLineDelete_draftOrderLineDelete_order_fulfillments_lines_orderLine_unitPrice_gross;
net: OrderLineDelete_draftOrderLineDelete_order_fulfillments_lines_orderLine_unitPrice_net;
gross: OrderLineDelete_orderLineDelete_order_fulfillments_lines_orderLine_unitPrice_gross;
net: OrderLineDelete_orderLineDelete_order_fulfillments_lines_orderLine_unitPrice_net;
}
export interface OrderLineDelete_draftOrderLineDelete_order_fulfillments_lines_orderLine_thumbnail {
export interface OrderLineDelete_orderLineDelete_order_fulfillments_lines_orderLine_thumbnail {
__typename: "Image";
url: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_fulfillments_lines_orderLine {
export interface OrderLineDelete_orderLineDelete_order_fulfillments_lines_orderLine {
__typename: "OrderLine";
id: string;
isShippingRequired: boolean;
variant: OrderLineDelete_draftOrderLineDelete_order_fulfillments_lines_orderLine_variant | null;
variant: OrderLineDelete_orderLineDelete_order_fulfillments_lines_orderLine_variant | null;
productName: string;
productSku: string;
quantity: number;
quantityFulfilled: number;
unitDiscount: OrderLineDelete_draftOrderLineDelete_order_fulfillments_lines_orderLine_unitDiscount;
unitDiscount: OrderLineDelete_orderLineDelete_order_fulfillments_lines_orderLine_unitDiscount;
unitDiscountValue: any;
unitDiscountReason: string | null;
unitDiscountType: DiscountValueTypeEnum | null;
undiscountedUnitPrice: OrderLineDelete_draftOrderLineDelete_order_fulfillments_lines_orderLine_undiscountedUnitPrice;
unitPrice: OrderLineDelete_draftOrderLineDelete_order_fulfillments_lines_orderLine_unitPrice;
thumbnail: OrderLineDelete_draftOrderLineDelete_order_fulfillments_lines_orderLine_thumbnail | null;
undiscountedUnitPrice: OrderLineDelete_orderLineDelete_order_fulfillments_lines_orderLine_undiscountedUnitPrice;
unitPrice: OrderLineDelete_orderLineDelete_order_fulfillments_lines_orderLine_unitPrice;
thumbnail: OrderLineDelete_orderLineDelete_order_fulfillments_lines_orderLine_thumbnail | null;
}
export interface OrderLineDelete_draftOrderLineDelete_order_fulfillments_lines {
export interface OrderLineDelete_orderLineDelete_order_fulfillments_lines {
__typename: "FulfillmentLine";
id: string;
quantity: number;
orderLine: OrderLineDelete_draftOrderLineDelete_order_fulfillments_lines_orderLine | null;
orderLine: OrderLineDelete_orderLineDelete_order_fulfillments_lines_orderLine | null;
}
export interface OrderLineDelete_draftOrderLineDelete_order_fulfillments_warehouse {
export interface OrderLineDelete_orderLineDelete_order_fulfillments_warehouse {
__typename: "Warehouse";
id: string;
name: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_fulfillments {
export interface OrderLineDelete_orderLineDelete_order_fulfillments {
__typename: "Fulfillment";
id: string;
lines: (OrderLineDelete_draftOrderLineDelete_order_fulfillments_lines | null)[] | null;
lines: (OrderLineDelete_orderLineDelete_order_fulfillments_lines | null)[] | null;
fulfillmentOrder: number;
status: FulfillmentStatus;
trackingNumber: string;
warehouse: OrderLineDelete_draftOrderLineDelete_order_fulfillments_warehouse | null;
warehouse: OrderLineDelete_orderLineDelete_order_fulfillments_warehouse | null;
}
export interface OrderLineDelete_draftOrderLineDelete_order_lines_variant {
export interface OrderLineDelete_orderLineDelete_order_lines_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
}
export interface OrderLineDelete_draftOrderLineDelete_order_lines_unitDiscount {
export interface OrderLineDelete_orderLineDelete_order_lines_unitDiscount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_lines_undiscountedUnitPrice_gross {
export interface OrderLineDelete_orderLineDelete_order_lines_undiscountedUnitPrice_gross {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_lines_undiscountedUnitPrice_net {
export interface OrderLineDelete_orderLineDelete_order_lines_undiscountedUnitPrice_net {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_lines_undiscountedUnitPrice {
export interface OrderLineDelete_orderLineDelete_order_lines_undiscountedUnitPrice {
__typename: "TaxedMoney";
currency: string;
gross: OrderLineDelete_draftOrderLineDelete_order_lines_undiscountedUnitPrice_gross;
net: OrderLineDelete_draftOrderLineDelete_order_lines_undiscountedUnitPrice_net;
gross: OrderLineDelete_orderLineDelete_order_lines_undiscountedUnitPrice_gross;
net: OrderLineDelete_orderLineDelete_order_lines_undiscountedUnitPrice_net;
}
export interface OrderLineDelete_draftOrderLineDelete_order_lines_unitPrice_gross {
export interface OrderLineDelete_orderLineDelete_order_lines_unitPrice_gross {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_lines_unitPrice_net {
export interface OrderLineDelete_orderLineDelete_order_lines_unitPrice_net {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_lines_unitPrice {
export interface OrderLineDelete_orderLineDelete_order_lines_unitPrice {
__typename: "TaxedMoney";
gross: OrderLineDelete_draftOrderLineDelete_order_lines_unitPrice_gross;
net: OrderLineDelete_draftOrderLineDelete_order_lines_unitPrice_net;
gross: OrderLineDelete_orderLineDelete_order_lines_unitPrice_gross;
net: OrderLineDelete_orderLineDelete_order_lines_unitPrice_net;
}
export interface OrderLineDelete_draftOrderLineDelete_order_lines_thumbnail {
export interface OrderLineDelete_orderLineDelete_order_lines_thumbnail {
__typename: "Image";
url: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_lines {
export interface OrderLineDelete_orderLineDelete_order_lines {
__typename: "OrderLine";
id: string;
isShippingRequired: boolean;
variant: OrderLineDelete_draftOrderLineDelete_order_lines_variant | null;
variant: OrderLineDelete_orderLineDelete_order_lines_variant | null;
productName: string;
productSku: string;
quantity: number;
quantityFulfilled: number;
unitDiscount: OrderLineDelete_draftOrderLineDelete_order_lines_unitDiscount;
unitDiscount: OrderLineDelete_orderLineDelete_order_lines_unitDiscount;
unitDiscountValue: any;
unitDiscountReason: string | null;
unitDiscountType: DiscountValueTypeEnum | null;
undiscountedUnitPrice: OrderLineDelete_draftOrderLineDelete_order_lines_undiscountedUnitPrice;
unitPrice: OrderLineDelete_draftOrderLineDelete_order_lines_unitPrice;
thumbnail: OrderLineDelete_draftOrderLineDelete_order_lines_thumbnail | null;
undiscountedUnitPrice: OrderLineDelete_orderLineDelete_order_lines_undiscountedUnitPrice;
unitPrice: OrderLineDelete_orderLineDelete_order_lines_unitPrice;
thumbnail: OrderLineDelete_orderLineDelete_order_lines_thumbnail | null;
}
export interface OrderLineDelete_draftOrderLineDelete_order_shippingAddress_country {
export interface OrderLineDelete_orderLineDelete_order_shippingAddress_country {
__typename: "CountryDisplay";
code: string;
country: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_shippingAddress {
export interface OrderLineDelete_orderLineDelete_order_shippingAddress {
__typename: "Address";
city: string;
cityArea: string;
companyName: string;
country: OrderLineDelete_draftOrderLineDelete_order_shippingAddress_country;
country: OrderLineDelete_orderLineDelete_order_shippingAddress_country;
countryArea: string;
firstName: string;
id: string;
@ -348,121 +348,121 @@ export interface OrderLineDelete_draftOrderLineDelete_order_shippingAddress {
streetAddress2: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_shippingMethod {
export interface OrderLineDelete_orderLineDelete_order_shippingMethod {
__typename: "ShippingMethod";
id: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_shippingPrice_gross {
export interface OrderLineDelete_orderLineDelete_order_shippingPrice_gross {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_shippingPrice {
export interface OrderLineDelete_orderLineDelete_order_shippingPrice {
__typename: "TaxedMoney";
gross: OrderLineDelete_draftOrderLineDelete_order_shippingPrice_gross;
gross: OrderLineDelete_orderLineDelete_order_shippingPrice_gross;
}
export interface OrderLineDelete_draftOrderLineDelete_order_subtotal_gross {
export interface OrderLineDelete_orderLineDelete_order_subtotal_gross {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_subtotal_net {
export interface OrderLineDelete_orderLineDelete_order_subtotal_net {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_subtotal {
export interface OrderLineDelete_orderLineDelete_order_subtotal {
__typename: "TaxedMoney";
gross: OrderLineDelete_draftOrderLineDelete_order_subtotal_gross;
net: OrderLineDelete_draftOrderLineDelete_order_subtotal_net;
gross: OrderLineDelete_orderLineDelete_order_subtotal_gross;
net: OrderLineDelete_orderLineDelete_order_subtotal_net;
}
export interface OrderLineDelete_draftOrderLineDelete_order_total_gross {
export interface OrderLineDelete_orderLineDelete_order_total_gross {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_total_net {
export interface OrderLineDelete_orderLineDelete_order_total_net {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_total_tax {
export interface OrderLineDelete_orderLineDelete_order_total_tax {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_total {
export interface OrderLineDelete_orderLineDelete_order_total {
__typename: "TaxedMoney";
gross: OrderLineDelete_draftOrderLineDelete_order_total_gross;
net: OrderLineDelete_draftOrderLineDelete_order_total_net;
tax: OrderLineDelete_draftOrderLineDelete_order_total_tax;
gross: OrderLineDelete_orderLineDelete_order_total_gross;
net: OrderLineDelete_orderLineDelete_order_total_net;
tax: OrderLineDelete_orderLineDelete_order_total_tax;
}
export interface OrderLineDelete_draftOrderLineDelete_order_totalAuthorized {
export interface OrderLineDelete_orderLineDelete_order_totalAuthorized {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_totalCaptured {
export interface OrderLineDelete_orderLineDelete_order_totalCaptured {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_undiscountedTotal_net {
export interface OrderLineDelete_orderLineDelete_order_undiscountedTotal_net {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_undiscountedTotal_gross {
export interface OrderLineDelete_orderLineDelete_order_undiscountedTotal_gross {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_undiscountedTotal {
export interface OrderLineDelete_orderLineDelete_order_undiscountedTotal {
__typename: "TaxedMoney";
net: OrderLineDelete_draftOrderLineDelete_order_undiscountedTotal_net;
gross: OrderLineDelete_draftOrderLineDelete_order_undiscountedTotal_gross;
net: OrderLineDelete_orderLineDelete_order_undiscountedTotal_net;
gross: OrderLineDelete_orderLineDelete_order_undiscountedTotal_gross;
}
export interface OrderLineDelete_draftOrderLineDelete_order_user {
export interface OrderLineDelete_orderLineDelete_order_user {
__typename: "User";
id: string;
email: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_availableShippingMethods_price {
export interface OrderLineDelete_orderLineDelete_order_availableShippingMethods_price {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_availableShippingMethods {
export interface OrderLineDelete_orderLineDelete_order_availableShippingMethods {
__typename: "ShippingMethod";
id: string;
name: string;
price: OrderLineDelete_draftOrderLineDelete_order_availableShippingMethods_price | null;
price: OrderLineDelete_orderLineDelete_order_availableShippingMethods_price | null;
}
export interface OrderLineDelete_draftOrderLineDelete_order_discount {
export interface OrderLineDelete_orderLineDelete_order_discount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order_invoices {
export interface OrderLineDelete_orderLineDelete_order_invoices {
__typename: "Invoice";
id: string;
number: string | null;
@ -471,7 +471,7 @@ export interface OrderLineDelete_draftOrderLineDelete_order_invoices {
status: JobStatusEnum;
}
export interface OrderLineDelete_draftOrderLineDelete_order_channel {
export interface OrderLineDelete_orderLineDelete_order_channel {
__typename: "Channel";
isActive: boolean;
id: string;
@ -479,50 +479,50 @@ export interface OrderLineDelete_draftOrderLineDelete_order_channel {
currencyCode: string;
}
export interface OrderLineDelete_draftOrderLineDelete_order {
export interface OrderLineDelete_orderLineDelete_order {
__typename: "Order";
id: string;
metadata: (OrderLineDelete_draftOrderLineDelete_order_metadata | null)[];
privateMetadata: (OrderLineDelete_draftOrderLineDelete_order_privateMetadata | null)[];
billingAddress: OrderLineDelete_draftOrderLineDelete_order_billingAddress | null;
metadata: (OrderLineDelete_orderLineDelete_order_metadata | null)[];
privateMetadata: (OrderLineDelete_orderLineDelete_order_privateMetadata | null)[];
billingAddress: OrderLineDelete_orderLineDelete_order_billingAddress | null;
isShippingRequired: boolean;
canFinalize: boolean;
created: any;
customerNote: string;
discounts: OrderLineDelete_draftOrderLineDelete_order_discounts[] | null;
events: (OrderLineDelete_draftOrderLineDelete_order_events | null)[] | null;
fulfillments: (OrderLineDelete_draftOrderLineDelete_order_fulfillments | null)[];
lines: (OrderLineDelete_draftOrderLineDelete_order_lines | null)[];
discounts: OrderLineDelete_orderLineDelete_order_discounts[] | null;
events: (OrderLineDelete_orderLineDelete_order_events | null)[] | null;
fulfillments: (OrderLineDelete_orderLineDelete_order_fulfillments | null)[];
lines: (OrderLineDelete_orderLineDelete_order_lines | null)[];
number: string | null;
paymentStatus: PaymentChargeStatusEnum;
shippingAddress: OrderLineDelete_draftOrderLineDelete_order_shippingAddress | null;
shippingMethod: OrderLineDelete_draftOrderLineDelete_order_shippingMethod | null;
shippingAddress: OrderLineDelete_orderLineDelete_order_shippingAddress | null;
shippingMethod: OrderLineDelete_orderLineDelete_order_shippingMethod | null;
shippingMethodName: string | null;
shippingPrice: OrderLineDelete_draftOrderLineDelete_order_shippingPrice;
shippingPrice: OrderLineDelete_orderLineDelete_order_shippingPrice;
status: OrderStatus;
subtotal: OrderLineDelete_draftOrderLineDelete_order_subtotal;
total: OrderLineDelete_draftOrderLineDelete_order_total;
subtotal: OrderLineDelete_orderLineDelete_order_subtotal;
total: OrderLineDelete_orderLineDelete_order_total;
actions: (OrderAction | null)[];
totalAuthorized: OrderLineDelete_draftOrderLineDelete_order_totalAuthorized;
totalCaptured: OrderLineDelete_draftOrderLineDelete_order_totalCaptured;
undiscountedTotal: OrderLineDelete_draftOrderLineDelete_order_undiscountedTotal;
user: OrderLineDelete_draftOrderLineDelete_order_user | null;
totalAuthorized: OrderLineDelete_orderLineDelete_order_totalAuthorized;
totalCaptured: OrderLineDelete_orderLineDelete_order_totalCaptured;
undiscountedTotal: OrderLineDelete_orderLineDelete_order_undiscountedTotal;
user: OrderLineDelete_orderLineDelete_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderLineDelete_draftOrderLineDelete_order_availableShippingMethods | null)[] | null;
discount: OrderLineDelete_draftOrderLineDelete_order_discount | null;
invoices: (OrderLineDelete_draftOrderLineDelete_order_invoices | null)[] | null;
channel: OrderLineDelete_draftOrderLineDelete_order_channel;
availableShippingMethods: (OrderLineDelete_orderLineDelete_order_availableShippingMethods | null)[] | null;
discount: OrderLineDelete_orderLineDelete_order_discount | null;
invoices: (OrderLineDelete_orderLineDelete_order_invoices | null)[] | null;
channel: OrderLineDelete_orderLineDelete_order_channel;
isPaid: boolean;
}
export interface OrderLineDelete_draftOrderLineDelete {
__typename: "DraftOrderLineDelete";
errors: OrderLineDelete_draftOrderLineDelete_errors[];
order: OrderLineDelete_draftOrderLineDelete_order | null;
export interface OrderLineDelete_orderLineDelete {
__typename: "OrderLineDelete";
errors: OrderLineDelete_orderLineDelete_errors[];
order: OrderLineDelete_orderLineDelete_order | null;
}
export interface OrderLineDelete {
draftOrderLineDelete: OrderLineDelete_draftOrderLineDelete | null;
orderLineDelete: OrderLineDelete_orderLineDelete | null;
}
export interface OrderLineDeleteVariables {

View file

@ -9,36 +9,36 @@ import { OrderLineInput, OrderErrorCode, OrderDiscountType, DiscountValueTypeEnu
// GraphQL mutation operation: OrderLineUpdate
// ====================================================
export interface OrderLineUpdate_draftOrderLineUpdate_errors {
export interface OrderLineUpdate_orderLineUpdate_errors {
__typename: "OrderError";
code: OrderErrorCode;
field: string | null;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_metadata {
export interface OrderLineUpdate_orderLineUpdate_order_metadata {
__typename: "MetadataItem";
key: string;
value: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_privateMetadata {
export interface OrderLineUpdate_orderLineUpdate_order_privateMetadata {
__typename: "MetadataItem";
key: string;
value: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_billingAddress_country {
export interface OrderLineUpdate_orderLineUpdate_order_billingAddress_country {
__typename: "CountryDisplay";
code: string;
country: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_billingAddress {
export interface OrderLineUpdate_orderLineUpdate_order_billingAddress {
__typename: "Address";
city: string;
cityArea: string;
companyName: string;
country: OrderLineUpdate_draftOrderLineUpdate_order_billingAddress_country;
country: OrderLineUpdate_orderLineUpdate_order_billingAddress_country;
countryArea: string;
firstName: string;
id: string;
@ -49,52 +49,52 @@ export interface OrderLineUpdate_draftOrderLineUpdate_order_billingAddress {
streetAddress2: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_discounts_amount {
export interface OrderLineUpdate_orderLineUpdate_order_discounts_amount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_discounts {
export interface OrderLineUpdate_orderLineUpdate_order_discounts {
__typename: "OrderDiscount";
id: string;
type: OrderDiscountType;
calculationMode: DiscountValueTypeEnum;
value: any;
reason: string | null;
amount: OrderLineUpdate_draftOrderLineUpdate_order_discounts_amount;
amount: OrderLineUpdate_orderLineUpdate_order_discounts_amount;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_events_discount_amount {
export interface OrderLineUpdate_orderLineUpdate_order_events_discount_amount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_events_discount_oldAmount {
export interface OrderLineUpdate_orderLineUpdate_order_events_discount_oldAmount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_events_discount {
export interface OrderLineUpdate_orderLineUpdate_order_events_discount {
__typename: "OrderEventDiscountObject";
valueType: DiscountValueTypeEnum;
value: any;
reason: string | null;
amount: OrderLineUpdate_draftOrderLineUpdate_order_events_discount_amount | null;
amount: OrderLineUpdate_orderLineUpdate_order_events_discount_amount | null;
oldValueType: DiscountValueTypeEnum | null;
oldValue: any | null;
oldAmount: OrderLineUpdate_draftOrderLineUpdate_order_events_discount_oldAmount | null;
oldAmount: OrderLineUpdate_orderLineUpdate_order_events_discount_oldAmount | null;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_events_relatedOrder {
export interface OrderLineUpdate_orderLineUpdate_order_events_relatedOrder {
__typename: "Order";
id: string;
number: string | null;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_events_user {
export interface OrderLineUpdate_orderLineUpdate_order_events_user {
__typename: "User";
id: string;
email: string;
@ -102,45 +102,45 @@ export interface OrderLineUpdate_draftOrderLineUpdate_order_events_user {
lastName: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_events_lines_discount_amount {
export interface OrderLineUpdate_orderLineUpdate_order_events_lines_discount_amount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_events_lines_discount_oldAmount {
export interface OrderLineUpdate_orderLineUpdate_order_events_lines_discount_oldAmount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_events_lines_discount {
export interface OrderLineUpdate_orderLineUpdate_order_events_lines_discount {
__typename: "OrderEventDiscountObject";
valueType: DiscountValueTypeEnum;
value: any;
reason: string | null;
amount: OrderLineUpdate_draftOrderLineUpdate_order_events_lines_discount_amount | null;
amount: OrderLineUpdate_orderLineUpdate_order_events_lines_discount_amount | null;
oldValueType: DiscountValueTypeEnum | null;
oldValue: any | null;
oldAmount: OrderLineUpdate_draftOrderLineUpdate_order_events_lines_discount_oldAmount | null;
oldAmount: OrderLineUpdate_orderLineUpdate_order_events_lines_discount_oldAmount | null;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_events_lines_orderLine {
export interface OrderLineUpdate_orderLineUpdate_order_events_lines_orderLine {
__typename: "OrderLine";
id: string;
productName: string;
variantName: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_events_lines {
export interface OrderLineUpdate_orderLineUpdate_order_events_lines {
__typename: "OrderEventOrderLineObject";
quantity: number | null;
itemName: string | null;
discount: OrderLineUpdate_draftOrderLineUpdate_order_events_lines_discount | null;
orderLine: OrderLineUpdate_draftOrderLineUpdate_order_events_lines_orderLine | null;
discount: OrderLineUpdate_orderLineUpdate_order_events_lines_discount | null;
orderLine: OrderLineUpdate_orderLineUpdate_order_events_lines_orderLine | null;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_events {
export interface OrderLineUpdate_orderLineUpdate_order_events {
__typename: "OrderEvent";
id: string;
amount: number | null;
@ -149,195 +149,195 @@ export interface OrderLineUpdate_draftOrderLineUpdate_order_events {
email: string | null;
emailType: OrderEventsEmailsEnum | null;
invoiceNumber: string | null;
discount: OrderLineUpdate_draftOrderLineUpdate_order_events_discount | null;
relatedOrder: OrderLineUpdate_draftOrderLineUpdate_order_events_relatedOrder | null;
discount: OrderLineUpdate_orderLineUpdate_order_events_discount | null;
relatedOrder: OrderLineUpdate_orderLineUpdate_order_events_relatedOrder | null;
message: string | null;
quantity: number | null;
transactionReference: string | null;
type: OrderEventsEnum | null;
user: OrderLineUpdate_draftOrderLineUpdate_order_events_user | null;
lines: (OrderLineUpdate_draftOrderLineUpdate_order_events_lines | null)[] | null;
user: OrderLineUpdate_orderLineUpdate_order_events_user | null;
lines: (OrderLineUpdate_orderLineUpdate_order_events_lines | null)[] | null;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_fulfillments_lines_orderLine_variant {
export interface OrderLineUpdate_orderLineUpdate_order_fulfillments_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_fulfillments_lines_orderLine_unitDiscount {
export interface OrderLineUpdate_orderLineUpdate_order_fulfillments_lines_orderLine_unitDiscount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_fulfillments_lines_orderLine_undiscountedUnitPrice_gross {
export interface OrderLineUpdate_orderLineUpdate_order_fulfillments_lines_orderLine_undiscountedUnitPrice_gross {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_fulfillments_lines_orderLine_undiscountedUnitPrice_net {
export interface OrderLineUpdate_orderLineUpdate_order_fulfillments_lines_orderLine_undiscountedUnitPrice_net {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_fulfillments_lines_orderLine_undiscountedUnitPrice {
export interface OrderLineUpdate_orderLineUpdate_order_fulfillments_lines_orderLine_undiscountedUnitPrice {
__typename: "TaxedMoney";
currency: string;
gross: OrderLineUpdate_draftOrderLineUpdate_order_fulfillments_lines_orderLine_undiscountedUnitPrice_gross;
net: OrderLineUpdate_draftOrderLineUpdate_order_fulfillments_lines_orderLine_undiscountedUnitPrice_net;
gross: OrderLineUpdate_orderLineUpdate_order_fulfillments_lines_orderLine_undiscountedUnitPrice_gross;
net: OrderLineUpdate_orderLineUpdate_order_fulfillments_lines_orderLine_undiscountedUnitPrice_net;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_fulfillments_lines_orderLine_unitPrice_gross {
export interface OrderLineUpdate_orderLineUpdate_order_fulfillments_lines_orderLine_unitPrice_gross {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_fulfillments_lines_orderLine_unitPrice_net {
export interface OrderLineUpdate_orderLineUpdate_order_fulfillments_lines_orderLine_unitPrice_net {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_fulfillments_lines_orderLine_unitPrice {
export interface OrderLineUpdate_orderLineUpdate_order_fulfillments_lines_orderLine_unitPrice {
__typename: "TaxedMoney";
gross: OrderLineUpdate_draftOrderLineUpdate_order_fulfillments_lines_orderLine_unitPrice_gross;
net: OrderLineUpdate_draftOrderLineUpdate_order_fulfillments_lines_orderLine_unitPrice_net;
gross: OrderLineUpdate_orderLineUpdate_order_fulfillments_lines_orderLine_unitPrice_gross;
net: OrderLineUpdate_orderLineUpdate_order_fulfillments_lines_orderLine_unitPrice_net;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_fulfillments_lines_orderLine_thumbnail {
export interface OrderLineUpdate_orderLineUpdate_order_fulfillments_lines_orderLine_thumbnail {
__typename: "Image";
url: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_fulfillments_lines_orderLine {
export interface OrderLineUpdate_orderLineUpdate_order_fulfillments_lines_orderLine {
__typename: "OrderLine";
id: string;
isShippingRequired: boolean;
variant: OrderLineUpdate_draftOrderLineUpdate_order_fulfillments_lines_orderLine_variant | null;
variant: OrderLineUpdate_orderLineUpdate_order_fulfillments_lines_orderLine_variant | null;
productName: string;
productSku: string;
quantity: number;
quantityFulfilled: number;
unitDiscount: OrderLineUpdate_draftOrderLineUpdate_order_fulfillments_lines_orderLine_unitDiscount;
unitDiscount: OrderLineUpdate_orderLineUpdate_order_fulfillments_lines_orderLine_unitDiscount;
unitDiscountValue: any;
unitDiscountReason: string | null;
unitDiscountType: DiscountValueTypeEnum | null;
undiscountedUnitPrice: OrderLineUpdate_draftOrderLineUpdate_order_fulfillments_lines_orderLine_undiscountedUnitPrice;
unitPrice: OrderLineUpdate_draftOrderLineUpdate_order_fulfillments_lines_orderLine_unitPrice;
thumbnail: OrderLineUpdate_draftOrderLineUpdate_order_fulfillments_lines_orderLine_thumbnail | null;
undiscountedUnitPrice: OrderLineUpdate_orderLineUpdate_order_fulfillments_lines_orderLine_undiscountedUnitPrice;
unitPrice: OrderLineUpdate_orderLineUpdate_order_fulfillments_lines_orderLine_unitPrice;
thumbnail: OrderLineUpdate_orderLineUpdate_order_fulfillments_lines_orderLine_thumbnail | null;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_fulfillments_lines {
export interface OrderLineUpdate_orderLineUpdate_order_fulfillments_lines {
__typename: "FulfillmentLine";
id: string;
quantity: number;
orderLine: OrderLineUpdate_draftOrderLineUpdate_order_fulfillments_lines_orderLine | null;
orderLine: OrderLineUpdate_orderLineUpdate_order_fulfillments_lines_orderLine | null;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_fulfillments_warehouse {
export interface OrderLineUpdate_orderLineUpdate_order_fulfillments_warehouse {
__typename: "Warehouse";
id: string;
name: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_fulfillments {
export interface OrderLineUpdate_orderLineUpdate_order_fulfillments {
__typename: "Fulfillment";
id: string;
lines: (OrderLineUpdate_draftOrderLineUpdate_order_fulfillments_lines | null)[] | null;
lines: (OrderLineUpdate_orderLineUpdate_order_fulfillments_lines | null)[] | null;
fulfillmentOrder: number;
status: FulfillmentStatus;
trackingNumber: string;
warehouse: OrderLineUpdate_draftOrderLineUpdate_order_fulfillments_warehouse | null;
warehouse: OrderLineUpdate_orderLineUpdate_order_fulfillments_warehouse | null;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_lines_variant {
export interface OrderLineUpdate_orderLineUpdate_order_lines_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_lines_unitDiscount {
export interface OrderLineUpdate_orderLineUpdate_order_lines_unitDiscount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_lines_undiscountedUnitPrice_gross {
export interface OrderLineUpdate_orderLineUpdate_order_lines_undiscountedUnitPrice_gross {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_lines_undiscountedUnitPrice_net {
export interface OrderLineUpdate_orderLineUpdate_order_lines_undiscountedUnitPrice_net {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_lines_undiscountedUnitPrice {
export interface OrderLineUpdate_orderLineUpdate_order_lines_undiscountedUnitPrice {
__typename: "TaxedMoney";
currency: string;
gross: OrderLineUpdate_draftOrderLineUpdate_order_lines_undiscountedUnitPrice_gross;
net: OrderLineUpdate_draftOrderLineUpdate_order_lines_undiscountedUnitPrice_net;
gross: OrderLineUpdate_orderLineUpdate_order_lines_undiscountedUnitPrice_gross;
net: OrderLineUpdate_orderLineUpdate_order_lines_undiscountedUnitPrice_net;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_lines_unitPrice_gross {
export interface OrderLineUpdate_orderLineUpdate_order_lines_unitPrice_gross {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_lines_unitPrice_net {
export interface OrderLineUpdate_orderLineUpdate_order_lines_unitPrice_net {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_lines_unitPrice {
export interface OrderLineUpdate_orderLineUpdate_order_lines_unitPrice {
__typename: "TaxedMoney";
gross: OrderLineUpdate_draftOrderLineUpdate_order_lines_unitPrice_gross;
net: OrderLineUpdate_draftOrderLineUpdate_order_lines_unitPrice_net;
gross: OrderLineUpdate_orderLineUpdate_order_lines_unitPrice_gross;
net: OrderLineUpdate_orderLineUpdate_order_lines_unitPrice_net;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_lines_thumbnail {
export interface OrderLineUpdate_orderLineUpdate_order_lines_thumbnail {
__typename: "Image";
url: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_lines {
export interface OrderLineUpdate_orderLineUpdate_order_lines {
__typename: "OrderLine";
id: string;
isShippingRequired: boolean;
variant: OrderLineUpdate_draftOrderLineUpdate_order_lines_variant | null;
variant: OrderLineUpdate_orderLineUpdate_order_lines_variant | null;
productName: string;
productSku: string;
quantity: number;
quantityFulfilled: number;
unitDiscount: OrderLineUpdate_draftOrderLineUpdate_order_lines_unitDiscount;
unitDiscount: OrderLineUpdate_orderLineUpdate_order_lines_unitDiscount;
unitDiscountValue: any;
unitDiscountReason: string | null;
unitDiscountType: DiscountValueTypeEnum | null;
undiscountedUnitPrice: OrderLineUpdate_draftOrderLineUpdate_order_lines_undiscountedUnitPrice;
unitPrice: OrderLineUpdate_draftOrderLineUpdate_order_lines_unitPrice;
thumbnail: OrderLineUpdate_draftOrderLineUpdate_order_lines_thumbnail | null;
undiscountedUnitPrice: OrderLineUpdate_orderLineUpdate_order_lines_undiscountedUnitPrice;
unitPrice: OrderLineUpdate_orderLineUpdate_order_lines_unitPrice;
thumbnail: OrderLineUpdate_orderLineUpdate_order_lines_thumbnail | null;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_shippingAddress_country {
export interface OrderLineUpdate_orderLineUpdate_order_shippingAddress_country {
__typename: "CountryDisplay";
code: string;
country: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_shippingAddress {
export interface OrderLineUpdate_orderLineUpdate_order_shippingAddress {
__typename: "Address";
city: string;
cityArea: string;
companyName: string;
country: OrderLineUpdate_draftOrderLineUpdate_order_shippingAddress_country;
country: OrderLineUpdate_orderLineUpdate_order_shippingAddress_country;
countryArea: string;
firstName: string;
id: string;
@ -348,121 +348,121 @@ export interface OrderLineUpdate_draftOrderLineUpdate_order_shippingAddress {
streetAddress2: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_shippingMethod {
export interface OrderLineUpdate_orderLineUpdate_order_shippingMethod {
__typename: "ShippingMethod";
id: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_shippingPrice_gross {
export interface OrderLineUpdate_orderLineUpdate_order_shippingPrice_gross {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_shippingPrice {
export interface OrderLineUpdate_orderLineUpdate_order_shippingPrice {
__typename: "TaxedMoney";
gross: OrderLineUpdate_draftOrderLineUpdate_order_shippingPrice_gross;
gross: OrderLineUpdate_orderLineUpdate_order_shippingPrice_gross;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_subtotal_gross {
export interface OrderLineUpdate_orderLineUpdate_order_subtotal_gross {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_subtotal_net {
export interface OrderLineUpdate_orderLineUpdate_order_subtotal_net {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_subtotal {
export interface OrderLineUpdate_orderLineUpdate_order_subtotal {
__typename: "TaxedMoney";
gross: OrderLineUpdate_draftOrderLineUpdate_order_subtotal_gross;
net: OrderLineUpdate_draftOrderLineUpdate_order_subtotal_net;
gross: OrderLineUpdate_orderLineUpdate_order_subtotal_gross;
net: OrderLineUpdate_orderLineUpdate_order_subtotal_net;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_total_gross {
export interface OrderLineUpdate_orderLineUpdate_order_total_gross {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_total_net {
export interface OrderLineUpdate_orderLineUpdate_order_total_net {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_total_tax {
export interface OrderLineUpdate_orderLineUpdate_order_total_tax {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_total {
export interface OrderLineUpdate_orderLineUpdate_order_total {
__typename: "TaxedMoney";
gross: OrderLineUpdate_draftOrderLineUpdate_order_total_gross;
net: OrderLineUpdate_draftOrderLineUpdate_order_total_net;
tax: OrderLineUpdate_draftOrderLineUpdate_order_total_tax;
gross: OrderLineUpdate_orderLineUpdate_order_total_gross;
net: OrderLineUpdate_orderLineUpdate_order_total_net;
tax: OrderLineUpdate_orderLineUpdate_order_total_tax;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_totalAuthorized {
export interface OrderLineUpdate_orderLineUpdate_order_totalAuthorized {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_totalCaptured {
export interface OrderLineUpdate_orderLineUpdate_order_totalCaptured {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_undiscountedTotal_net {
export interface OrderLineUpdate_orderLineUpdate_order_undiscountedTotal_net {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_undiscountedTotal_gross {
export interface OrderLineUpdate_orderLineUpdate_order_undiscountedTotal_gross {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_undiscountedTotal {
export interface OrderLineUpdate_orderLineUpdate_order_undiscountedTotal {
__typename: "TaxedMoney";
net: OrderLineUpdate_draftOrderLineUpdate_order_undiscountedTotal_net;
gross: OrderLineUpdate_draftOrderLineUpdate_order_undiscountedTotal_gross;
net: OrderLineUpdate_orderLineUpdate_order_undiscountedTotal_net;
gross: OrderLineUpdate_orderLineUpdate_order_undiscountedTotal_gross;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_user {
export interface OrderLineUpdate_orderLineUpdate_order_user {
__typename: "User";
id: string;
email: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_availableShippingMethods_price {
export interface OrderLineUpdate_orderLineUpdate_order_availableShippingMethods_price {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_availableShippingMethods {
export interface OrderLineUpdate_orderLineUpdate_order_availableShippingMethods {
__typename: "ShippingMethod";
id: string;
name: string;
price: OrderLineUpdate_draftOrderLineUpdate_order_availableShippingMethods_price | null;
price: OrderLineUpdate_orderLineUpdate_order_availableShippingMethods_price | null;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_discount {
export interface OrderLineUpdate_orderLineUpdate_order_discount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_invoices {
export interface OrderLineUpdate_orderLineUpdate_order_invoices {
__typename: "Invoice";
id: string;
number: string | null;
@ -471,7 +471,7 @@ export interface OrderLineUpdate_draftOrderLineUpdate_order_invoices {
status: JobStatusEnum;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order_channel {
export interface OrderLineUpdate_orderLineUpdate_order_channel {
__typename: "Channel";
isActive: boolean;
id: string;
@ -479,50 +479,50 @@ export interface OrderLineUpdate_draftOrderLineUpdate_order_channel {
currencyCode: string;
}
export interface OrderLineUpdate_draftOrderLineUpdate_order {
export interface OrderLineUpdate_orderLineUpdate_order {
__typename: "Order";
id: string;
metadata: (OrderLineUpdate_draftOrderLineUpdate_order_metadata | null)[];
privateMetadata: (OrderLineUpdate_draftOrderLineUpdate_order_privateMetadata | null)[];
billingAddress: OrderLineUpdate_draftOrderLineUpdate_order_billingAddress | null;
metadata: (OrderLineUpdate_orderLineUpdate_order_metadata | null)[];
privateMetadata: (OrderLineUpdate_orderLineUpdate_order_privateMetadata | null)[];
billingAddress: OrderLineUpdate_orderLineUpdate_order_billingAddress | null;
isShippingRequired: boolean;
canFinalize: boolean;
created: any;
customerNote: string;
discounts: OrderLineUpdate_draftOrderLineUpdate_order_discounts[] | null;
events: (OrderLineUpdate_draftOrderLineUpdate_order_events | null)[] | null;
fulfillments: (OrderLineUpdate_draftOrderLineUpdate_order_fulfillments | null)[];
lines: (OrderLineUpdate_draftOrderLineUpdate_order_lines | null)[];
discounts: OrderLineUpdate_orderLineUpdate_order_discounts[] | null;
events: (OrderLineUpdate_orderLineUpdate_order_events | null)[] | null;
fulfillments: (OrderLineUpdate_orderLineUpdate_order_fulfillments | null)[];
lines: (OrderLineUpdate_orderLineUpdate_order_lines | null)[];
number: string | null;
paymentStatus: PaymentChargeStatusEnum;
shippingAddress: OrderLineUpdate_draftOrderLineUpdate_order_shippingAddress | null;
shippingMethod: OrderLineUpdate_draftOrderLineUpdate_order_shippingMethod | null;
shippingAddress: OrderLineUpdate_orderLineUpdate_order_shippingAddress | null;
shippingMethod: OrderLineUpdate_orderLineUpdate_order_shippingMethod | null;
shippingMethodName: string | null;
shippingPrice: OrderLineUpdate_draftOrderLineUpdate_order_shippingPrice;
shippingPrice: OrderLineUpdate_orderLineUpdate_order_shippingPrice;
status: OrderStatus;
subtotal: OrderLineUpdate_draftOrderLineUpdate_order_subtotal;
total: OrderLineUpdate_draftOrderLineUpdate_order_total;
subtotal: OrderLineUpdate_orderLineUpdate_order_subtotal;
total: OrderLineUpdate_orderLineUpdate_order_total;
actions: (OrderAction | null)[];
totalAuthorized: OrderLineUpdate_draftOrderLineUpdate_order_totalAuthorized;
totalCaptured: OrderLineUpdate_draftOrderLineUpdate_order_totalCaptured;
undiscountedTotal: OrderLineUpdate_draftOrderLineUpdate_order_undiscountedTotal;
user: OrderLineUpdate_draftOrderLineUpdate_order_user | null;
totalAuthorized: OrderLineUpdate_orderLineUpdate_order_totalAuthorized;
totalCaptured: OrderLineUpdate_orderLineUpdate_order_totalCaptured;
undiscountedTotal: OrderLineUpdate_orderLineUpdate_order_undiscountedTotal;
user: OrderLineUpdate_orderLineUpdate_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderLineUpdate_draftOrderLineUpdate_order_availableShippingMethods | null)[] | null;
discount: OrderLineUpdate_draftOrderLineUpdate_order_discount | null;
invoices: (OrderLineUpdate_draftOrderLineUpdate_order_invoices | null)[] | null;
channel: OrderLineUpdate_draftOrderLineUpdate_order_channel;
availableShippingMethods: (OrderLineUpdate_orderLineUpdate_order_availableShippingMethods | null)[] | null;
discount: OrderLineUpdate_orderLineUpdate_order_discount | null;
invoices: (OrderLineUpdate_orderLineUpdate_order_invoices | null)[] | null;
channel: OrderLineUpdate_orderLineUpdate_order_channel;
isPaid: boolean;
}
export interface OrderLineUpdate_draftOrderLineUpdate {
__typename: "DraftOrderLineUpdate";
errors: OrderLineUpdate_draftOrderLineUpdate_errors[];
order: OrderLineUpdate_draftOrderLineUpdate_order | null;
export interface OrderLineUpdate_orderLineUpdate {
__typename: "OrderLineUpdate";
errors: OrderLineUpdate_orderLineUpdate_errors[];
order: OrderLineUpdate_orderLineUpdate_order | null;
}
export interface OrderLineUpdate {
draftOrderLineUpdate: OrderLineUpdate_draftOrderLineUpdate | null;
orderLineUpdate: OrderLineUpdate_orderLineUpdate | null;
}
export interface OrderLineUpdateVariables {

View file

@ -9,36 +9,36 @@ import { OrderLineCreateInput, OrderErrorCode, OrderDiscountType, DiscountValueT
// GraphQL mutation operation: OrderLinesAdd
// ====================================================
export interface OrderLinesAdd_draftOrderLinesCreate_errors {
export interface OrderLinesAdd_orderLinesCreate_errors {
__typename: "OrderError";
code: OrderErrorCode;
field: string | null;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_metadata {
export interface OrderLinesAdd_orderLinesCreate_order_metadata {
__typename: "MetadataItem";
key: string;
value: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_privateMetadata {
export interface OrderLinesAdd_orderLinesCreate_order_privateMetadata {
__typename: "MetadataItem";
key: string;
value: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_billingAddress_country {
export interface OrderLinesAdd_orderLinesCreate_order_billingAddress_country {
__typename: "CountryDisplay";
code: string;
country: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_billingAddress {
export interface OrderLinesAdd_orderLinesCreate_order_billingAddress {
__typename: "Address";
city: string;
cityArea: string;
companyName: string;
country: OrderLinesAdd_draftOrderLinesCreate_order_billingAddress_country;
country: OrderLinesAdd_orderLinesCreate_order_billingAddress_country;
countryArea: string;
firstName: string;
id: string;
@ -49,52 +49,52 @@ export interface OrderLinesAdd_draftOrderLinesCreate_order_billingAddress {
streetAddress2: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_discounts_amount {
export interface OrderLinesAdd_orderLinesCreate_order_discounts_amount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_discounts {
export interface OrderLinesAdd_orderLinesCreate_order_discounts {
__typename: "OrderDiscount";
id: string;
type: OrderDiscountType;
calculationMode: DiscountValueTypeEnum;
value: any;
reason: string | null;
amount: OrderLinesAdd_draftOrderLinesCreate_order_discounts_amount;
amount: OrderLinesAdd_orderLinesCreate_order_discounts_amount;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_events_discount_amount {
export interface OrderLinesAdd_orderLinesCreate_order_events_discount_amount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_events_discount_oldAmount {
export interface OrderLinesAdd_orderLinesCreate_order_events_discount_oldAmount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_events_discount {
export interface OrderLinesAdd_orderLinesCreate_order_events_discount {
__typename: "OrderEventDiscountObject";
valueType: DiscountValueTypeEnum;
value: any;
reason: string | null;
amount: OrderLinesAdd_draftOrderLinesCreate_order_events_discount_amount | null;
amount: OrderLinesAdd_orderLinesCreate_order_events_discount_amount | null;
oldValueType: DiscountValueTypeEnum | null;
oldValue: any | null;
oldAmount: OrderLinesAdd_draftOrderLinesCreate_order_events_discount_oldAmount | null;
oldAmount: OrderLinesAdd_orderLinesCreate_order_events_discount_oldAmount | null;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_events_relatedOrder {
export interface OrderLinesAdd_orderLinesCreate_order_events_relatedOrder {
__typename: "Order";
id: string;
number: string | null;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_events_user {
export interface OrderLinesAdd_orderLinesCreate_order_events_user {
__typename: "User";
id: string;
email: string;
@ -102,45 +102,45 @@ export interface OrderLinesAdd_draftOrderLinesCreate_order_events_user {
lastName: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_events_lines_discount_amount {
export interface OrderLinesAdd_orderLinesCreate_order_events_lines_discount_amount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_events_lines_discount_oldAmount {
export interface OrderLinesAdd_orderLinesCreate_order_events_lines_discount_oldAmount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_events_lines_discount {
export interface OrderLinesAdd_orderLinesCreate_order_events_lines_discount {
__typename: "OrderEventDiscountObject";
valueType: DiscountValueTypeEnum;
value: any;
reason: string | null;
amount: OrderLinesAdd_draftOrderLinesCreate_order_events_lines_discount_amount | null;
amount: OrderLinesAdd_orderLinesCreate_order_events_lines_discount_amount | null;
oldValueType: DiscountValueTypeEnum | null;
oldValue: any | null;
oldAmount: OrderLinesAdd_draftOrderLinesCreate_order_events_lines_discount_oldAmount | null;
oldAmount: OrderLinesAdd_orderLinesCreate_order_events_lines_discount_oldAmount | null;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_events_lines_orderLine {
export interface OrderLinesAdd_orderLinesCreate_order_events_lines_orderLine {
__typename: "OrderLine";
id: string;
productName: string;
variantName: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_events_lines {
export interface OrderLinesAdd_orderLinesCreate_order_events_lines {
__typename: "OrderEventOrderLineObject";
quantity: number | null;
itemName: string | null;
discount: OrderLinesAdd_draftOrderLinesCreate_order_events_lines_discount | null;
orderLine: OrderLinesAdd_draftOrderLinesCreate_order_events_lines_orderLine | null;
discount: OrderLinesAdd_orderLinesCreate_order_events_lines_discount | null;
orderLine: OrderLinesAdd_orderLinesCreate_order_events_lines_orderLine | null;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_events {
export interface OrderLinesAdd_orderLinesCreate_order_events {
__typename: "OrderEvent";
id: string;
amount: number | null;
@ -149,195 +149,195 @@ export interface OrderLinesAdd_draftOrderLinesCreate_order_events {
email: string | null;
emailType: OrderEventsEmailsEnum | null;
invoiceNumber: string | null;
discount: OrderLinesAdd_draftOrderLinesCreate_order_events_discount | null;
relatedOrder: OrderLinesAdd_draftOrderLinesCreate_order_events_relatedOrder | null;
discount: OrderLinesAdd_orderLinesCreate_order_events_discount | null;
relatedOrder: OrderLinesAdd_orderLinesCreate_order_events_relatedOrder | null;
message: string | null;
quantity: number | null;
transactionReference: string | null;
type: OrderEventsEnum | null;
user: OrderLinesAdd_draftOrderLinesCreate_order_events_user | null;
lines: (OrderLinesAdd_draftOrderLinesCreate_order_events_lines | null)[] | null;
user: OrderLinesAdd_orderLinesCreate_order_events_user | null;
lines: (OrderLinesAdd_orderLinesCreate_order_events_lines | null)[] | null;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_fulfillments_lines_orderLine_variant {
export interface OrderLinesAdd_orderLinesCreate_order_fulfillments_lines_orderLine_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_fulfillments_lines_orderLine_unitDiscount {
export interface OrderLinesAdd_orderLinesCreate_order_fulfillments_lines_orderLine_unitDiscount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_fulfillments_lines_orderLine_undiscountedUnitPrice_gross {
export interface OrderLinesAdd_orderLinesCreate_order_fulfillments_lines_orderLine_undiscountedUnitPrice_gross {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_fulfillments_lines_orderLine_undiscountedUnitPrice_net {
export interface OrderLinesAdd_orderLinesCreate_order_fulfillments_lines_orderLine_undiscountedUnitPrice_net {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_fulfillments_lines_orderLine_undiscountedUnitPrice {
export interface OrderLinesAdd_orderLinesCreate_order_fulfillments_lines_orderLine_undiscountedUnitPrice {
__typename: "TaxedMoney";
currency: string;
gross: OrderLinesAdd_draftOrderLinesCreate_order_fulfillments_lines_orderLine_undiscountedUnitPrice_gross;
net: OrderLinesAdd_draftOrderLinesCreate_order_fulfillments_lines_orderLine_undiscountedUnitPrice_net;
gross: OrderLinesAdd_orderLinesCreate_order_fulfillments_lines_orderLine_undiscountedUnitPrice_gross;
net: OrderLinesAdd_orderLinesCreate_order_fulfillments_lines_orderLine_undiscountedUnitPrice_net;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_fulfillments_lines_orderLine_unitPrice_gross {
export interface OrderLinesAdd_orderLinesCreate_order_fulfillments_lines_orderLine_unitPrice_gross {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_fulfillments_lines_orderLine_unitPrice_net {
export interface OrderLinesAdd_orderLinesCreate_order_fulfillments_lines_orderLine_unitPrice_net {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_fulfillments_lines_orderLine_unitPrice {
export interface OrderLinesAdd_orderLinesCreate_order_fulfillments_lines_orderLine_unitPrice {
__typename: "TaxedMoney";
gross: OrderLinesAdd_draftOrderLinesCreate_order_fulfillments_lines_orderLine_unitPrice_gross;
net: OrderLinesAdd_draftOrderLinesCreate_order_fulfillments_lines_orderLine_unitPrice_net;
gross: OrderLinesAdd_orderLinesCreate_order_fulfillments_lines_orderLine_unitPrice_gross;
net: OrderLinesAdd_orderLinesCreate_order_fulfillments_lines_orderLine_unitPrice_net;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_fulfillments_lines_orderLine_thumbnail {
export interface OrderLinesAdd_orderLinesCreate_order_fulfillments_lines_orderLine_thumbnail {
__typename: "Image";
url: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_fulfillments_lines_orderLine {
export interface OrderLinesAdd_orderLinesCreate_order_fulfillments_lines_orderLine {
__typename: "OrderLine";
id: string;
isShippingRequired: boolean;
variant: OrderLinesAdd_draftOrderLinesCreate_order_fulfillments_lines_orderLine_variant | null;
variant: OrderLinesAdd_orderLinesCreate_order_fulfillments_lines_orderLine_variant | null;
productName: string;
productSku: string;
quantity: number;
quantityFulfilled: number;
unitDiscount: OrderLinesAdd_draftOrderLinesCreate_order_fulfillments_lines_orderLine_unitDiscount;
unitDiscount: OrderLinesAdd_orderLinesCreate_order_fulfillments_lines_orderLine_unitDiscount;
unitDiscountValue: any;
unitDiscountReason: string | null;
unitDiscountType: DiscountValueTypeEnum | null;
undiscountedUnitPrice: OrderLinesAdd_draftOrderLinesCreate_order_fulfillments_lines_orderLine_undiscountedUnitPrice;
unitPrice: OrderLinesAdd_draftOrderLinesCreate_order_fulfillments_lines_orderLine_unitPrice;
thumbnail: OrderLinesAdd_draftOrderLinesCreate_order_fulfillments_lines_orderLine_thumbnail | null;
undiscountedUnitPrice: OrderLinesAdd_orderLinesCreate_order_fulfillments_lines_orderLine_undiscountedUnitPrice;
unitPrice: OrderLinesAdd_orderLinesCreate_order_fulfillments_lines_orderLine_unitPrice;
thumbnail: OrderLinesAdd_orderLinesCreate_order_fulfillments_lines_orderLine_thumbnail | null;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_fulfillments_lines {
export interface OrderLinesAdd_orderLinesCreate_order_fulfillments_lines {
__typename: "FulfillmentLine";
id: string;
quantity: number;
orderLine: OrderLinesAdd_draftOrderLinesCreate_order_fulfillments_lines_orderLine | null;
orderLine: OrderLinesAdd_orderLinesCreate_order_fulfillments_lines_orderLine | null;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_fulfillments_warehouse {
export interface OrderLinesAdd_orderLinesCreate_order_fulfillments_warehouse {
__typename: "Warehouse";
id: string;
name: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_fulfillments {
export interface OrderLinesAdd_orderLinesCreate_order_fulfillments {
__typename: "Fulfillment";
id: string;
lines: (OrderLinesAdd_draftOrderLinesCreate_order_fulfillments_lines | null)[] | null;
lines: (OrderLinesAdd_orderLinesCreate_order_fulfillments_lines | null)[] | null;
fulfillmentOrder: number;
status: FulfillmentStatus;
trackingNumber: string;
warehouse: OrderLinesAdd_draftOrderLinesCreate_order_fulfillments_warehouse | null;
warehouse: OrderLinesAdd_orderLinesCreate_order_fulfillments_warehouse | null;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_lines_variant {
export interface OrderLinesAdd_orderLinesCreate_order_lines_variant {
__typename: "ProductVariant";
id: string;
quantityAvailable: number;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_lines_unitDiscount {
export interface OrderLinesAdd_orderLinesCreate_order_lines_unitDiscount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_lines_undiscountedUnitPrice_gross {
export interface OrderLinesAdd_orderLinesCreate_order_lines_undiscountedUnitPrice_gross {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_lines_undiscountedUnitPrice_net {
export interface OrderLinesAdd_orderLinesCreate_order_lines_undiscountedUnitPrice_net {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_lines_undiscountedUnitPrice {
export interface OrderLinesAdd_orderLinesCreate_order_lines_undiscountedUnitPrice {
__typename: "TaxedMoney";
currency: string;
gross: OrderLinesAdd_draftOrderLinesCreate_order_lines_undiscountedUnitPrice_gross;
net: OrderLinesAdd_draftOrderLinesCreate_order_lines_undiscountedUnitPrice_net;
gross: OrderLinesAdd_orderLinesCreate_order_lines_undiscountedUnitPrice_gross;
net: OrderLinesAdd_orderLinesCreate_order_lines_undiscountedUnitPrice_net;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_lines_unitPrice_gross {
export interface OrderLinesAdd_orderLinesCreate_order_lines_unitPrice_gross {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_lines_unitPrice_net {
export interface OrderLinesAdd_orderLinesCreate_order_lines_unitPrice_net {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_lines_unitPrice {
export interface OrderLinesAdd_orderLinesCreate_order_lines_unitPrice {
__typename: "TaxedMoney";
gross: OrderLinesAdd_draftOrderLinesCreate_order_lines_unitPrice_gross;
net: OrderLinesAdd_draftOrderLinesCreate_order_lines_unitPrice_net;
gross: OrderLinesAdd_orderLinesCreate_order_lines_unitPrice_gross;
net: OrderLinesAdd_orderLinesCreate_order_lines_unitPrice_net;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_lines_thumbnail {
export interface OrderLinesAdd_orderLinesCreate_order_lines_thumbnail {
__typename: "Image";
url: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_lines {
export interface OrderLinesAdd_orderLinesCreate_order_lines {
__typename: "OrderLine";
id: string;
isShippingRequired: boolean;
variant: OrderLinesAdd_draftOrderLinesCreate_order_lines_variant | null;
variant: OrderLinesAdd_orderLinesCreate_order_lines_variant | null;
productName: string;
productSku: string;
quantity: number;
quantityFulfilled: number;
unitDiscount: OrderLinesAdd_draftOrderLinesCreate_order_lines_unitDiscount;
unitDiscount: OrderLinesAdd_orderLinesCreate_order_lines_unitDiscount;
unitDiscountValue: any;
unitDiscountReason: string | null;
unitDiscountType: DiscountValueTypeEnum | null;
undiscountedUnitPrice: OrderLinesAdd_draftOrderLinesCreate_order_lines_undiscountedUnitPrice;
unitPrice: OrderLinesAdd_draftOrderLinesCreate_order_lines_unitPrice;
thumbnail: OrderLinesAdd_draftOrderLinesCreate_order_lines_thumbnail | null;
undiscountedUnitPrice: OrderLinesAdd_orderLinesCreate_order_lines_undiscountedUnitPrice;
unitPrice: OrderLinesAdd_orderLinesCreate_order_lines_unitPrice;
thumbnail: OrderLinesAdd_orderLinesCreate_order_lines_thumbnail | null;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_shippingAddress_country {
export interface OrderLinesAdd_orderLinesCreate_order_shippingAddress_country {
__typename: "CountryDisplay";
code: string;
country: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_shippingAddress {
export interface OrderLinesAdd_orderLinesCreate_order_shippingAddress {
__typename: "Address";
city: string;
cityArea: string;
companyName: string;
country: OrderLinesAdd_draftOrderLinesCreate_order_shippingAddress_country;
country: OrderLinesAdd_orderLinesCreate_order_shippingAddress_country;
countryArea: string;
firstName: string;
id: string;
@ -348,121 +348,121 @@ export interface OrderLinesAdd_draftOrderLinesCreate_order_shippingAddress {
streetAddress2: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_shippingMethod {
export interface OrderLinesAdd_orderLinesCreate_order_shippingMethod {
__typename: "ShippingMethod";
id: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_shippingPrice_gross {
export interface OrderLinesAdd_orderLinesCreate_order_shippingPrice_gross {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_shippingPrice {
export interface OrderLinesAdd_orderLinesCreate_order_shippingPrice {
__typename: "TaxedMoney";
gross: OrderLinesAdd_draftOrderLinesCreate_order_shippingPrice_gross;
gross: OrderLinesAdd_orderLinesCreate_order_shippingPrice_gross;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_subtotal_gross {
export interface OrderLinesAdd_orderLinesCreate_order_subtotal_gross {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_subtotal_net {
export interface OrderLinesAdd_orderLinesCreate_order_subtotal_net {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_subtotal {
export interface OrderLinesAdd_orderLinesCreate_order_subtotal {
__typename: "TaxedMoney";
gross: OrderLinesAdd_draftOrderLinesCreate_order_subtotal_gross;
net: OrderLinesAdd_draftOrderLinesCreate_order_subtotal_net;
gross: OrderLinesAdd_orderLinesCreate_order_subtotal_gross;
net: OrderLinesAdd_orderLinesCreate_order_subtotal_net;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_total_gross {
export interface OrderLinesAdd_orderLinesCreate_order_total_gross {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_total_net {
export interface OrderLinesAdd_orderLinesCreate_order_total_net {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_total_tax {
export interface OrderLinesAdd_orderLinesCreate_order_total_tax {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_total {
export interface OrderLinesAdd_orderLinesCreate_order_total {
__typename: "TaxedMoney";
gross: OrderLinesAdd_draftOrderLinesCreate_order_total_gross;
net: OrderLinesAdd_draftOrderLinesCreate_order_total_net;
tax: OrderLinesAdd_draftOrderLinesCreate_order_total_tax;
gross: OrderLinesAdd_orderLinesCreate_order_total_gross;
net: OrderLinesAdd_orderLinesCreate_order_total_net;
tax: OrderLinesAdd_orderLinesCreate_order_total_tax;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_totalAuthorized {
export interface OrderLinesAdd_orderLinesCreate_order_totalAuthorized {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_totalCaptured {
export interface OrderLinesAdd_orderLinesCreate_order_totalCaptured {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_undiscountedTotal_net {
export interface OrderLinesAdd_orderLinesCreate_order_undiscountedTotal_net {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_undiscountedTotal_gross {
export interface OrderLinesAdd_orderLinesCreate_order_undiscountedTotal_gross {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_undiscountedTotal {
export interface OrderLinesAdd_orderLinesCreate_order_undiscountedTotal {
__typename: "TaxedMoney";
net: OrderLinesAdd_draftOrderLinesCreate_order_undiscountedTotal_net;
gross: OrderLinesAdd_draftOrderLinesCreate_order_undiscountedTotal_gross;
net: OrderLinesAdd_orderLinesCreate_order_undiscountedTotal_net;
gross: OrderLinesAdd_orderLinesCreate_order_undiscountedTotal_gross;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_user {
export interface OrderLinesAdd_orderLinesCreate_order_user {
__typename: "User";
id: string;
email: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_availableShippingMethods_price {
export interface OrderLinesAdd_orderLinesCreate_order_availableShippingMethods_price {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_availableShippingMethods {
export interface OrderLinesAdd_orderLinesCreate_order_availableShippingMethods {
__typename: "ShippingMethod";
id: string;
name: string;
price: OrderLinesAdd_draftOrderLinesCreate_order_availableShippingMethods_price | null;
price: OrderLinesAdd_orderLinesCreate_order_availableShippingMethods_price | null;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_discount {
export interface OrderLinesAdd_orderLinesCreate_order_discount {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_invoices {
export interface OrderLinesAdd_orderLinesCreate_order_invoices {
__typename: "Invoice";
id: string;
number: string | null;
@ -471,7 +471,7 @@ export interface OrderLinesAdd_draftOrderLinesCreate_order_invoices {
status: JobStatusEnum;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order_channel {
export interface OrderLinesAdd_orderLinesCreate_order_channel {
__typename: "Channel";
isActive: boolean;
id: string;
@ -479,50 +479,50 @@ export interface OrderLinesAdd_draftOrderLinesCreate_order_channel {
currencyCode: string;
}
export interface OrderLinesAdd_draftOrderLinesCreate_order {
export interface OrderLinesAdd_orderLinesCreate_order {
__typename: "Order";
id: string;
metadata: (OrderLinesAdd_draftOrderLinesCreate_order_metadata | null)[];
privateMetadata: (OrderLinesAdd_draftOrderLinesCreate_order_privateMetadata | null)[];
billingAddress: OrderLinesAdd_draftOrderLinesCreate_order_billingAddress | null;
metadata: (OrderLinesAdd_orderLinesCreate_order_metadata | null)[];
privateMetadata: (OrderLinesAdd_orderLinesCreate_order_privateMetadata | null)[];
billingAddress: OrderLinesAdd_orderLinesCreate_order_billingAddress | null;
isShippingRequired: boolean;
canFinalize: boolean;
created: any;
customerNote: string;
discounts: OrderLinesAdd_draftOrderLinesCreate_order_discounts[] | null;
events: (OrderLinesAdd_draftOrderLinesCreate_order_events | null)[] | null;
fulfillments: (OrderLinesAdd_draftOrderLinesCreate_order_fulfillments | null)[];
lines: (OrderLinesAdd_draftOrderLinesCreate_order_lines | null)[];
discounts: OrderLinesAdd_orderLinesCreate_order_discounts[] | null;
events: (OrderLinesAdd_orderLinesCreate_order_events | null)[] | null;
fulfillments: (OrderLinesAdd_orderLinesCreate_order_fulfillments | null)[];
lines: (OrderLinesAdd_orderLinesCreate_order_lines | null)[];
number: string | null;
paymentStatus: PaymentChargeStatusEnum;
shippingAddress: OrderLinesAdd_draftOrderLinesCreate_order_shippingAddress | null;
shippingMethod: OrderLinesAdd_draftOrderLinesCreate_order_shippingMethod | null;
shippingAddress: OrderLinesAdd_orderLinesCreate_order_shippingAddress | null;
shippingMethod: OrderLinesAdd_orderLinesCreate_order_shippingMethod | null;
shippingMethodName: string | null;
shippingPrice: OrderLinesAdd_draftOrderLinesCreate_order_shippingPrice;
shippingPrice: OrderLinesAdd_orderLinesCreate_order_shippingPrice;
status: OrderStatus;
subtotal: OrderLinesAdd_draftOrderLinesCreate_order_subtotal;
total: OrderLinesAdd_draftOrderLinesCreate_order_total;
subtotal: OrderLinesAdd_orderLinesCreate_order_subtotal;
total: OrderLinesAdd_orderLinesCreate_order_total;
actions: (OrderAction | null)[];
totalAuthorized: OrderLinesAdd_draftOrderLinesCreate_order_totalAuthorized;
totalCaptured: OrderLinesAdd_draftOrderLinesCreate_order_totalCaptured;
undiscountedTotal: OrderLinesAdd_draftOrderLinesCreate_order_undiscountedTotal;
user: OrderLinesAdd_draftOrderLinesCreate_order_user | null;
totalAuthorized: OrderLinesAdd_orderLinesCreate_order_totalAuthorized;
totalCaptured: OrderLinesAdd_orderLinesCreate_order_totalCaptured;
undiscountedTotal: OrderLinesAdd_orderLinesCreate_order_undiscountedTotal;
user: OrderLinesAdd_orderLinesCreate_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderLinesAdd_draftOrderLinesCreate_order_availableShippingMethods | null)[] | null;
discount: OrderLinesAdd_draftOrderLinesCreate_order_discount | null;
invoices: (OrderLinesAdd_draftOrderLinesCreate_order_invoices | null)[] | null;
channel: OrderLinesAdd_draftOrderLinesCreate_order_channel;
availableShippingMethods: (OrderLinesAdd_orderLinesCreate_order_availableShippingMethods | null)[] | null;
discount: OrderLinesAdd_orderLinesCreate_order_discount | null;
invoices: (OrderLinesAdd_orderLinesCreate_order_invoices | null)[] | null;
channel: OrderLinesAdd_orderLinesCreate_order_channel;
isPaid: boolean;
}
export interface OrderLinesAdd_draftOrderLinesCreate {
__typename: "DraftOrderLinesCreate";
errors: OrderLinesAdd_draftOrderLinesCreate_errors[];
order: OrderLinesAdd_draftOrderLinesCreate_order | null;
export interface OrderLinesAdd_orderLinesCreate {
__typename: "OrderLinesCreate";
errors: OrderLinesAdd_orderLinesCreate_errors[];
order: OrderLinesAdd_orderLinesCreate_order | null;
}
export interface OrderLinesAdd {
draftOrderLinesCreate: OrderLinesAdd_draftOrderLinesCreate | null;
orderLinesCreate: OrderLinesAdd_orderLinesCreate | null;
}
export interface OrderLinesAddVariables {

View file

@ -15,6 +15,68 @@ export interface OrderShippingMethodUpdate_orderUpdateShipping_errors {
field: string | null;
}
export interface OrderShippingMethodUpdate_orderUpdateShipping_order_availableShippingMethods_price {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderShippingMethodUpdate_orderUpdateShipping_order_availableShippingMethods {
__typename: "ShippingMethod";
id: string;
name: string;
price: OrderShippingMethodUpdate_orderUpdateShipping_order_availableShippingMethods_price | null;
}
export interface OrderShippingMethodUpdate_orderUpdateShipping_order_total_tax {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderShippingMethodUpdate_orderUpdateShipping_order_total_gross {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderShippingMethodUpdate_orderUpdateShipping_order_total_net {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderShippingMethodUpdate_orderUpdateShipping_order_total {
__typename: "TaxedMoney";
tax: OrderShippingMethodUpdate_orderUpdateShipping_order_total_tax;
gross: OrderShippingMethodUpdate_orderUpdateShipping_order_total_gross;
net: OrderShippingMethodUpdate_orderUpdateShipping_order_total_net;
}
export interface OrderShippingMethodUpdate_orderUpdateShipping_order_shippingMethod_price {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderShippingMethodUpdate_orderUpdateShipping_order_shippingMethod {
__typename: "ShippingMethod";
id: string;
name: string;
price: OrderShippingMethodUpdate_orderUpdateShipping_order_shippingMethod_price | null;
}
export interface OrderShippingMethodUpdate_orderUpdateShipping_order_shippingPrice_gross {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderShippingMethodUpdate_orderUpdateShipping_order_shippingPrice {
__typename: "TaxedMoney";
gross: OrderShippingMethodUpdate_orderUpdateShipping_order_shippingPrice_gross;
}
export interface OrderShippingMethodUpdate_orderUpdateShipping_order_metadata {
__typename: "MetadataItem";
key: string;
@ -348,22 +410,6 @@ export interface OrderShippingMethodUpdate_orderUpdateShipping_order_shippingAdd
streetAddress2: string;
}
export interface OrderShippingMethodUpdate_orderUpdateShipping_order_shippingMethod {
__typename: "ShippingMethod";
id: string;
}
export interface OrderShippingMethodUpdate_orderUpdateShipping_order_shippingPrice_gross {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderShippingMethodUpdate_orderUpdateShipping_order_shippingPrice {
__typename: "TaxedMoney";
gross: OrderShippingMethodUpdate_orderUpdateShipping_order_shippingPrice_gross;
}
export interface OrderShippingMethodUpdate_orderUpdateShipping_order_subtotal_gross {
__typename: "Money";
amount: number;
@ -382,31 +428,6 @@ export interface OrderShippingMethodUpdate_orderUpdateShipping_order_subtotal {
net: OrderShippingMethodUpdate_orderUpdateShipping_order_subtotal_net;
}
export interface OrderShippingMethodUpdate_orderUpdateShipping_order_total_gross {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderShippingMethodUpdate_orderUpdateShipping_order_total_net {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderShippingMethodUpdate_orderUpdateShipping_order_total_tax {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderShippingMethodUpdate_orderUpdateShipping_order_total {
__typename: "TaxedMoney";
gross: OrderShippingMethodUpdate_orderUpdateShipping_order_total_gross;
net: OrderShippingMethodUpdate_orderUpdateShipping_order_total_net;
tax: OrderShippingMethodUpdate_orderUpdateShipping_order_total_tax;
}
export interface OrderShippingMethodUpdate_orderUpdateShipping_order_totalAuthorized {
__typename: "Money";
amount: number;
@ -443,19 +464,6 @@ export interface OrderShippingMethodUpdate_orderUpdateShipping_order_user {
email: string;
}
export interface OrderShippingMethodUpdate_orderUpdateShipping_order_availableShippingMethods_price {
__typename: "Money";
amount: number;
currency: string;
}
export interface OrderShippingMethodUpdate_orderUpdateShipping_order_availableShippingMethods {
__typename: "ShippingMethod";
id: string;
name: string;
price: OrderShippingMethodUpdate_orderUpdateShipping_order_availableShippingMethods_price | null;
}
export interface OrderShippingMethodUpdate_orderUpdateShipping_order_discount {
__typename: "Money";
amount: number;
@ -481,7 +489,12 @@ export interface OrderShippingMethodUpdate_orderUpdateShipping_order_channel {
export interface OrderShippingMethodUpdate_orderUpdateShipping_order {
__typename: "Order";
availableShippingMethods: (OrderShippingMethodUpdate_orderUpdateShipping_order_availableShippingMethods | null)[] | null;
total: OrderShippingMethodUpdate_orderUpdateShipping_order_total;
id: string;
shippingMethod: OrderShippingMethodUpdate_orderUpdateShipping_order_shippingMethod | null;
shippingMethodName: string | null;
shippingPrice: OrderShippingMethodUpdate_orderUpdateShipping_order_shippingPrice;
metadata: (OrderShippingMethodUpdate_orderUpdateShipping_order_metadata | null)[];
privateMetadata: (OrderShippingMethodUpdate_orderUpdateShipping_order_privateMetadata | null)[];
billingAddress: OrderShippingMethodUpdate_orderUpdateShipping_order_billingAddress | null;
@ -496,19 +509,14 @@ export interface OrderShippingMethodUpdate_orderUpdateShipping_order {
number: string | null;
paymentStatus: PaymentChargeStatusEnum;
shippingAddress: OrderShippingMethodUpdate_orderUpdateShipping_order_shippingAddress | null;
shippingMethod: OrderShippingMethodUpdate_orderUpdateShipping_order_shippingMethod | null;
shippingMethodName: string | null;
shippingPrice: OrderShippingMethodUpdate_orderUpdateShipping_order_shippingPrice;
status: OrderStatus;
subtotal: OrderShippingMethodUpdate_orderUpdateShipping_order_subtotal;
total: OrderShippingMethodUpdate_orderUpdateShipping_order_total;
actions: (OrderAction | null)[];
totalAuthorized: OrderShippingMethodUpdate_orderUpdateShipping_order_totalAuthorized;
totalCaptured: OrderShippingMethodUpdate_orderUpdateShipping_order_totalCaptured;
undiscountedTotal: OrderShippingMethodUpdate_orderUpdateShipping_order_undiscountedTotal;
user: OrderShippingMethodUpdate_orderUpdateShipping_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderShippingMethodUpdate_orderUpdateShipping_order_availableShippingMethods | null)[] | null;
discount: OrderShippingMethodUpdate_orderUpdateShipping_order_discount | null;
invoices: (OrderShippingMethodUpdate_orderUpdateShipping_order_invoices | null)[] | null;
channel: OrderShippingMethodUpdate_orderUpdateShipping_order_channel;

View file

@ -1,6 +1,7 @@
import messages from "@saleor/containers/BackgroundTasks/messages";
import useNavigator from "@saleor/hooks/useNavigator";
import useNotifier from "@saleor/hooks/useNotifier";
import getOrderErrorMessage from "@saleor/utils/errors/order";
import createDialogActionHandlers from "@saleor/utils/handlers/dialogActionHandlers";
import React from "react";
import { useIntl } from "react-intl";
@ -174,7 +175,7 @@ export const OrderDetailsMessages: React.FC<OrderDetailsMessages> = ({
}
};
const handleOrderLineDelete = (data: OrderLineDelete) => {
const errs = data.draftOrderLineDelete?.errors;
const errs = data.orderLineDelete?.errors;
if (errs.length === 0) {
pushMessage({
status: "success",
@ -185,7 +186,7 @@ export const OrderDetailsMessages: React.FC<OrderDetailsMessages> = ({
}
};
const handleOrderLinesAdd = (data: OrderLinesAdd) => {
const errs = data.draftOrderLinesCreate?.errors;
const errs = data.orderLinesCreate?.errors;
if (errs.length === 0) {
pushMessage({
status: "success",
@ -197,7 +198,7 @@ export const OrderDetailsMessages: React.FC<OrderDetailsMessages> = ({
}
};
const handleOrderLineUpdate = (data: OrderLineUpdate) => {
const errs = data.draftOrderLineUpdate?.errors;
const errs = data.orderLineUpdate?.errors;
if (errs.length === 0) {
pushMessage({
status: "success",
@ -205,6 +206,13 @@ export const OrderDetailsMessages: React.FC<OrderDetailsMessages> = ({
defaultMessage: "Order line updated"
})
});
} else {
errs.forEach(error =>
pushMessage({
status: "error",
text: getOrderErrorMessage(error, intl)
})
);
}
};
const handleOrderFulfillmentCancel = (data: OrderFulfillmentCancel) => {

View file

@ -0,0 +1,191 @@
import { WindowTitle } from "@saleor/components/WindowTitle";
import { DEFAULT_INITIAL_SEARCH_DATA } from "@saleor/config";
import useNavigator from "@saleor/hooks/useNavigator";
import useUser from "@saleor/hooks/useUser";
import { OrderDiscountProvider } from "@saleor/products/components/OrderDiscountProviders/OrderDiscountProvider";
import { OrderLineDiscountProvider } from "@saleor/products/components/OrderDiscountProviders/OrderLineDiscountProvider";
import useCustomerSearch from "@saleor/searches/useCustomerSearch";
import React from "react";
import { useIntl } from "react-intl";
import { customerUrl } from "../../../../customers/urls";
import { getStringOrPlaceholder } from "../../../../misc";
import { productUrl } from "../../../../products/urls";
import OrderDraftCancelDialog from "../../../components/OrderDraftCancelDialog/OrderDraftCancelDialog";
import OrderDraftPage from "../../../components/OrderDraftPage";
import OrderProductAddDialog from "../../../components/OrderProductAddDialog";
import OrderShippingMethodEditDialog from "../../../components/OrderShippingMethodEditDialog";
import { useOrderVariantSearch } from "../../../queries";
import { OrderUrlQueryParams } from "../../../urls";
import { orderDraftListUrl } from "../../../urls";
interface OrderDraftDetailsProps {
id: string;
params: OrderUrlQueryParams;
loading: any;
data: any;
orderAddNote: any;
orderLineUpdate: any;
orderLineDelete: any;
orderShippingMethodUpdate: any;
orderLinesAdd: any;
orderDraftUpdate: any;
orderDraftCancel: any;
orderDraftFinalize: any;
openModal: any;
closeModal: any;
}
export const OrderDraftDetails: React.FC<OrderDraftDetailsProps> = ({
id,
params,
loading,
data,
orderAddNote,
orderLineUpdate,
orderLineDelete,
orderShippingMethodUpdate,
orderLinesAdd,
orderDraftUpdate,
orderDraftCancel,
orderDraftFinalize,
openModal,
closeModal
}) => {
const order = data.order;
const navigate = useNavigator();
const { user } = useUser();
const {
loadMore,
search: variantSearch,
result: variantSearchOpts
} = useOrderVariantSearch({
variables: DEFAULT_INITIAL_SEARCH_DATA
});
const {
loadMore: loadMoreCustomers,
search: searchUsers,
result: users
} = useCustomerSearch({
variables: DEFAULT_INITIAL_SEARCH_DATA
});
const intl = useIntl();
return (
<>
<WindowTitle
title={intl.formatMessage(
{
defaultMessage: "Draft Order #{orderNumber}",
description: "window title"
},
{
orderNumber: getStringOrPlaceholder(data?.order?.number)
}
)}
/>
<OrderDiscountProvider order={order}>
<OrderLineDiscountProvider order={order}>
<OrderDraftPage
disabled={loading}
onNoteAdd={variables =>
orderAddNote.mutate({
input: variables,
order: id
})
}
users={users?.data?.search?.edges?.map(edge => edge.node) || []}
hasMore={users?.data?.search?.pageInfo?.hasNextPage || false}
onFetchMore={loadMoreCustomers}
fetchUsers={searchUsers}
loading={users.loading}
usersLoading={users.loading}
onCustomerEdit={data =>
orderDraftUpdate.mutate({
id,
input: data
})
}
onDraftFinalize={() => orderDraftFinalize.mutate({ id })}
onDraftRemove={() => openModal("cancel")}
onOrderLineAdd={() => openModal("add-order-line")}
onBack={() => navigate(orderDraftListUrl())}
order={order}
countries={(data?.shop?.countries || []).map(country => ({
code: country.code,
label: country.country
}))}
onProductClick={id => () =>
navigate(productUrl(encodeURIComponent(id)))}
onBillingAddressEdit={() => openModal("edit-billing-address")}
onShippingAddressEdit={() => openModal("edit-shipping-address")}
onShippingMethodEdit={() => openModal("edit-shipping")}
onOrderLineRemove={id => orderLineDelete.mutate({ id })}
onOrderLineChange={(id, data) =>
orderLineUpdate.mutate({
id,
input: data
})
}
saveButtonBarState="default"
onProfileView={() => navigate(customerUrl(order.user.id))}
userPermissions={user?.userPermissions || []}
/>
</OrderLineDiscountProvider>
</OrderDiscountProvider>
<OrderDraftCancelDialog
confirmButtonState={orderDraftCancel.opts.status}
errors={orderDraftCancel.opts.data?.draftOrderDelete.errors || []}
onClose={closeModal}
onConfirm={() => orderDraftCancel.mutate({ id })}
open={params.action === "cancel"}
orderNumber={getStringOrPlaceholder(order?.number)}
/>
<OrderShippingMethodEditDialog
confirmButtonState={orderShippingMethodUpdate.opts.status}
errors={
orderShippingMethodUpdate.opts.data?.orderUpdateShipping.errors || []
}
open={params.action === "edit-shipping"}
shippingMethod={order?.shippingMethod?.id}
shippingMethods={order?.availableShippingMethods}
onClose={closeModal}
onSubmit={variables =>
orderShippingMethodUpdate.mutate({
id,
input: {
shippingMethod: variables.shippingMethod
}
})
}
/>
<OrderProductAddDialog
confirmButtonState={orderLinesAdd.opts.status}
errors={orderLinesAdd.opts.data?.orderLinesCreate.errors || []}
loading={variantSearchOpts.loading}
open={params.action === "add-order-line"}
hasMore={variantSearchOpts.data?.search.pageInfo.hasNextPage}
products={variantSearchOpts.data?.search.edges.map(edge => edge.node)}
selectedChannelId={order?.channel?.id}
onClose={closeModal}
onFetch={variantSearch}
onFetchMore={loadMore}
onSubmit={variants =>
orderLinesAdd.mutate({
id,
input: variants.map(variant => ({
quantity: 1,
variantId: variant.id
}))
})
}
/>
</>
);
};
export default OrderDraftDetails;

View file

@ -0,0 +1,273 @@
import { WindowTitle } from "@saleor/components/WindowTitle";
import useNavigator from "@saleor/hooks/useNavigator";
import useUser from "@saleor/hooks/useUser";
import OrderCannotCancelOrderDialog from "@saleor/orders/components/OrderCannotCancelOrderDialog";
import OrderInvoiceEmailSendDialog from "@saleor/orders/components/OrderInvoiceEmailSendDialog";
import { useWarehouseList } from "@saleor/warehouses/queries";
import React from "react";
import { useIntl } from "react-intl";
import { customerUrl } from "../../../../customers/urls";
import { getMutationState, getStringOrPlaceholder } from "../../../../misc";
import { productUrl } from "../../../../products/urls";
import { FulfillmentStatus } from "../../../../types/globalTypes";
import OrderCancelDialog from "../../../components/OrderCancelDialog";
import OrderDetailsPage from "../../../components/OrderDetailsPage";
import OrderFulfillmentCancelDialog from "../../../components/OrderFulfillmentCancelDialog";
import OrderFulfillmentTrackingDialog from "../../../components/OrderFulfillmentTrackingDialog";
import OrderMarkAsPaidDialog from "../../../components/OrderMarkAsPaidDialog/OrderMarkAsPaidDialog";
import OrderPaymentDialog from "../../../components/OrderPaymentDialog";
import OrderPaymentVoidDialog from "../../../components/OrderPaymentVoidDialog";
import {
orderFulfillUrl,
orderListUrl,
orderRefundUrl,
orderReturnPath,
orderUrl,
OrderUrlQueryParams
} from "../../../urls";
interface OrderNormalDetailsProps {
id: string;
params: OrderUrlQueryParams;
data: any;
orderAddNote: any;
orderInvoiceRequest: any;
handleSubmit: any;
orderCancel: any;
orderPaymentMarkAsPaid: any;
orderVoid: any;
orderPaymentCapture: any;
orderFulfillmentCancel: any;
orderFulfillmentUpdateTracking: any;
orderInvoiceSend: any;
updateMetadataOpts: any;
updatePrivateMetadataOpts: any;
openModal: any;
closeModal: any;
}
export const OrderNormalDetails: React.FC<OrderNormalDetailsProps> = ({
id,
params,
data,
orderAddNote,
orderInvoiceRequest,
handleSubmit,
orderCancel,
orderPaymentMarkAsPaid,
orderVoid,
orderPaymentCapture,
orderFulfillmentCancel,
orderFulfillmentUpdateTracking,
orderInvoiceSend,
updateMetadataOpts,
updatePrivateMetadataOpts,
openModal,
closeModal
}) => {
const order = data?.order;
const navigate = useNavigator();
const { user } = useUser();
const warehouses = useWarehouseList({
displayLoader: true,
variables: {
first: 30
}
});
const intl = useIntl();
const [transactionReference, setTransactionReference] = React.useState("");
const handleBack = () => navigate(orderListUrl());
return (
<>
<WindowTitle
title={intl.formatMessage(
{
defaultMessage: "Order #{orderNumber}",
description: "window title"
},
{
orderNumber: getStringOrPlaceholder(data?.order?.number)
}
)}
/>
<OrderDetailsPage
onOrderReturn={() => navigate(orderReturnPath(id))}
disabled={
updateMetadataOpts.loading || updatePrivateMetadataOpts.loading
}
onNoteAdd={variables =>
orderAddNote.mutate({
input: variables,
order: id
})
}
onBack={handleBack}
order={order}
saveButtonBarState={getMutationState(
updateMetadataOpts.called || updatePrivateMetadataOpts.called,
updateMetadataOpts.loading || updatePrivateMetadataOpts.loading,
[
...(updateMetadataOpts.data?.deleteMetadata.errors || []),
...(updateMetadataOpts.data?.updateMetadata.errors || []),
...(updatePrivateMetadataOpts.data?.deletePrivateMetadata.errors ||
[]),
...(updatePrivateMetadataOpts.data?.updatePrivateMetadata.errors ||
[])
]
)}
shippingMethods={data?.order?.availableShippingMethods || []}
userPermissions={user?.userPermissions || []}
onOrderCancel={() => openModal("cancel")}
onOrderFulfill={() => navigate(orderFulfillUrl(id))}
onFulfillmentCancel={fulfillmentId =>
navigate(
orderUrl(id, {
action: "cancel-fulfillment",
id: fulfillmentId
})
)
}
onFulfillmentTrackingNumberUpdate={fulfillmentId =>
navigate(
orderUrl(id, {
action: "edit-fulfillment",
id: fulfillmentId
})
)
}
onPaymentCapture={() => openModal("capture")}
onPaymentVoid={() => openModal("void")}
onPaymentRefund={() => navigate(orderRefundUrl(id))}
onProductClick={id => () => navigate(productUrl(id))}
onBillingAddressEdit={() => openModal("edit-billing-address")}
onShippingAddressEdit={() => openModal("edit-shipping-address")}
onPaymentPaid={() => openModal("mark-paid")}
onProfileView={() => navigate(customerUrl(order.user.id))}
onInvoiceClick={id =>
window.open(
order.invoices.find(invoice => invoice.id === id)?.url,
"_blank"
)
}
onInvoiceGenerate={() =>
orderInvoiceRequest.mutate({
orderId: id
})
}
onInvoiceSend={id => openModal("invoice-send", { id })}
onSubmit={handleSubmit}
/>
<OrderCannotCancelOrderDialog
onClose={closeModal}
open={
params.action === "cancel" &&
order?.fulfillments.some(
fulfillment => fulfillment.status === FulfillmentStatus.FULFILLED
)
}
/>
<OrderCancelDialog
confirmButtonState={orderCancel.opts.status}
errors={orderCancel.opts.data?.orderCancel.errors || []}
number={order?.number}
open={params.action === "cancel"}
onClose={closeModal}
onSubmit={() =>
orderCancel.mutate({
id
})
}
/>
<OrderMarkAsPaidDialog
confirmButtonState={orderPaymentMarkAsPaid.opts.status}
errors={orderPaymentMarkAsPaid.opts.data?.orderMarkAsPaid.errors || []}
onClose={closeModal}
onConfirm={() =>
orderPaymentMarkAsPaid.mutate({
id,
transactionReference
})
}
open={params.action === "mark-paid"}
transactionReference={transactionReference}
handleTransactionReference={({ target }) =>
setTransactionReference(target.value)
}
/>
<OrderPaymentVoidDialog
confirmButtonState={orderVoid.opts.status}
errors={orderVoid.opts.data?.orderVoid.errors || []}
open={params.action === "void"}
onClose={closeModal}
onConfirm={() => orderVoid.mutate({ id })}
/>
<OrderPaymentDialog
confirmButtonState={orderPaymentCapture.opts.status}
errors={orderPaymentCapture.opts.data?.orderCapture.errors || []}
initial={order?.total.gross.amount}
open={params.action === "capture"}
onClose={closeModal}
onSubmit={variables =>
orderPaymentCapture.mutate({
...variables,
id
})
}
/>
<OrderFulfillmentCancelDialog
confirmButtonState={orderFulfillmentCancel.opts.status}
errors={
orderFulfillmentCancel.opts.data?.orderFulfillmentCancel.errors || []
}
open={params.action === "cancel-fulfillment"}
warehouses={
warehouses.data?.warehouses.edges.map(edge => edge.node) || []
}
onConfirm={variables =>
orderFulfillmentCancel.mutate({
id: params.id,
input: variables
})
}
onClose={closeModal}
/>
<OrderFulfillmentTrackingDialog
confirmButtonState={orderFulfillmentUpdateTracking.opts.status}
errors={
orderFulfillmentUpdateTracking.opts.data
?.orderFulfillmentUpdateTracking.errors || []
}
open={params.action === "edit-fulfillment"}
trackingNumber={getStringOrPlaceholder(
data?.order?.fulfillments.find(
fulfillment => fulfillment.id === params.id
)?.trackingNumber
)}
onConfirm={variables =>
orderFulfillmentUpdateTracking.mutate({
id: params.id,
input: {
...variables,
notifyCustomer: true
}
})
}
onClose={closeModal}
/>
<OrderInvoiceEmailSendDialog
confirmButtonState={orderInvoiceSend.opts.status}
errors={orderInvoiceSend.opts.data?.invoiceSendEmail.errors || []}
open={params.action === "invoice-send"}
invoice={order?.invoices?.find(invoice => invoice.id === params.id)}
onClose={closeModal}
onSend={() => orderInvoiceSend.mutate({ id: params.id })}
/>
</>
);
};
export default OrderNormalDetails;

View file

@ -0,0 +1,346 @@
import { WindowTitle } from "@saleor/components/WindowTitle";
import { DEFAULT_INITIAL_SEARCH_DATA } from "@saleor/config";
import useNavigator from "@saleor/hooks/useNavigator";
import useUser from "@saleor/hooks/useUser";
import OrderCannotCancelOrderDialog from "@saleor/orders/components/OrderCannotCancelOrderDialog";
import OrderInvoiceEmailSendDialog from "@saleor/orders/components/OrderInvoiceEmailSendDialog";
import { OrderDiscountProvider } from "@saleor/products/components/OrderDiscountProviders/OrderDiscountProvider";
import { OrderLineDiscountProvider } from "@saleor/products/components/OrderDiscountProviders/OrderLineDiscountProvider";
import { useWarehouseList } from "@saleor/warehouses/queries";
import React from "react";
import { useIntl } from "react-intl";
import { customerUrl } from "../../../../customers/urls";
import { getMutationState, getStringOrPlaceholder } from "../../../../misc";
import { productUrl } from "../../../../products/urls";
import { FulfillmentStatus } from "../../../../types/globalTypes";
import OrderCancelDialog from "../../../components/OrderCancelDialog";
import OrderDetailsPage from "../../../components/OrderDetailsPage";
import OrderFulfillmentCancelDialog from "../../../components/OrderFulfillmentCancelDialog";
import OrderFulfillmentTrackingDialog from "../../../components/OrderFulfillmentTrackingDialog";
import OrderMarkAsPaidDialog from "../../../components/OrderMarkAsPaidDialog/OrderMarkAsPaidDialog";
import OrderPaymentDialog from "../../../components/OrderPaymentDialog";
import OrderPaymentVoidDialog from "../../../components/OrderPaymentVoidDialog";
import OrderProductAddDialog from "../../../components/OrderProductAddDialog";
import OrderShippingMethodEditDialog from "../../../components/OrderShippingMethodEditDialog";
import { useOrderVariantSearch } from "../../../queries";
import {
orderFulfillUrl,
orderListUrl,
orderRefundUrl,
orderReturnPath,
orderUrl,
OrderUrlQueryParams
} from "../../../urls";
interface OrderUnconfirmedDetailsProps {
id: string;
params: OrderUrlQueryParams;
data: any;
orderAddNote: any;
orderLineUpdate: any;
orderLineDelete: any;
orderInvoiceRequest: any;
handleSubmit: any;
orderCancel: any;
orderShippingMethodUpdate: any;
orderLinesAdd: any;
orderPaymentMarkAsPaid: any;
orderVoid: any;
orderPaymentCapture: any;
orderFulfillmentCancel: any;
orderFulfillmentUpdateTracking: any;
orderInvoiceSend: any;
updateMetadataOpts: any;
updatePrivateMetadataOpts: any;
openModal: any;
closeModal: any;
}
export const OrderUnconfirmedDetails: React.FC<OrderUnconfirmedDetailsProps> = ({
id,
params,
data,
orderAddNote,
orderLineUpdate,
orderLineDelete,
orderInvoiceRequest,
handleSubmit,
orderCancel,
orderShippingMethodUpdate,
orderLinesAdd,
orderPaymentMarkAsPaid,
orderVoid,
orderPaymentCapture,
orderFulfillmentCancel,
orderFulfillmentUpdateTracking,
orderInvoiceSend,
updateMetadataOpts,
updatePrivateMetadataOpts,
openModal,
closeModal
}) => {
const order = data.order;
const navigate = useNavigator();
const { user } = useUser();
const {
loadMore,
search: variantSearch,
result: variantSearchOpts
} = useOrderVariantSearch({
variables: DEFAULT_INITIAL_SEARCH_DATA
});
const warehouses = useWarehouseList({
displayLoader: true,
variables: {
first: 30
}
});
const intl = useIntl();
const [transactionReference, setTransactionReference] = React.useState("");
const handleBack = () => navigate(orderListUrl());
return (
<>
<WindowTitle
title={intl.formatMessage(
{
defaultMessage: "Order #{orderNumber}",
description: "window title"
},
{
orderNumber: getStringOrPlaceholder(order.number)
}
)}
/>
<OrderDiscountProvider order={order}>
<OrderLineDiscountProvider order={order}>
<OrderDetailsPage
onOrderReturn={() => navigate(orderReturnPath(id))}
disabled={
updateMetadataOpts.loading || updatePrivateMetadataOpts.loading
}
onNoteAdd={variables =>
orderAddNote.mutate({
input: variables,
order: id
})
}
onBack={handleBack}
order={order}
onOrderLineAdd={() => openModal("add-order-line")}
onOrderLineChange={(id, data) =>
orderLineUpdate.mutate({
id,
input: data
})
}
onOrderLineRemove={id => orderLineDelete.mutate({ id })}
onShippingMethodEdit={() => openModal("edit-shipping")}
saveButtonBarState={getMutationState(
updateMetadataOpts.called || updatePrivateMetadataOpts.called,
updateMetadataOpts.loading || updatePrivateMetadataOpts.loading,
[
...(updateMetadataOpts.data?.deleteMetadata.errors || []),
...(updateMetadataOpts.data?.updateMetadata.errors || []),
...(updatePrivateMetadataOpts.data?.deletePrivateMetadata
.errors || []),
...(updatePrivateMetadataOpts.data?.updatePrivateMetadata
.errors || [])
]
)}
shippingMethods={data?.order?.availableShippingMethods || []}
userPermissions={user?.userPermissions || []}
onOrderCancel={() => openModal("cancel")}
onOrderFulfill={() => navigate(orderFulfillUrl(id))}
onFulfillmentCancel={fulfillmentId =>
navigate(
orderUrl(id, {
action: "cancel-fulfillment",
id: fulfillmentId
})
)
}
onFulfillmentTrackingNumberUpdate={fulfillmentId =>
navigate(
orderUrl(id, {
action: "edit-fulfillment",
id: fulfillmentId
})
)
}
onPaymentCapture={() => openModal("capture")}
onPaymentVoid={() => openModal("void")}
onPaymentRefund={() => navigate(orderRefundUrl(id))}
onProductClick={id => () => navigate(productUrl(id))}
onBillingAddressEdit={() => openModal("edit-billing-address")}
onShippingAddressEdit={() => openModal("edit-shipping-address")}
onPaymentPaid={() => openModal("mark-paid")}
onProfileView={() => navigate(customerUrl(order.user.id))}
onInvoiceClick={id =>
window.open(
order.invoices.find(invoice => invoice.id === id)?.url,
"_blank"
)
}
onInvoiceGenerate={() =>
orderInvoiceRequest.mutate({
orderId: id
})
}
onInvoiceSend={id => openModal("invoice-send", { id })}
onSubmit={handleSubmit}
/>
</OrderLineDiscountProvider>
</OrderDiscountProvider>
<OrderCannotCancelOrderDialog
onClose={closeModal}
open={
params.action === "cancel" &&
order?.fulfillments.some(
fulfillment => fulfillment.status === FulfillmentStatus.FULFILLED
)
}
/>
<OrderCancelDialog
confirmButtonState={orderCancel.opts.status}
errors={orderCancel.opts.data?.orderCancel.errors || []}
number={order?.number}
open={params.action === "cancel"}
onClose={closeModal}
onSubmit={() =>
orderCancel.mutate({
id
})
}
/>
<OrderShippingMethodEditDialog
confirmButtonState={orderShippingMethodUpdate.opts.status}
errors={
orderShippingMethodUpdate.opts.data?.orderUpdateShipping.errors || []
}
open={params.action === "edit-shipping"}
shippingMethod={order?.shippingMethod?.id}
shippingMethods={order?.availableShippingMethods}
onClose={closeModal}
onSubmit={variables =>
orderShippingMethodUpdate.mutate({
id,
input: {
shippingMethod: variables.shippingMethod
}
})
}
/>
<OrderProductAddDialog
confirmButtonState={orderLinesAdd.opts.status}
errors={orderLinesAdd.opts.data?.orderLinesCreate.errors || []}
loading={variantSearchOpts.loading}
open={params.action === "add-order-line"}
hasMore={variantSearchOpts.data?.search.pageInfo.hasNextPage}
products={variantSearchOpts.data?.search.edges.map(edge => edge.node)}
selectedChannelId={order?.channel?.id}
onClose={closeModal}
onFetch={variantSearch}
onFetchMore={loadMore}
onSubmit={variants =>
orderLinesAdd.mutate({
id,
input: variants.map(variant => ({
quantity: 1,
variantId: variant.id
}))
})
}
/>
<OrderMarkAsPaidDialog
confirmButtonState={orderPaymentMarkAsPaid.opts.status}
errors={orderPaymentMarkAsPaid.opts.data?.orderMarkAsPaid.errors || []}
onClose={closeModal}
onConfirm={() =>
orderPaymentMarkAsPaid.mutate({
id,
transactionReference
})
}
open={params.action === "mark-paid"}
transactionReference={transactionReference}
handleTransactionReference={({ target }) =>
setTransactionReference(target.value)
}
/>
<OrderPaymentVoidDialog
confirmButtonState={orderVoid.opts.status}
errors={orderVoid.opts.data?.orderVoid.errors || []}
open={params.action === "void"}
onClose={closeModal}
onConfirm={() => orderVoid.mutate({ id })}
/>
<OrderPaymentDialog
confirmButtonState={orderPaymentCapture.opts.status}
errors={orderPaymentCapture.opts.data?.orderCapture.errors || []}
initial={order?.total.gross.amount}
open={params.action === "capture"}
onClose={closeModal}
onSubmit={variables =>
orderPaymentCapture.mutate({
...variables,
id
})
}
/>
<OrderFulfillmentCancelDialog
confirmButtonState={orderFulfillmentCancel.opts.status}
errors={
orderFulfillmentCancel.opts.data?.orderFulfillmentCancel.errors || []
}
open={params.action === "cancel-fulfillment"}
warehouses={
warehouses.data?.warehouses.edges.map(edge => edge.node) || []
}
onConfirm={variables =>
orderFulfillmentCancel.mutate({
id: params.id,
input: variables
})
}
onClose={closeModal}
/>
<OrderFulfillmentTrackingDialog
confirmButtonState={orderFulfillmentUpdateTracking.opts.status}
errors={
orderFulfillmentUpdateTracking.opts.data
?.orderFulfillmentUpdateTracking.errors || []
}
open={params.action === "edit-fulfillment"}
trackingNumber={getStringOrPlaceholder(
data?.order?.fulfillments.find(
fulfillment => fulfillment.id === params.id
)?.trackingNumber
)}
onConfirm={variables =>
orderFulfillmentUpdateTracking.mutate({
id: params.id,
input: {
...variables,
notifyCustomer: true
}
})
}
onClose={closeModal}
/>
<OrderInvoiceEmailSendDialog
confirmButtonState={orderInvoiceSend.opts.status}
errors={orderInvoiceSend.opts.data?.invoiceSendEmail.errors || []}
open={params.action === "invoice-send"}
invoice={order?.invoices?.find(invoice => invoice.id === params.id)}
onClose={closeModal}
onSend={() => orderInvoiceSend.mutate({ id: params.id })}
/>
</>
);
};
export default OrderUnconfirmedDetails;

View file

@ -1,20 +1,12 @@
import { MetadataFormData } from "@saleor/components/Metadata";
import NotFoundPage from "@saleor/components/NotFoundPage";
import { WindowTitle } from "@saleor/components/WindowTitle";
import { DEFAULT_INITIAL_SEARCH_DATA } from "@saleor/config";
import { Task } from "@saleor/containers/BackgroundTasks/types";
import useBackgroundTask from "@saleor/hooks/useBackgroundTask";
import useNavigator from "@saleor/hooks/useNavigator";
import useNotifier from "@saleor/hooks/useNotifier";
import useUser from "@saleor/hooks/useUser";
import { commonMessages } from "@saleor/intl";
import OrderCannotCancelOrderDialog from "@saleor/orders/components/OrderCannotCancelOrderDialog";
import OrderInvoiceEmailSendDialog from "@saleor/orders/components/OrderInvoiceEmailSendDialog";
import { useOrderConfirmMutation } from "@saleor/orders/mutations";
import { InvoiceRequest } from "@saleor/orders/types/InvoiceRequest";
import { OrderDiscountProvider } from "@saleor/products/components/OrderDiscountProviders/OrderDiscountProvider";
import { OrderLineDiscountProvider } from "@saleor/products/components/OrderDiscountProviders/OrderLineDiscountProvider";
import useCustomerSearch from "@saleor/searches/useCustomerSearch";
import getOrderErrorMessage from "@saleor/utils/errors/order";
import createDialogActionHandlers from "@saleor/utils/handlers/dialogActionHandlers";
import createMetadataUpdateHandler from "@saleor/utils/handlers/metadataUpdateHandler";
@ -22,43 +14,23 @@ import {
useMetadataUpdate,
usePrivateMetadataUpdate
} from "@saleor/utils/metadata/updateMetadata";
import { useWarehouseList } from "@saleor/warehouses/queries";
import React from "react";
import { useIntl } from "react-intl";
import { customerUrl } from "../../../customers/urls";
import { getMutationState, getStringOrPlaceholder, maybe } from "../../../misc";
import { productUrl } from "../../../products/urls";
import {
FulfillmentStatus,
JobStatusEnum,
OrderStatus
} from "../../../types/globalTypes";
import OrderCancelDialog from "../../components/OrderCancelDialog";
import OrderDetailsPage from "../../components/OrderDetailsPage";
import OrderDraftCancelDialog from "../../components/OrderDraftCancelDialog/OrderDraftCancelDialog";
import OrderDraftPage from "../../components/OrderDraftPage";
import OrderFulfillmentCancelDialog from "../../components/OrderFulfillmentCancelDialog";
import OrderFulfillmentTrackingDialog from "../../components/OrderFulfillmentTrackingDialog";
import OrderMarkAsPaidDialog from "../../components/OrderMarkAsPaidDialog/OrderMarkAsPaidDialog";
import OrderPaymentDialog from "../../components/OrderPaymentDialog";
import OrderPaymentVoidDialog from "../../components/OrderPaymentVoidDialog";
import OrderProductAddDialog from "../../components/OrderProductAddDialog";
import OrderShippingMethodEditDialog from "../../components/OrderShippingMethodEditDialog";
import { JobStatusEnum, OrderStatus } from "../../../types/globalTypes";
import OrderOperations from "../../containers/OrderOperations";
import { TypedOrderDetailsQuery, useOrderVariantSearch } from "../../queries";
import { TypedOrderDetailsQuery } from "../../queries";
import {
orderDraftListUrl,
orderFulfillUrl,
orderListUrl,
orderRefundUrl,
orderReturnPath,
orderUrl,
OrderUrlDialog,
OrderUrlQueryParams
} from "../../urls";
import OrderAddressFields from "./OrderAddressFields";
import { OrderDetailsMessages } from "./OrderDetailsMessages";
import { OrderDraftDetails } from "./OrderDraftDetails";
import { OrderNormalDetails } from "./OrderNormalDetails";
import { OrderUnconfirmedDetails } from "./OrderUnconfirmedDetails";
interface OrderDetailsProps {
id: string;
@ -67,29 +39,7 @@ interface OrderDetailsProps {
export const OrderDetails: React.FC<OrderDetailsProps> = ({ id, params }) => {
const navigate = useNavigator();
const { user } = useUser();
const {
loadMore: loadMoreCustomers,
search: searchUsers,
result: users
} = useCustomerSearch({
variables: DEFAULT_INITIAL_SEARCH_DATA
});
const {
loadMore,
search: variantSearch,
result: variantSearchOpts
} = useOrderVariantSearch({
variables: DEFAULT_INITIAL_SEARCH_DATA
});
const warehouses = useWarehouseList({
displayLoader: true,
variables: {
first: 30
}
});
const { queue } = useBackgroundTask();
const intl = useIntl();
const [updateMetadata, updateMetadataOpts] = useMetadataUpdate({});
@ -98,7 +48,6 @@ export const OrderDetails: React.FC<OrderDetailsProps> = ({ id, params }) => {
updatePrivateMetadataOpts
] = usePrivateMetadataUpdate({});
const notify = useNotifier();
const [transactionReference, setTransactionReference] = React.useState("");
const [openModal, closeModal] = createDialogActionHandlers<
OrderUrlDialog,
@ -128,6 +77,9 @@ export const OrderDetails: React.FC<OrderDetailsProps> = ({ id, params }) => {
return <NotFoundPage onBack={handleBack} />;
}
const isOrderUnconfirmed = order?.status === OrderStatus.UNCONFIRMED;
const isOrderDraft = order?.status === OrderStatus.DRAFT;
const handleSubmit = async (data: MetadataFormData) => {
if (order?.status === OrderStatus.UNCONFIRMED) {
await orderConfirm({ variables: { id: order?.id } });
@ -162,9 +114,10 @@ export const OrderDetails: React.FC<OrderDetailsProps> = ({ id, params }) => {
onPaymentCapture={orderMessages.handlePaymentCapture}
onUpdate={orderMessages.handleUpdate}
onDraftUpdate={orderMessages.handleDraftUpdate}
onShippingMethodUpdate={
orderMessages.handleShippingMethodUpdate
}
onShippingMethodUpdate={data => {
orderMessages.handleShippingMethodUpdate(data);
order.total = data.orderUpdateShipping.order.total;
}}
onOrderLineDelete={orderMessages.handleOrderLineDelete}
onOrderLinesAdd={orderMessages.handleOrderLinesAdd}
onOrderLineUpdate={orderMessages.handleOrderLineUpdate}
@ -214,387 +167,73 @@ export const OrderDetails: React.FC<OrderDetailsProps> = ({ id, params }) => {
orderInvoiceSend
}) => (
<>
{order?.status !== OrderStatus.DRAFT ? (
<>
<WindowTitle
title={intl.formatMessage(
{
defaultMessage: "Order #{orderNumber}",
description: "window title"
},
{
orderNumber: getStringOrPlaceholder(
data?.order?.number
)
{!isOrderDraft && !isOrderUnconfirmed && (
<OrderNormalDetails
id={id}
params={params}
data={data}
orderAddNote={orderAddNote}
orderInvoiceRequest={orderInvoiceRequest}
handleSubmit={handleSubmit}
orderCancel={orderCancel}
orderPaymentMarkAsPaid={orderPaymentMarkAsPaid}
orderVoid={orderVoid}
orderPaymentCapture={orderPaymentCapture}
orderFulfillmentCancel={orderFulfillmentCancel}
orderFulfillmentUpdateTracking={
orderFulfillmentUpdateTracking
}
orderInvoiceSend={orderInvoiceSend}
updateMetadataOpts={updateMetadataOpts}
updatePrivateMetadataOpts={updatePrivateMetadataOpts}
openModal={openModal}
closeModal={closeModal}
/>
)}
{isOrderDraft && (
<OrderDraftDetails
id={id}
params={params}
loading={loading}
data={data}
orderAddNote={orderAddNote}
orderLineUpdate={orderLineUpdate}
orderLineDelete={orderLineDelete}
orderShippingMethodUpdate={orderShippingMethodUpdate}
orderLinesAdd={orderLinesAdd}
orderDraftUpdate={orderDraftUpdate}
orderDraftCancel={orderDraftCancel}
orderDraftFinalize={orderDraftFinalize}
openModal={openModal}
closeModal={closeModal}
/>
<OrderDetailsPage
onOrderReturn={() => navigate(orderReturnPath(id))}
disabled={
updateMetadataOpts.loading ||
updatePrivateMetadataOpts.loading
}
onNoteAdd={variables =>
orderAddNote.mutate({
input: variables,
order: id
})
}
onBack={handleBack}
order={order}
saveButtonBarState={getMutationState(
updateMetadataOpts.called ||
updatePrivateMetadataOpts.called,
updateMetadataOpts.loading ||
updatePrivateMetadataOpts.loading,
[
...(updateMetadataOpts.data?.deleteMetadata
.errors || []),
...(updateMetadataOpts.data?.updateMetadata
.errors || []),
...(updatePrivateMetadataOpts.data
?.deletePrivateMetadata.errors || []),
...(updatePrivateMetadataOpts.data
?.updatePrivateMetadata.errors || [])
]
)}
shippingMethods={maybe(
() => data.order.availableShippingMethods,
[]
)}
userPermissions={user?.userPermissions || []}
onOrderCancel={() => openModal("cancel")}
onOrderFulfill={() => navigate(orderFulfillUrl(id))}
onFulfillmentCancel={fulfillmentId =>
navigate(
orderUrl(id, {
action: "cancel-fulfillment",
id: fulfillmentId
})
)
{isOrderUnconfirmed && (
<OrderUnconfirmedDetails
id={id}
params={params}
data={data}
orderAddNote={orderAddNote}
orderLineUpdate={orderLineUpdate}
orderLineDelete={orderLineDelete}
orderInvoiceRequest={orderInvoiceRequest}
handleSubmit={handleSubmit}
orderCancel={orderCancel}
orderShippingMethodUpdate={orderShippingMethodUpdate}
orderLinesAdd={orderLinesAdd}
orderPaymentMarkAsPaid={orderPaymentMarkAsPaid}
orderVoid={orderVoid}
orderPaymentCapture={orderPaymentCapture}
orderFulfillmentCancel={orderFulfillmentCancel}
orderFulfillmentUpdateTracking={
orderFulfillmentUpdateTracking
}
onFulfillmentTrackingNumberUpdate={fulfillmentId =>
navigate(
orderUrl(id, {
action: "edit-fulfillment",
id: fulfillmentId
})
)
}
onPaymentCapture={() => openModal("capture")}
onPaymentVoid={() => openModal("void")}
onPaymentRefund={() => navigate(orderRefundUrl(id))}
onProductClick={id => () => navigate(productUrl(id))}
onBillingAddressEdit={() =>
openModal("edit-billing-address")
}
onShippingAddressEdit={() =>
openModal("edit-shipping-address")
}
onPaymentPaid={() => openModal("mark-paid")}
onProfileView={() =>
navigate(customerUrl(order.user.id))
}
onInvoiceClick={id =>
window.open(
order.invoices.find(invoice => invoice.id === id)
?.url,
"_blank"
)
}
onInvoiceGenerate={() =>
orderInvoiceRequest.mutate({
orderId: id
})
}
onInvoiceSend={id =>
openModal("invoice-send", { id })
}
onSubmit={handleSubmit}
orderInvoiceSend={orderInvoiceSend}
updateMetadataOpts={updateMetadataOpts}
updatePrivateMetadataOpts={updatePrivateMetadataOpts}
openModal={openModal}
closeModal={closeModal}
/>
<OrderCannotCancelOrderDialog
onClose={closeModal}
open={
params.action === "cancel" &&
order?.fulfillments.some(
fulfillment =>
fulfillment.status ===
FulfillmentStatus.FULFILLED
)
}
/>
<OrderCancelDialog
confirmButtonState={orderCancel.opts.status}
errors={
orderCancel.opts.data?.orderCancel.errors || []
}
number={order?.number}
open={params.action === "cancel"}
onClose={closeModal}
onSubmit={() =>
orderCancel.mutate({
id
})
}
/>
<OrderMarkAsPaidDialog
confirmButtonState={
orderPaymentMarkAsPaid.opts.status
}
errors={
orderPaymentMarkAsPaid.opts.data?.orderMarkAsPaid
.errors || []
}
onClose={closeModal}
onConfirm={() =>
orderPaymentMarkAsPaid.mutate({
id,
transactionReference
})
}
open={params.action === "mark-paid"}
transactionReference={transactionReference}
handleTransactionReference={({ target }) =>
setTransactionReference(target.value)
}
/>
<OrderPaymentVoidDialog
confirmButtonState={orderVoid.opts.status}
errors={orderVoid.opts.data?.orderVoid.errors || []}
open={params.action === "void"}
onClose={closeModal}
onConfirm={() => orderVoid.mutate({ id })}
/>
<OrderPaymentDialog
confirmButtonState={orderPaymentCapture.opts.status}
errors={
orderPaymentCapture.opts.data?.orderCapture
.errors || []
}
initial={order?.total.gross.amount}
open={params.action === "capture"}
onClose={closeModal}
onSubmit={variables =>
orderPaymentCapture.mutate({
...variables,
id
})
}
/>
<OrderFulfillmentCancelDialog
confirmButtonState={
orderFulfillmentCancel.opts.status
}
errors={
orderFulfillmentCancel.opts.data
?.orderFulfillmentCancel.errors || []
}
open={params.action === "cancel-fulfillment"}
warehouses={
warehouses.data?.warehouses.edges.map(
edge => edge.node
) || []
}
onConfirm={variables =>
orderFulfillmentCancel.mutate({
id: params.id,
input: variables
})
}
onClose={closeModal}
/>
<OrderFulfillmentTrackingDialog
confirmButtonState={
orderFulfillmentUpdateTracking.opts.status
}
errors={
orderFulfillmentUpdateTracking.opts.data
?.orderFulfillmentUpdateTracking.errors || []
}
open={params.action === "edit-fulfillment"}
trackingNumber={getStringOrPlaceholder(
data?.order?.fulfillments.find(
fulfillment => fulfillment.id === params.id
)?.trackingNumber
)}
onConfirm={variables =>
orderFulfillmentUpdateTracking.mutate({
id: params.id,
input: {
...variables,
notifyCustomer: true
}
})
}
onClose={closeModal}
/>
<OrderInvoiceEmailSendDialog
confirmButtonState={orderInvoiceSend.opts.status}
errors={
orderInvoiceSend.opts.data?.invoiceSendNotification
.errors || []
}
open={params.action === "invoice-send"}
invoice={order?.invoices?.find(
invoice => invoice.id === params.id
)}
onClose={closeModal}
onSend={() =>
orderInvoiceSend.mutate({ id: params.id })
}
/>
</>
) : (
<>
<WindowTitle
title={intl.formatMessage(
{
defaultMessage: "Draft Order #{orderNumber}",
description: "window title"
},
{
orderNumber: getStringOrPlaceholder(
data?.order?.number
)
}
)}
/>
<OrderDiscountProvider order={order}>
<OrderLineDiscountProvider order={order}>
<OrderDraftPage
disabled={loading}
onNoteAdd={variables =>
orderAddNote.mutate({
input: variables,
order: id
})
}
users={maybe(
() =>
users.data.search.edges.map(
edge => edge.node
),
[]
)}
hasMore={maybe(
() => users.data.search.pageInfo.hasNextPage,
false
)}
onFetchMore={loadMoreCustomers}
fetchUsers={searchUsers}
loading={users.loading}
usersLoading={users.loading}
onCustomerEdit={data =>
orderDraftUpdate.mutate({
id,
input: data
})
}
onDraftFinalize={() =>
orderDraftFinalize.mutate({ id })
}
onDraftRemove={() => openModal("cancel")}
onOrderLineAdd={() => openModal("add-order-line")}
onBack={() => navigate(orderDraftListUrl())}
order={order}
countries={maybe(
() => data.shop.countries,
[]
).map(country => ({
code: country.code,
label: country.country
}))}
onProductClick={id => () =>
navigate(productUrl(encodeURIComponent(id)))}
onBillingAddressEdit={() =>
openModal("edit-billing-address")
}
onShippingAddressEdit={() =>
openModal("edit-shipping-address")
}
onShippingMethodEdit={() =>
openModal("edit-shipping")
}
onOrderLineRemove={id =>
orderLineDelete.mutate({ id })
}
onOrderLineChange={(id, data) =>
orderLineUpdate.mutate({
id,
input: data
})
}
saveButtonBarState="default"
onProfileView={() =>
navigate(customerUrl(order.user.id))
}
userPermissions={user?.userPermissions || []}
/>
</OrderLineDiscountProvider>
</OrderDiscountProvider>
<OrderDraftCancelDialog
confirmButtonState={orderDraftCancel.opts.status}
errors={
orderDraftCancel.opts.data?.draftOrderDelete
.errors || []
}
onClose={closeModal}
onConfirm={() => orderDraftCancel.mutate({ id })}
open={params.action === "cancel"}
orderNumber={getStringOrPlaceholder(order?.number)}
/>
<OrderShippingMethodEditDialog
confirmButtonState={
orderShippingMethodUpdate.opts.status
}
errors={
orderShippingMethodUpdate.opts.data
?.orderUpdateShipping.errors || []
}
open={params.action === "edit-shipping"}
shippingMethod={order?.shippingMethod?.id}
shippingMethods={order?.availableShippingMethods}
onClose={closeModal}
onSubmit={variables =>
orderShippingMethodUpdate.mutate({
id,
input: {
shippingMethod: variables.shippingMethod
}
})
}
/>
<OrderProductAddDialog
confirmButtonState={orderLinesAdd.opts.status}
errors={
orderLinesAdd.opts.data?.draftOrderLinesCreate
.errors || []
}
loading={variantSearchOpts.loading}
open={params.action === "add-order-line"}
hasMore={
variantSearchOpts.data?.search.pageInfo.hasNextPage
}
products={variantSearchOpts.data?.search.edges.map(
edge => edge.node
)}
selectedChannelId={order?.channel?.id}
onClose={closeModal}
onFetch={variantSearch}
onFetchMore={loadMore}
onSubmit={variants =>
orderLinesAdd.mutate({
id,
input: variants.map(variant => ({
quantity: 1,
variantId: variant.id
}))
})
}
/>
</>
)}
<OrderAddressFields
isDraft={order?.status === OrderStatus.DRAFT}

View file

@ -127955,7 +127955,9 @@ exports[`Storyshots Views / Orders / Order list default 1`] = `
<thead
class="MuiTableHead-root-id"
>
<tr>
<tr
class="MuiTableRow-root-id MuiTableRow-head-id"
>
<th
class="MuiTableCell-root-id MuiTableCell-head-id TableCellHeader-root-id OrderList-colNumber-id"
scope="col"
@ -129324,7 +129326,9 @@ exports[`Storyshots Views / Orders / Order list loading 1`] = `
<thead
class="MuiTableHead-root-id"
>
<tr>
<tr
class="MuiTableRow-root-id MuiTableRow-head-id"
>
<th
class="MuiTableCell-root-id MuiTableCell-head-id TableCellHeader-root-id OrderList-colNumber-id"
scope="col"
@ -129762,7 +129766,9 @@ exports[`Storyshots Views / Orders / Order list when no data 1`] = `
<thead
class="MuiTableHead-root-id"
>
<tr>
<tr
class="MuiTableRow-root-id MuiTableRow-head-id"
>
<th
class="MuiTableCell-root-id MuiTableCell-head-id TableCellHeader-root-id OrderList-colNumber-id"
scope="col"

View file

@ -614,12 +614,11 @@ export enum OrderEventsEmailsEnum {
}
export enum OrderEventsEnum {
ADDED_PRODUCTS = "ADDED_PRODUCTS",
CANCELED = "CANCELED",
CONFIRMED = "CONFIRMED",
DRAFT_ADDED_PRODUCTS = "DRAFT_ADDED_PRODUCTS",
DRAFT_CREATED = "DRAFT_CREATED",
DRAFT_CREATED_FROM_REPLACE = "DRAFT_CREATED_FROM_REPLACE",
DRAFT_REMOVED_PRODUCTS = "DRAFT_REMOVED_PRODUCTS",
EMAIL_SENT = "EMAIL_SENT",
EXTERNAL_SERVICE_NOTIFICATION = "EXTERNAL_SERVICE_NOTIFICATION",
FULFILLMENT_CANCELED = "FULFILLMENT_CANCELED",
@ -651,6 +650,7 @@ export enum OrderEventsEnum {
PAYMENT_VOIDED = "PAYMENT_VOIDED",
PLACED = "PLACED",
PLACED_FROM_DRAFT = "PLACED_FROM_DRAFT",
REMOVED_PRODUCTS = "REMOVED_PRODUCTS",
TRACKING_UPDATED = "TRACKING_UPDATED",
UPDATED_ADDRESS = "UPDATED_ADDRESS",
}

View file

@ -34,6 +34,10 @@ const messages = defineMessages({
defaultMessage: "Only pre-authorized payments can be captured",
description: "error message"
},
insufficientStock: {
defaultMessage: "Cannot change the quantity because of insufficient stock",
description: "error message"
},
noShippingAddress: {
defaultMessage:
"Cannot choose a shipping method for an order without the shipping address",
@ -79,6 +83,8 @@ function getOrderErrorMessage(
return intl.formatMessage(commonErrorMessages.graphqlError);
case OrderErrorCode.INVALID:
return intl.formatMessage(commonErrorMessages.invalid);
case OrderErrorCode.INSUFFICIENT_STOCK:
return intl.formatMessage(messages.insufficientStock);
case OrderErrorCode.NOT_EDITABLE:
return intl.formatMessage(messages.notEditable);
case OrderErrorCode.ORDER_NO_SHIPPING_ADDRESS: