Skip to content

Commit

Permalink
feat(core): Implement create and update of ProductOption
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbromley committed Jul 9, 2019
1 parent d2b2b18 commit 601c766
Show file tree
Hide file tree
Showing 12 changed files with 525 additions and 112 deletions.
103 changes: 65 additions & 38 deletions packages/common/src/generated-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,11 @@ export type CreateFacetValueWithFacetInput = {
translations: Array<FacetValueTranslationInput>,
};

export type CreateGroupOptionInput = {
code: Scalars['String'],
translations: Array<ProductOptionGroupTranslationInput>,
};

export type CreateProductInput = {
featuredAssetId?: Maybe<Scalars['ID']>,
assetIds?: Maybe<Array<Scalars['ID']>>,
Expand All @@ -469,11 +474,12 @@ export type CreateProductInput = {
export type CreateProductOptionGroupInput = {
code: Scalars['String'],
translations: Array<ProductOptionGroupTranslationInput>,
options: Array<CreateProductOptionInput>,
options: Array<CreateGroupOptionInput>,
customFields?: Maybe<Scalars['JSON']>,
};

export type CreateProductOptionInput = {
productOptionGroupId: Scalars['ID'],
code: Scalars['String'],
translations: Array<ProductOptionGroupTranslationInput>,
customFields?: Maybe<Scalars['JSON']>,
Expand Down Expand Up @@ -1564,6 +1570,14 @@ export type Mutation = {
updateCountry: Country,
/** Delete a Country */
deleteCountry: DeletionResponse,
/** Create a new CustomerGroup */
createCustomerGroup: CustomerGroup,
/** Update an existing CustomerGroup */
updateCustomerGroup: CustomerGroup,
/** Add Customers to a CustomerGroup */
addCustomersToGroup: CustomerGroup,
/** Remove Customers from a CustomerGroup */
removeCustomersFromGroup: CustomerGroup,
/** Create a new Customer. If a password is provided, a new User will also be created an linked to the Customer. */
createCustomer: Customer,
/** Update an existing Customer */
Expand All @@ -1576,14 +1590,6 @@ export type Mutation = {
updateCustomerAddress: Address,
/** Update an existing Address */
deleteCustomerAddress: Scalars['Boolean'],
/** Create a new CustomerGroup */
createCustomerGroup: CustomerGroup,
/** Update an existing CustomerGroup */
updateCustomerGroup: CustomerGroup,
/** Add Customers to a CustomerGroup */
addCustomersToGroup: CustomerGroup,
/** Remove Customers from a CustomerGroup */
removeCustomersFromGroup: CustomerGroup,
/** Create a new Facet */
createFacet: Facet,
/** Update an existing Facet */
Expand All @@ -1610,6 +1616,10 @@ export type Mutation = {
createProductOptionGroup: ProductOptionGroup,
/** Update an existing ProductOptionGroup */
updateProductOptionGroup: ProductOptionGroup,
/** Create a new ProductOption within a ProductOptionGroup */
createProductOption: ProductOption,
/** Create a new ProductOption within a ProductOptionGroup */
updateProductOption: ProductOption,
reindex: JobInfo,
/** Create a new Product */
createProduct: Product,
Expand Down Expand Up @@ -1727,6 +1737,28 @@ export type MutationDeleteCountryArgs = {
};


export type MutationCreateCustomerGroupArgs = {
input: CreateCustomerGroupInput
};


export type MutationUpdateCustomerGroupArgs = {
input: UpdateCustomerGroupInput
};


export type MutationAddCustomersToGroupArgs = {
customerGroupId: Scalars['ID'],
customerIds: Array<Scalars['ID']>
};


export type MutationRemoveCustomersFromGroupArgs = {
customerGroupId: Scalars['ID'],
customerIds: Array<Scalars['ID']>
};


export type MutationCreateCustomerArgs = {
input: CreateCustomerInput,
password?: Maybe<Scalars['String']>
Expand Down Expand Up @@ -1759,28 +1791,6 @@ export type MutationDeleteCustomerAddressArgs = {
};


export type MutationCreateCustomerGroupArgs = {
input: CreateCustomerGroupInput
};


export type MutationUpdateCustomerGroupArgs = {
input: UpdateCustomerGroupInput
};


export type MutationAddCustomersToGroupArgs = {
customerGroupId: Scalars['ID'],
customerIds: Array<Scalars['ID']>
};


export type MutationRemoveCustomersFromGroupArgs = {
customerGroupId: Scalars['ID'],
customerIds: Array<Scalars['ID']>
};


export type MutationCreateFacetArgs = {
input: CreateFacetInput
};
Expand Down Expand Up @@ -1868,6 +1878,16 @@ export type MutationUpdateProductOptionGroupArgs = {
};


export type MutationCreateProductOptionArgs = {
input: CreateProductOptionInput
};


export type MutationUpdateProductOptionArgs = {
input: UpdateProductOptionInput
};


export type MutationCreateProductArgs = {
input: CreateProductInput
};
Expand Down Expand Up @@ -2500,10 +2520,10 @@ export type Query = {
collectionFilters: Array<ConfigurableOperation>,
countries: CountryList,
country?: Maybe<Country>,
customers: CustomerList,
customer?: Maybe<Customer>,
customerGroups: Array<CustomerGroup>,
customerGroup?: Maybe<CustomerGroup>,
customers: CustomerList,
customer?: Maybe<Customer>,
facets: FacetList,
facet?: Maybe<Facet>,
globalSettings: GlobalSettings,
Expand Down Expand Up @@ -2584,17 +2604,17 @@ export type QueryCountryArgs = {
};


export type QueryCustomersArgs = {
options?: Maybe<CustomerListOptions>
export type QueryCustomerGroupArgs = {
id: Scalars['ID']
};


export type QueryCustomerArgs = {
id: Scalars['ID']
export type QueryCustomersArgs = {
options?: Maybe<CustomerListOptions>
};


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

Expand Down Expand Up @@ -3140,6 +3160,13 @@ export type UpdateProductOptionGroupInput = {
customFields?: Maybe<Scalars['JSON']>,
};

export type UpdateProductOptionInput = {
id: Scalars['ID'],
code?: Maybe<Scalars['String']>,
translations?: Maybe<Array<ProductOptionGroupTranslationInput>>,
customFields?: Maybe<Scalars['JSON']>,
};

export type UpdateProductVariantInput = {
id: Scalars['ID'],
enabled?: Maybe<Scalars['Boolean']>,
Expand Down
8 changes: 4 additions & 4 deletions packages/core/e2e/fixtures/e2e-products-minimal.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name , slug , description , assets , facets , optionGroups , optionValues , sku , price , taxCategory , stockOnHand , trackInventory , variantAssets , variantFacets
Laptop , laptop , "Now equipped with seventh-generation Intel Core processors, Laptop is snappier than ever. From daily tasks like launching apps and opening files to more advanced computing, you can power through your day thanks to faster SSDs and Turbo Boost processing up to 3.6GHz." , derick-david-409858-unsplash.jpg , category:electronics|category:computers , "screen size, RAM" , "13 inch, 8GB" , L2201308 , 1299.00 , standard , 100 , false , ,
, , , , , , "15 inch, 8GB" , L2201508 , 1399.00 , standard , 100 , false , ,
, , , , , , "13 inch, 16GB" , L2201316 , 2199.00 , standard , 100 , false , ,
, , , , , , "15 inch, 16GB" , L2201516 , 2299.00 , standard , 100 , false , ,
Laptop , laptop , "Now equipped with seventh-generation Intel Core processors, Laptop is snappier than ever. From daily tasks like launching apps and opening files to more advanced computing, you can power through your day thanks to faster SSDs and Turbo Boost processing up to 3.6GHz." , derick-david-409858-unsplash.jpg , category:electronics|category:computers , "screen size|RAM" , "13 inch|8GB" , L2201308 , 1299.00 , standard , 100 , false , ,
, , , , , , "15 inch|8GB" , L2201508 , 1399.00 , standard , 100 , false , ,
, , , , , , "13 inch|16GB" , L2201316 , 2199.00 , standard , 100 , false , ,
, , , , , , "15 inch|16GB" , L2201516 , 2299.00 , standard , 100 , false , ,

0 comments on commit 601c766

Please sign in to comment.