Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2068,6 +2068,7 @@ export enum HistoryEntryType {
ORDER_CANCELLATION = 'ORDER_CANCELLATION',
ORDER_COUPON_APPLIED = 'ORDER_COUPON_APPLIED',
ORDER_COUPON_REMOVED = 'ORDER_COUPON_REMOVED',
ORDER_CURRENCY_UPDATED = 'ORDER_CURRENCY_UPDATED',
ORDER_CUSTOMER_UPDATED = 'ORDER_CUSTOMER_UPDATED',
ORDER_FULFILLMENT = 'ORDER_FULFILLMENT',
ORDER_FULFILLMENT_TRANSITION = 'ORDER_FULFILLMENT_TRANSITION',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2017,6 +2017,7 @@ export enum HistoryEntryType {
ORDER_CANCELLATION = 'ORDER_CANCELLATION',
ORDER_COUPON_APPLIED = 'ORDER_COUPON_APPLIED',
ORDER_COUPON_REMOVED = 'ORDER_COUPON_REMOVED',
ORDER_CURRENCY_UPDATED = 'ORDER_CURRENCY_UPDATED',
ORDER_CUSTOMER_UPDATED = 'ORDER_CUSTOMER_UPDATED',
ORDER_FULFILLMENT = 'ORDER_FULFILLMENT',
ORDER_FULFILLMENT_TRANSITION = 'ORDER_FULFILLMENT_TRANSITION',
Expand Down
6 changes: 6 additions & 0 deletions packages/common/src/generated-shop-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1273,6 +1273,7 @@ export enum HistoryEntryType {
ORDER_CANCELLATION = 'ORDER_CANCELLATION',
ORDER_COUPON_APPLIED = 'ORDER_COUPON_APPLIED',
ORDER_COUPON_REMOVED = 'ORDER_COUPON_REMOVED',
ORDER_CURRENCY_UPDATED = 'ORDER_CURRENCY_UPDATED',
ORDER_CUSTOMER_UPDATED = 'ORDER_CUSTOMER_UPDATED',
ORDER_FULFILLMENT = 'ORDER_FULFILLMENT',
ORDER_FULFILLMENT_TRANSITION = 'ORDER_FULFILLMENT_TRANSITION',
Expand Down Expand Up @@ -1822,6 +1823,7 @@ export type Mutation = {
requestUpdateCustomerEmailAddress: RequestUpdateCustomerEmailAddressResult;
/** Resets a Customer's password based on the provided token */
resetPassword: ResetPasswordResult;
setCurrencyCodeForOrder: UpdateOrderItemsResult;
/** Set the Customer for the Order. Required only if the Customer is not currently logged in */
setCustomerForOrder: SetCustomerForOrderResult;
/** Sets the billing address for the active Order */
Expand Down Expand Up @@ -1934,6 +1936,10 @@ export type MutationResetPasswordArgs = {
token: Scalars['String']['input'];
};

export type MutationSetCurrencyCodeForOrderArgs = {
currencyCode: CurrencyCode;
};

export type MutationSetCustomerForOrderArgs = {
input: CreateCustomerInput;
};
Expand Down
1 change: 1 addition & 0 deletions packages/common/src/generated-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2056,6 +2056,7 @@ export enum HistoryEntryType {
ORDER_CANCELLATION = 'ORDER_CANCELLATION',
ORDER_COUPON_APPLIED = 'ORDER_COUPON_APPLIED',
ORDER_COUPON_REMOVED = 'ORDER_COUPON_REMOVED',
ORDER_CURRENCY_UPDATED = 'ORDER_CURRENCY_UPDATED',
ORDER_CUSTOMER_UPDATED = 'ORDER_CUSTOMER_UPDATED',
ORDER_FULFILLMENT = 'ORDER_FULFILLMENT',
ORDER_FULFILLMENT_TRANSITION = 'ORDER_FULFILLMENT_TRANSITION',
Expand Down
1 change: 1 addition & 0 deletions packages/core/e2e/graphql/generated-e2e-admin-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2017,6 +2017,7 @@ export enum HistoryEntryType {
ORDER_CANCELLATION = 'ORDER_CANCELLATION',
ORDER_COUPON_APPLIED = 'ORDER_COUPON_APPLIED',
ORDER_COUPON_REMOVED = 'ORDER_COUPON_REMOVED',
ORDER_CURRENCY_UPDATED = 'ORDER_CURRENCY_UPDATED',
ORDER_CUSTOMER_UPDATED = 'ORDER_CUSTOMER_UPDATED',
ORDER_FULFILLMENT = 'ORDER_FULFILLMENT',
ORDER_FULFILLMENT_TRANSITION = 'ORDER_FULFILLMENT_TRANSITION',
Expand Down
269 changes: 269 additions & 0 deletions packages/core/e2e/graphql/generated-e2e-shop-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1226,6 +1226,7 @@ export enum HistoryEntryType {
ORDER_CANCELLATION = 'ORDER_CANCELLATION',
ORDER_COUPON_APPLIED = 'ORDER_COUPON_APPLIED',
ORDER_COUPON_REMOVED = 'ORDER_COUPON_REMOVED',
ORDER_CURRENCY_UPDATED = 'ORDER_CURRENCY_UPDATED',
ORDER_CUSTOMER_UPDATED = 'ORDER_CUSTOMER_UPDATED',
ORDER_FULFILLMENT = 'ORDER_FULFILLMENT',
ORDER_FULFILLMENT_TRANSITION = 'ORDER_FULFILLMENT_TRANSITION',
Expand Down Expand Up @@ -1762,6 +1763,7 @@ export type Mutation = {
requestUpdateCustomerEmailAddress: RequestUpdateCustomerEmailAddressResult;
/** Resets a Customer's password based on the provided token */
resetPassword: ResetPasswordResult;
setCurrencyCodeForOrder: UpdateOrderItemsResult;
/** Set the Customer for the Order. Required only if the Customer is not currently logged in */
setCustomerForOrder: SetCustomerForOrderResult;
/** Sets the billing address for the active Order */
Expand Down Expand Up @@ -1874,6 +1876,10 @@ export type MutationResetPasswordArgs = {
token: Scalars['String']['input'];
};

export type MutationSetCurrencyCodeForOrderArgs = {
currencyCode: CurrencyCode;
};

export type MutationSetCustomerForOrderArgs = {
input: CreateCustomerInput;
};
Expand Down Expand Up @@ -3693,6 +3699,89 @@ export type AddItemsToOrderMutation = {
};
};

export type SetCurrencyCodeForOrderMutationVariables = Exact<{
currencyCode: CurrencyCode;
}>;

export type SetCurrencyCodeForOrderMutation = {
setCurrencyCodeForOrder:
| {
errorCode: ErrorCode;
message: string;
quantityAvailable: number;
order: {
id: string;
code: string;
state: string;
active: boolean;
total: number;
totalWithTax: number;
currencyCode: CurrencyCode;
lines: Array<{
id: string;
quantity: number;
unitPrice: number;
unitPriceWithTax: number;
linePrice: number;
linePriceWithTax: number;
productVariant: { id: string };
featuredAsset?: { id: string } | null;
discounts: Array<{
adjustmentSource: string;
amount: number;
amountWithTax: number;
description: string;
type: AdjustmentType;
}>;
}>;
discounts: Array<{
adjustmentSource: string;
amount: number;
amountWithTax: number;
description: string;
type: AdjustmentType;
}>;
};
}
| { errorCode: ErrorCode; message: string }
| {
id: string;
code: string;
state: string;
active: boolean;
total: number;
totalWithTax: number;
currencyCode: CurrencyCode;
lines: Array<{
id: string;
quantity: number;
unitPrice: number;
unitPriceWithTax: number;
linePrice: number;
linePriceWithTax: number;
productVariant: { id: string };
featuredAsset?: { id: string } | null;
discounts: Array<{
adjustmentSource: string;
amount: number;
amountWithTax: number;
description: string;
type: AdjustmentType;
}>;
}>;
discounts: Array<{
adjustmentSource: string;
amount: number;
amountWithTax: number;
description: string;
type: AdjustmentType;
}>;
}
| { errorCode: ErrorCode; message: string; interceptorError: string }
| { errorCode: ErrorCode; message: string }
| { errorCode: ErrorCode; message: string };
};

export type SearchProductsShopQueryVariables = Exact<{
input: SearchInput;
}>;
Expand Down Expand Up @@ -5988,6 +6077,186 @@ export const AddItemsToOrderDocument = {
},
],
} as unknown as DocumentNode<AddItemsToOrderMutation, AddItemsToOrderMutationVariables>;
export const SetCurrencyCodeForOrderDocument = {
kind: 'Document',
definitions: [
{
kind: 'OperationDefinition',
operation: 'mutation',
name: { kind: 'Name', value: 'SetCurrencyCodeForOrder' },
variableDefinitions: [
{
kind: 'VariableDefinition',
variable: { kind: 'Variable', name: { kind: 'Name', value: 'currencyCode' } },
type: {
kind: 'NonNullType',
type: { kind: 'NamedType', name: { kind: 'Name', value: 'CurrencyCode' } },
},
},
],
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: { kind: 'Name', value: 'setCurrencyCodeForOrder' },
arguments: [
{
kind: 'Argument',
name: { kind: 'Name', value: 'currencyCode' },
value: { kind: 'Variable', name: { kind: 'Name', value: 'currencyCode' } },
},
],
selectionSet: {
kind: 'SelectionSet',
selections: [
{ kind: 'FragmentSpread', name: { kind: 'Name', value: 'UpdatedOrder' } },
{
kind: 'InlineFragment',
typeCondition: {
kind: 'NamedType',
name: { kind: 'Name', value: 'ErrorResult' },
},
selectionSet: {
kind: 'SelectionSet',
selections: [
{ kind: 'Field', name: { kind: 'Name', value: 'errorCode' } },
{ kind: 'Field', name: { kind: 'Name', value: 'message' } },
],
},
},
{
kind: 'InlineFragment',
typeCondition: {
kind: 'NamedType',
name: { kind: 'Name', value: 'InsufficientStockError' },
},
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: { kind: 'Name', value: 'quantityAvailable' },
},
{
kind: 'Field',
name: { kind: 'Name', value: 'order' },
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'FragmentSpread',
name: { kind: 'Name', value: 'UpdatedOrder' },
},
],
},
},
],
},
},
{
kind: 'InlineFragment',
typeCondition: {
kind: 'NamedType',
name: { kind: 'Name', value: 'OrderInterceptorError' },
},
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: { kind: 'Name', value: 'interceptorError' },
},
],
},
},
],
},
},
],
},
},
{
kind: 'FragmentDefinition',
name: { kind: 'Name', value: 'UpdatedOrder' },
typeCondition: { kind: 'NamedType', name: { kind: 'Name', value: 'Order' } },
selectionSet: {
kind: 'SelectionSet',
selections: [
{ kind: 'Field', name: { kind: 'Name', value: 'id' } },
{ kind: 'Field', name: { kind: 'Name', value: 'code' } },
{ kind: 'Field', name: { kind: 'Name', value: 'state' } },
{ kind: 'Field', name: { kind: 'Name', value: 'active' } },
{ kind: 'Field', name: { kind: 'Name', value: 'total' } },
{ kind: 'Field', name: { kind: 'Name', value: 'totalWithTax' } },
{ kind: 'Field', name: { kind: 'Name', value: 'currencyCode' } },
{
kind: 'Field',
name: { kind: 'Name', value: 'lines' },
selectionSet: {
kind: 'SelectionSet',
selections: [
{ kind: 'Field', name: { kind: 'Name', value: 'id' } },
{ kind: 'Field', name: { kind: 'Name', value: 'quantity' } },
{
kind: 'Field',
name: { kind: 'Name', value: 'productVariant' },
selectionSet: {
kind: 'SelectionSet',
selections: [{ kind: 'Field', name: { kind: 'Name', value: 'id' } }],
},
},
{ kind: 'Field', name: { kind: 'Name', value: 'unitPrice' } },
{ kind: 'Field', name: { kind: 'Name', value: 'unitPriceWithTax' } },
{ kind: 'Field', name: { kind: 'Name', value: 'linePrice' } },
{ kind: 'Field', name: { kind: 'Name', value: 'linePriceWithTax' } },
{
kind: 'Field',
name: { kind: 'Name', value: 'featuredAsset' },
selectionSet: {
kind: 'SelectionSet',
selections: [{ kind: 'Field', name: { kind: 'Name', value: 'id' } }],
},
},
{
kind: 'Field',
name: { kind: 'Name', value: 'discounts' },
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: { kind: 'Name', value: 'adjustmentSource' },
},
{ kind: 'Field', name: { kind: 'Name', value: 'amount' } },
{ kind: 'Field', name: { kind: 'Name', value: 'amountWithTax' } },
{ kind: 'Field', name: { kind: 'Name', value: 'description' } },
{ kind: 'Field', name: { kind: 'Name', value: 'type' } },
],
},
},
],
},
},
{
kind: 'Field',
name: { kind: 'Name', value: 'discounts' },
selectionSet: {
kind: 'SelectionSet',
selections: [
{ kind: 'Field', name: { kind: 'Name', value: 'adjustmentSource' } },
{ kind: 'Field', name: { kind: 'Name', value: 'amount' } },
{ kind: 'Field', name: { kind: 'Name', value: 'amountWithTax' } },
{ kind: 'Field', name: { kind: 'Name', value: 'description' } },
{ kind: 'Field', name: { kind: 'Name', value: 'type' } },
],
},
},
],
},
},
],
} as unknown as DocumentNode<SetCurrencyCodeForOrderMutation, SetCurrencyCodeForOrderMutationVariables>;
export const SearchProductsShopDocument = {
kind: 'Document',
definitions: [
Expand Down
25 changes: 23 additions & 2 deletions packages/core/e2e/graphql/shop-definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,33 @@ export const ADD_MULTIPLE_ITEMS_TO_ORDER = gql`
...UpdatedOrder
}
errorResults {
...on ErrorResult {
... on ErrorResult {
errorCode
message
}
}

}
}
${UPDATED_ORDER_FRAGMENT}
`;

export const SET_CURRENCY_CODE_FOR_ORDER = gql`
mutation SetCurrencyCodeForOrder($currencyCode: CurrencyCode!) {
setCurrencyCodeForOrder(currencyCode: $currencyCode) {
...UpdatedOrder
... on ErrorResult {
errorCode
message
}
... on InsufficientStockError {
quantityAvailable
order {
...UpdatedOrder
}
}
... on OrderInterceptorError {
interceptorError
}
}
}
${UPDATED_ORDER_FRAGMENT}
Expand Down
Loading