Skip to content

Commit

Permalink
feat(core): Implement CustomerGroup queries & mutations
Browse files Browse the repository at this point in the history
Relates to #330
  • Loading branch information
michaelbromley committed May 21, 2020
1 parent eeb471f commit 13342c0
Show file tree
Hide file tree
Showing 22 changed files with 813 additions and 49 deletions.
39 changes: 38 additions & 1 deletion packages/admin-ui/src/lib/core/src/common/generated-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,38 @@ export type CustomerGroup = Node & {
createdAt: Scalars['DateTime'];
updatedAt: Scalars['DateTime'];
name: Scalars['String'];
customers: CustomerList;
};


export type CustomerGroupCustomersArgs = {
options?: Maybe<CustomerListOptions>;
};

export type CustomerGroupFilterParameter = {
createdAt?: Maybe<DateOperators>;
updatedAt?: Maybe<DateOperators>;
name?: Maybe<StringOperators>;
};

export type CustomerGroupList = PaginatedList & {
__typename?: 'CustomerGroupList';
items: Array<CustomerGroup>;
totalItems: Scalars['Int'];
};

export type CustomerGroupListOptions = {
skip?: Maybe<Scalars['Int']>;
take?: Maybe<Scalars['Int']>;
sort?: Maybe<CustomerGroupSortParameter>;
filter?: Maybe<CustomerGroupFilterParameter>;
};

export type CustomerGroupSortParameter = {
id?: Maybe<SortOrder>;
createdAt?: Maybe<SortOrder>;
updatedAt?: Maybe<SortOrder>;
name?: Maybe<SortOrder>;
};

export type CustomerList = PaginatedList & {
Expand Down Expand Up @@ -2864,7 +2896,7 @@ export type Query = {
country?: Maybe<Country>;
customer?: Maybe<Customer>;
customerGroup?: Maybe<CustomerGroup>;
customerGroups: Array<CustomerGroup>;
customerGroups: CustomerGroupList;
customers: CustomerList;
facet?: Maybe<Facet>;
facets: FacetList;
Expand Down Expand Up @@ -2963,6 +2995,11 @@ export type QueryCustomerGroupArgs = {
};


export type QueryCustomerGroupsArgs = {
options?: Maybe<CustomerGroupListOptions>;
};


export type QueryCustomersArgs = {
options?: Maybe<CustomerListOptions>;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,17 @@ const result: IntrospectionResultData = {
{
name: 'HistoryEntryList',
},
{
name: 'CustomerList',
},
{
name: 'CollectionList',
},
{
name: 'CountryList',
},
{
name: 'CustomerList',
name: 'CustomerGroupList',
},
{
name: 'FacetList',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,37 @@ export type CustomerGroup = Node & {
createdAt: Scalars['DateTime'];
updatedAt: Scalars['DateTime'];
name: Scalars['String'];
customers: CustomerList;
};

export type CustomerGroupCustomersArgs = {
options?: Maybe<CustomerListOptions>;
};

export type CustomerGroupFilterParameter = {
createdAt?: Maybe<DateOperators>;
updatedAt?: Maybe<DateOperators>;
name?: Maybe<StringOperators>;
};

export type CustomerGroupList = PaginatedList & {
__typename?: 'CustomerGroupList';
items: Array<CustomerGroup>;
totalItems: Scalars['Int'];
};

export type CustomerGroupListOptions = {
skip?: Maybe<Scalars['Int']>;
take?: Maybe<Scalars['Int']>;
sort?: Maybe<CustomerGroupSortParameter>;
filter?: Maybe<CustomerGroupFilterParameter>;
};

export type CustomerGroupSortParameter = {
id?: Maybe<SortOrder>;
createdAt?: Maybe<SortOrder>;
updatedAt?: Maybe<SortOrder>;
name?: Maybe<SortOrder>;
};

export type CustomerList = PaginatedList & {
Expand Down Expand Up @@ -1777,6 +1808,8 @@ export type Mutation = {
createCustomerGroup: CustomerGroup;
/** Update an existing CustomerGroup */
updateCustomerGroup: CustomerGroup;
/** Delete a CustomerGroup */
deleteCustomerGroup: DeletionResponse;
/** Add Customers to a CustomerGroup */
addCustomersToGroup: CustomerGroup;
/** Remove Customers from a CustomerGroup */
Expand Down Expand Up @@ -1965,6 +1998,10 @@ export type MutationUpdateCustomerGroupArgs = {
input: UpdateCustomerGroupInput;
};

export type MutationDeleteCustomerGroupArgs = {
id: Scalars['ID'];
};

export type MutationAddCustomersToGroupArgs = {
customerGroupId: Scalars['ID'];
customerIds: Array<Scalars['ID']>;
Expand Down Expand Up @@ -2747,7 +2784,7 @@ export type Query = {
collectionFilters: Array<ConfigurableOperationDefinition>;
countries: CountryList;
country?: Maybe<Country>;
customerGroups: Array<CustomerGroup>;
customerGroups: CustomerGroupList;
customerGroup?: Maybe<CustomerGroup>;
customers: CustomerList;
customer?: Maybe<Customer>;
Expand Down Expand Up @@ -2824,6 +2861,10 @@ export type QueryCountryArgs = {
id: Scalars['ID'];
};

export type QueryCustomerGroupsArgs = {
options?: Maybe<CustomerGroupListOptions>;
};

export type QueryCustomerGroupArgs = {
id: Scalars['ID'];
};
Expand Down
35 changes: 34 additions & 1 deletion packages/common/src/generated-shop-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -661,12 +661,27 @@ export type CustomerOrdersArgs = {
options?: Maybe<OrderListOptions>;
};

export type CustomerFilterParameter = {
createdAt?: Maybe<DateOperators>;
updatedAt?: Maybe<DateOperators>;
title?: Maybe<StringOperators>;
firstName?: Maybe<StringOperators>;
lastName?: Maybe<StringOperators>;
phoneNumber?: Maybe<StringOperators>;
emailAddress?: Maybe<StringOperators>;
};

export type CustomerGroup = Node & {
__typename?: 'CustomerGroup';
id: Scalars['ID'];
createdAt: Scalars['DateTime'];
updatedAt: Scalars['DateTime'];
name: Scalars['String'];
customers: CustomerList;
};

export type CustomerGroupCustomersArgs = {
options?: Maybe<CustomerListOptions>;
};

export type CustomerList = PaginatedList & {
Expand All @@ -675,6 +690,24 @@ export type CustomerList = PaginatedList & {
totalItems: Scalars['Int'];
};

export type CustomerListOptions = {
skip?: Maybe<Scalars['Int']>;
take?: Maybe<Scalars['Int']>;
sort?: Maybe<CustomerSortParameter>;
filter?: Maybe<CustomerFilterParameter>;
};

export type CustomerSortParameter = {
id?: Maybe<SortOrder>;
createdAt?: Maybe<SortOrder>;
updatedAt?: Maybe<SortOrder>;
title?: Maybe<SortOrder>;
firstName?: Maybe<SortOrder>;
lastName?: Maybe<SortOrder>;
phoneNumber?: Maybe<SortOrder>;
emailAddress?: Maybe<SortOrder>;
};

export type CustomField = {
name: Scalars['String'];
type: Scalars['String'];
Expand Down Expand Up @@ -1322,7 +1355,7 @@ export type Mutation = {
removeOrderLine?: Maybe<Order>;
/**
* Adjusts an OrderLine. If custom fields are defined on the OrderLine entity, a
* third argument 'customFields' will be available.
* third argument 'customFields' of type `OrderLineCustomFieldsInput` will be available.
*/
adjustOrderLine?: Maybe<Order>;
/** Applies the given coupon code to the active Order */
Expand Down
46 changes: 45 additions & 1 deletion packages/common/src/generated-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,38 @@ export type CustomerGroup = Node & {
createdAt: Scalars['DateTime'];
updatedAt: Scalars['DateTime'];
name: Scalars['String'];
customers: CustomerList;
};


export type CustomerGroupCustomersArgs = {
options?: Maybe<CustomerListOptions>;
};

export type CustomerGroupFilterParameter = {
createdAt?: Maybe<DateOperators>;
updatedAt?: Maybe<DateOperators>;
name?: Maybe<StringOperators>;
};

export type CustomerGroupList = PaginatedList & {
__typename?: 'CustomerGroupList';
items: Array<CustomerGroup>;
totalItems: Scalars['Int'];
};

export type CustomerGroupListOptions = {
skip?: Maybe<Scalars['Int']>;
take?: Maybe<Scalars['Int']>;
sort?: Maybe<CustomerGroupSortParameter>;
filter?: Maybe<CustomerGroupFilterParameter>;
};

export type CustomerGroupSortParameter = {
id?: Maybe<SortOrder>;
createdAt?: Maybe<SortOrder>;
updatedAt?: Maybe<SortOrder>;
name?: Maybe<SortOrder>;
};

export type CustomerList = PaginatedList & {
Expand Down Expand Up @@ -1774,6 +1806,8 @@ export type Mutation = {
createCustomerGroup: CustomerGroup;
/** Update an existing CustomerGroup */
updateCustomerGroup: CustomerGroup;
/** Delete a CustomerGroup */
deleteCustomerGroup: DeletionResponse;
/** Add Customers to a CustomerGroup */
addCustomersToGroup: CustomerGroup;
/** Remove Customers from a CustomerGroup */
Expand Down Expand Up @@ -1982,6 +2016,11 @@ export type MutationUpdateCustomerGroupArgs = {
};


export type MutationDeleteCustomerGroupArgs = {
id: Scalars['ID'];
};


export type MutationAddCustomersToGroupArgs = {
customerGroupId: Scalars['ID'];
customerIds: Array<Scalars['ID']>;
Expand Down Expand Up @@ -2823,7 +2862,7 @@ export type Query = {
collectionFilters: Array<ConfigurableOperationDefinition>;
countries: CountryList;
country?: Maybe<Country>;
customerGroups: Array<CustomerGroup>;
customerGroups: CustomerGroupList;
customerGroup?: Maybe<CustomerGroup>;
customers: CustomerList;
customer?: Maybe<Customer>;
Expand Down Expand Up @@ -2910,6 +2949,11 @@ export type QueryCountryArgs = {
};


export type QueryCustomerGroupsArgs = {
options?: Maybe<CustomerGroupListOptions>;
};


export type QueryCustomerGroupArgs = {
id: Scalars['ID'];
};
Expand Down
Loading

0 comments on commit 13342c0

Please sign in to comment.