Skip to content

Commit

Permalink
feat(core): Implement setOrderCustomer mutation
Browse files Browse the repository at this point in the history
Relates to #2505
  • Loading branch information
michaelbromley committed Jan 18, 2024
1 parent c32b854 commit 26e77d7
Show file tree
Hide file tree
Showing 21 changed files with 295 additions and 9 deletions.
14 changes: 14 additions & 0 deletions packages/admin-ui/src/lib/core/src/common/generated-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1937,6 +1937,7 @@ export enum HistoryEntryType {
ORDER_CANCELLATION = 'ORDER_CANCELLATION',
ORDER_COUPON_APPLIED = 'ORDER_COUPON_APPLIED',
ORDER_COUPON_REMOVED = 'ORDER_COUPON_REMOVED',
ORDER_CUSTOMER_UPDATED = 'ORDER_CUSTOMER_UPDATED',
ORDER_FULFILLMENT = 'ORDER_FULFILLMENT',
ORDER_FULFILLMENT_TRANSITION = 'ORDER_FULFILLMENT_TRANSITION',
ORDER_MODIFIED = 'ORDER_MODIFIED',
Expand Down Expand Up @@ -2849,6 +2850,8 @@ export type Mutation = {
setDraftOrderShippingMethod: SetOrderShippingMethodResult;
setMainNavExpanded: Scalars['Boolean']['output'];
setOrderCustomFields?: Maybe<Order>;
/** Allows a different Customer to be assigned to an Order. Added in v2.2.0. */
setOrderCustomer?: Maybe<Order>;
setUiLanguage: LanguageCode;
setUiLocale?: Maybe<Scalars['String']['output']>;
setUiTheme: Scalars['String']['output'];
Expand Down Expand Up @@ -3576,6 +3579,11 @@ export type MutationSetOrderCustomFieldsArgs = {
};


export type MutationSetOrderCustomerArgs = {
input: SetOrderCustomerInput;
};


export type MutationSetUiLanguageArgs = {
languageCode: LanguageCode;
};
Expand Down Expand Up @@ -5709,6 +5717,12 @@ export type ServerConfig = {

export type SetCustomerForDraftOrderResult = EmailAddressConflictError | Order;

export type SetOrderCustomerInput = {
customerId: Scalars['ID']['input'];
note?: InputMaybe<Scalars['String']['input']>;
orderId: Scalars['ID']['input'];
};

export type SetOrderShippingMethodResult = IneligibleShippingMethodError | NoActiveOrderError | Order | OrderModificationError;

/** Returned if the Payment settlement fails */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1866,6 +1866,7 @@ export enum HistoryEntryType {
ORDER_CANCELLATION = 'ORDER_CANCELLATION',
ORDER_COUPON_APPLIED = 'ORDER_COUPON_APPLIED',
ORDER_COUPON_REMOVED = 'ORDER_COUPON_REMOVED',
ORDER_CUSTOMER_UPDATED = 'ORDER_CUSTOMER_UPDATED',
ORDER_FULFILLMENT = 'ORDER_FULFILLMENT',
ORDER_FULFILLMENT_TRANSITION = 'ORDER_FULFILLMENT_TRANSITION',
ORDER_MODIFIED = 'ORDER_MODIFIED',
Expand Down Expand Up @@ -2747,6 +2748,8 @@ export type Mutation = {
/** Sets the shipping method by id, which can be obtained with the `eligibleShippingMethodsForDraftOrder` query */
setDraftOrderShippingMethod: SetOrderShippingMethodResult;
setOrderCustomFields?: Maybe<Order>;
/** Allows a different Customer to be assigned to an Order. Added in v2.2.0. */
setOrderCustomer?: Maybe<Order>;
settlePayment: SettlePaymentResult;
settleRefund: SettleRefundResult;
transitionFulfillmentToState: TransitionFulfillmentToStateResult;
Expand Down Expand Up @@ -3445,6 +3448,11 @@ export type MutationSetOrderCustomFieldsArgs = {
};


export type MutationSetOrderCustomerArgs = {
input: SetOrderCustomerInput;
};


export type MutationSettlePaymentArgs = {
id: Scalars['ID']['input'];
};
Expand Down Expand Up @@ -5483,6 +5491,12 @@ export type ServerConfig = {

export type SetCustomerForDraftOrderResult = EmailAddressConflictError | Order;

export type SetOrderCustomerInput = {
customerId: Scalars['ID']['input'];
note?: InputMaybe<Scalars['String']['input']>;
orderId: Scalars['ID']['input'];
};

export type SetOrderShippingMethodResult = IneligibleShippingMethodError | NoActiveOrderError | Order | OrderModificationError;

/** Returned if the Payment settlement fails */
Expand Down
1 change: 1 addition & 0 deletions packages/common/src/generated-shop-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1181,6 +1181,7 @@ export enum HistoryEntryType {
ORDER_CANCELLATION = 'ORDER_CANCELLATION',
ORDER_COUPON_APPLIED = 'ORDER_COUPON_APPLIED',
ORDER_COUPON_REMOVED = 'ORDER_COUPON_REMOVED',
ORDER_CUSTOMER_UPDATED = 'ORDER_CUSTOMER_UPDATED',
ORDER_FULFILLMENT = 'ORDER_FULFILLMENT',
ORDER_FULFILLMENT_TRANSITION = 'ORDER_FULFILLMENT_TRANSITION',
ORDER_MODIFIED = 'ORDER_MODIFIED',
Expand Down
14 changes: 14 additions & 0 deletions packages/common/src/generated-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1925,6 +1925,7 @@ export enum HistoryEntryType {
ORDER_CANCELLATION = 'ORDER_CANCELLATION',
ORDER_COUPON_APPLIED = 'ORDER_COUPON_APPLIED',
ORDER_COUPON_REMOVED = 'ORDER_COUPON_REMOVED',
ORDER_CUSTOMER_UPDATED = 'ORDER_CUSTOMER_UPDATED',
ORDER_FULFILLMENT = 'ORDER_FULFILLMENT',
ORDER_FULFILLMENT_TRANSITION = 'ORDER_FULFILLMENT_TRANSITION',
ORDER_MODIFIED = 'ORDER_MODIFIED',
Expand Down Expand Up @@ -2829,6 +2830,8 @@ export type Mutation = {
/** Sets the shipping method by id, which can be obtained with the `eligibleShippingMethodsForDraftOrder` query */
setDraftOrderShippingMethod: SetOrderShippingMethodResult;
setOrderCustomFields?: Maybe<Order>;
/** Allows a different Customer to be assigned to an Order. Added in v2.2.0. */
setOrderCustomer?: Maybe<Order>;
settlePayment: SettlePaymentResult;
settleRefund: SettleRefundResult;
transitionFulfillmentToState: TransitionFulfillmentToStateResult;
Expand Down Expand Up @@ -3527,6 +3530,11 @@ export type MutationSetOrderCustomFieldsArgs = {
};


export type MutationSetOrderCustomerArgs = {
input: SetOrderCustomerInput;
};


export type MutationSettlePaymentArgs = {
id: Scalars['ID']['input'];
};
Expand Down Expand Up @@ -5631,6 +5639,12 @@ export type ServerConfig = {

export type SetCustomerForDraftOrderResult = EmailAddressConflictError | Order;

export type SetOrderCustomerInput = {
customerId: Scalars['ID']['input'];
note?: InputMaybe<Scalars['String']['input']>;
orderId: Scalars['ID']['input'];
};

export type SetOrderShippingMethodResult = IneligibleShippingMethodError | NoActiveOrderError | Order | OrderModificationError;

/** Returned if the Payment settlement fails */
Expand Down
Loading

0 comments on commit 26e77d7

Please sign in to comment.