Skip to content

Commit

Permalink
feat(core): Allow Order/OrderLine customFields to be modified
Browse files Browse the repository at this point in the history
Relates to #314
  • Loading branch information
michaelbromley committed Dec 22, 2020
1 parent d3e3a88 commit ce656c4
Show file tree
Hide file tree
Showing 13 changed files with 345 additions and 114 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1406,7 +1406,7 @@ export type ModifyOrderInput = {
dryRun: Scalars['Boolean'];
orderId: Scalars['ID'];
addItems?: Maybe<Array<AddItemInput>>;
adjustOrderLines?: Maybe<Array<OrderLineInput>>;
adjustOrderLines?: Maybe<Array<AdjustOrderLineInput>>;
surcharges?: Maybe<Array<SurchargeInput>>;
updateShippingAddress?: Maybe<UpdateOrderAddressInput>;
updateBillingAddress?: Maybe<UpdateOrderAddressInput>;
Expand All @@ -1420,6 +1420,11 @@ export type AddItemInput = {
quantity: Scalars['Int'];
};

export type AdjustOrderLineInput = {
orderLineId: Scalars['ID'];
quantity: Scalars['Int'];
};

export type SurchargeInput = {
description: Scalars['String'];
sku?: Maybe<Scalars['String']>;
Expand Down Expand Up @@ -3594,7 +3599,7 @@ export type OrderLine = Node & {
discounts: Array<Adjustment>;
taxLines: Array<TaxLine>;
order: Order;
customFields?: Maybe<OrderLineCustomFields>;
customFields?: Maybe<Scalars['JSON']>;
};

export type Payment = Node & {
Expand Down Expand Up @@ -4310,11 +4315,6 @@ export type HistoryEntrySortParameter = {
updatedAt?: Maybe<SortOrder>;
};

export type OrderLineCustomFields = {
test?: Maybe<Scalars['String']>;
test2?: Maybe<Scalars['String']>;
};

export type AuthenticationInput = {
native?: Maybe<NativeAuthInput>;
};
Expand Down
15 changes: 1 addition & 14 deletions packages/common/src/generated-shop-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ export type Mutation = {
export type MutationAddItemToOrderArgs = {
productVariantId: Scalars['ID'];
quantity: Scalars['Int'];
customFields?: Maybe<OrderLineCustomFieldsInput>;
};

export type MutationRemoveOrderLineArgs = {
Expand All @@ -191,7 +190,6 @@ export type MutationRemoveOrderLineArgs = {
export type MutationAdjustOrderLineArgs = {
orderLineId: Scalars['ID'];
quantity: Scalars['Int'];
customFields?: Maybe<OrderLineCustomFieldsInput>;
};

export type MutationApplyCouponCodeArgs = {
Expand Down Expand Up @@ -1925,7 +1923,7 @@ export type OrderLine = Node & {
discounts: Array<Adjustment>;
taxLines: Array<TaxLine>;
order: Order;
customFields?: Maybe<OrderLineCustomFields>;
customFields?: Maybe<Scalars['JSON']>;
};

export type Payment = Node & {
Expand Down Expand Up @@ -2722,17 +2720,6 @@ export type UpdateOrderInput = {
customFields?: Maybe<Scalars['JSON']>;
};

export type OrderLineCustomFields = {
__typename?: 'OrderLineCustomFields';
test?: Maybe<Scalars['String']>;
test2?: Maybe<Scalars['String']>;
};

export type OrderLineCustomFieldsInput = {
test?: Maybe<Scalars['String']>;
test2?: Maybe<Scalars['String']>;
};

export type AuthenticationInput = {
native?: Maybe<NativeAuthInput>;
};
Expand Down
15 changes: 7 additions & 8 deletions packages/common/src/generated-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1567,7 +1567,7 @@ export type ModifyOrderInput = {
dryRun: Scalars['Boolean'];
orderId: Scalars['ID'];
addItems?: Maybe<Array<AddItemInput>>;
adjustOrderLines?: Maybe<Array<OrderLineInput>>;
adjustOrderLines?: Maybe<Array<AdjustOrderLineInput>>;
surcharges?: Maybe<Array<SurchargeInput>>;
updateShippingAddress?: Maybe<UpdateOrderAddressInput>;
updateBillingAddress?: Maybe<UpdateOrderAddressInput>;
Expand All @@ -1581,6 +1581,11 @@ export type AddItemInput = {
quantity: Scalars['Int'];
};

export type AdjustOrderLineInput = {
orderLineId: Scalars['ID'];
quantity: Scalars['Int'];
};

export type SurchargeInput = {
description: Scalars['String'];
sku?: Maybe<Scalars['String']>;
Expand Down Expand Up @@ -3802,7 +3807,7 @@ export type OrderLine = Node & {
discounts: Array<Adjustment>;
taxLines: Array<TaxLine>;
order: Order;
customFields?: Maybe<OrderLineCustomFields>;
customFields?: Maybe<Scalars['JSON']>;
};

export type Payment = Node & {
Expand Down Expand Up @@ -4547,12 +4552,6 @@ export type HistoryEntrySortParameter = {
updatedAt?: Maybe<SortOrder>;
};

export type OrderLineCustomFields = {
__typename?: 'OrderLineCustomFields';
test?: Maybe<Scalars['String']>;
test2?: Maybe<Scalars['String']>;
};

export type AuthenticationInput = {
native?: Maybe<NativeAuthInput>;
};
Expand Down
14 changes: 7 additions & 7 deletions packages/core/e2e/graphql/generated-e2e-admin-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1406,7 +1406,7 @@ export type ModifyOrderInput = {
dryRun: Scalars['Boolean'];
orderId: Scalars['ID'];
addItems?: Maybe<Array<AddItemInput>>;
adjustOrderLines?: Maybe<Array<OrderLineInput>>;
adjustOrderLines?: Maybe<Array<AdjustOrderLineInput>>;
surcharges?: Maybe<Array<SurchargeInput>>;
updateShippingAddress?: Maybe<UpdateOrderAddressInput>;
updateBillingAddress?: Maybe<UpdateOrderAddressInput>;
Expand All @@ -1420,6 +1420,11 @@ export type AddItemInput = {
quantity: Scalars['Int'];
};

export type AdjustOrderLineInput = {
orderLineId: Scalars['ID'];
quantity: Scalars['Int'];
};

export type SurchargeInput = {
description: Scalars['String'];
sku?: Maybe<Scalars['String']>;
Expand Down Expand Up @@ -3594,7 +3599,7 @@ export type OrderLine = Node & {
discounts: Array<Adjustment>;
taxLines: Array<TaxLine>;
order: Order;
customFields?: Maybe<OrderLineCustomFields>;
customFields?: Maybe<Scalars['JSON']>;
};

export type Payment = Node & {
Expand Down Expand Up @@ -4310,11 +4315,6 @@ export type HistoryEntrySortParameter = {
updatedAt?: Maybe<SortOrder>;
};

export type OrderLineCustomFields = {
test?: Maybe<Scalars['String']>;
test2?: Maybe<Scalars['String']>;
};

export type AuthenticationInput = {
native?: Maybe<NativeAuthInput>;
};
Expand Down
14 changes: 1 addition & 13 deletions packages/core/e2e/graphql/generated-e2e-shop-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ export type Mutation = {
export type MutationAddItemToOrderArgs = {
productVariantId: Scalars['ID'];
quantity: Scalars['Int'];
customFields?: Maybe<OrderLineCustomFieldsInput>;
};

export type MutationRemoveOrderLineArgs = {
Expand All @@ -189,7 +188,6 @@ export type MutationRemoveOrderLineArgs = {
export type MutationAdjustOrderLineArgs = {
orderLineId: Scalars['ID'];
quantity: Scalars['Int'];
customFields?: Maybe<OrderLineCustomFieldsInput>;
};

export type MutationApplyCouponCodeArgs = {
Expand Down Expand Up @@ -1867,7 +1865,7 @@ export type OrderLine = Node & {
discounts: Array<Adjustment>;
taxLines: Array<TaxLine>;
order: Order;
customFields?: Maybe<OrderLineCustomFields>;
customFields?: Maybe<Scalars['JSON']>;
};

export type Payment = Node & {
Expand Down Expand Up @@ -2613,16 +2611,6 @@ export type UpdateOrderInput = {
customFields?: Maybe<Scalars['JSON']>;
};

export type OrderLineCustomFields = {
test?: Maybe<Scalars['String']>;
test2?: Maybe<Scalars['String']>;
};

export type OrderLineCustomFieldsInput = {
test?: Maybe<Scalars['String']>;
test2?: Maybe<Scalars['String']>;
};

export type AuthenticationInput = {
native?: Maybe<NativeAuthInput>;
};
Expand Down
Loading

0 comments on commit ce656c4

Please sign in to comment.