Skip to content

Commit

Permalink
fix(core): Enforce Channels created with a default tax/shipping Zone
Browse files Browse the repository at this point in the history
Relates to #218
  • Loading branch information
michaelbromley committed Dec 2, 2019
1 parent 31ef93e commit f57fb51
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 9 deletions.
4 changes: 2 additions & 2 deletions packages/common/src/generated-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,8 @@ export type CreateChannelInput = {
defaultLanguageCode: LanguageCode,
pricesIncludeTax: Scalars['Boolean'],
currencyCode: CurrencyCode,
defaultTaxZoneId?: Maybe<Scalars['ID']>,
defaultShippingZoneId?: Maybe<Scalars['ID']>,
defaultTaxZoneId: Scalars['ID'],
defaultShippingZoneId: Scalars['ID'],
};

export type CreateCollectionInput = {
Expand Down
2 changes: 2 additions & 0 deletions packages/core/e2e/default-search-plugin.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,8 @@ describe('Default search plugin', () => {
defaultLanguageCode: LanguageCode.en,
currencyCode: CurrencyCode.GBP,
pricesIncludeTax: true,
defaultTaxZoneId: 'T_1',
defaultShippingZoneId: 'T_1',
},
});
secondChannel = createChannel;
Expand Down
28 changes: 26 additions & 2 deletions packages/core/e2e/graphql/generated-e2e-admin-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,8 @@ export type CreateChannelInput = {
defaultLanguageCode: LanguageCode;
pricesIncludeTax: Scalars['Boolean'];
currencyCode: CurrencyCode;
defaultTaxZoneId?: Maybe<Scalars['ID']>;
defaultShippingZoneId?: Maybe<Scalars['ID']>;
defaultTaxZoneId: Scalars['ID'];
defaultShippingZoneId: Scalars['ID'];
};

export type CreateCollectionInput = {
Expand Down Expand Up @@ -3428,6 +3428,18 @@ export type UpdateAdministratorMutation = { __typename?: 'Mutation' } & {
updateAdministrator: { __typename?: 'Administrator' } & AdministratorFragment;
};

export type Q1QueryVariables = {};

export type Q1Query = { __typename?: 'Query' } & {
product: Maybe<{ __typename?: 'Product' } & Pick<Product, 'id' | 'name'>>;
};

export type Q2QueryVariables = {};

export type Q2Query = { __typename?: 'Query' } & {
product: Maybe<{ __typename?: 'Product' } & Pick<Product, 'id' | 'name'>>;
};

export type CanCreateCustomerMutationVariables = {
input: CreateCustomerInput;
};
Expand Down Expand Up @@ -5129,6 +5141,18 @@ export namespace UpdateAdministrator {
export type UpdateAdministrator = AdministratorFragment;
}

export namespace Q1 {
export type Variables = Q1QueryVariables;
export type Query = Q1Query;
export type Product = NonNullable<Q1Query['product']>;
}

export namespace Q2 {
export type Variables = Q2QueryVariables;
export type Query = Q2Query;
export type Product = NonNullable<Q2Query['product']>;
}

export namespace CanCreateCustomer {
export type Variables = CanCreateCustomerMutationVariables;
export type Mutation = CanCreateCustomerMutation;
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/api/schema/admin-api/channel.api.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ input CreateChannelInput {
defaultLanguageCode: LanguageCode!
pricesIncludeTax: Boolean!
currencyCode: CurrencyCode!
defaultTaxZoneId: ID
defaultShippingZoneId: ID
defaultTaxZoneId: ID!
defaultShippingZoneId: ID!
}

input UpdateChannelInput {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,7 @@ describe('Elasticsearch plugin', () => {
currencyCode: CurrencyCode.GBP,
pricesIncludeTax: true,
defaultTaxZoneId: 'T_2',
defaultShippingZoneId: 'T_1',
},
});
secondChannel = createChannel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,8 @@ export type CreateChannelInput = {
defaultLanguageCode: LanguageCode;
pricesIncludeTax: Scalars['Boolean'];
currencyCode: CurrencyCode;
defaultTaxZoneId?: Maybe<Scalars['ID']>;
defaultShippingZoneId?: Maybe<Scalars['ID']>;
defaultTaxZoneId: Scalars['ID'];
defaultShippingZoneId: Scalars['ID'];
};

export type CreateCollectionInput = {
Expand Down
2 changes: 1 addition & 1 deletion schema-admin.json

Large diffs are not rendered by default.

0 comments on commit f57fb51

Please sign in to comment.