From 9e66d99dca22fbab29f66a69f8557060372c5f26 Mon Sep 17 00:00:00 2001 From: Dawid Tarasiuk Date: Thu, 18 Jun 2020 16:53:07 +0200 Subject: [PATCH] Use productRangeUndiscounted instead of calculating variant prices range --- .../CategoryProductList.tsx | 34 +- src/categories/fixtures.ts | 440 +++---- src/categories/queries.ts | 25 +- src/categories/types/CategoryDetails.ts | 33 +- .../components/ProductList/ProductList.tsx | 36 +- .../components/ProductListPage/utils.ts | 20 - src/products/fixtures.ts | 1080 ++++++++--------- src/products/queries.ts | 38 +- .../types/CreateMultipleVariantsData.ts | 33 +- src/products/types/Product.ts | 110 +- src/products/types/ProductCreate.ts | 110 +- src/products/types/ProductDetails.ts | 110 +- src/products/types/ProductImageCreate.ts | 110 +- src/products/types/ProductImageUpdate.ts | 110 +- src/products/types/ProductList.ts | 33 +- src/products/types/ProductUpdate.ts | 110 +- .../types/ProductVariantAttributesFragment.ts | 33 +- src/products/types/SimpleProductUpdate.ts | 110 +- .../ProductVariantCreator.tsx | 2 +- .../__snapshots__/Stories.test.ts.snap | 100 +- 20 files changed, 1340 insertions(+), 1337 deletions(-) diff --git a/src/categories/components/CategoryProductList/CategoryProductList.tsx b/src/categories/components/CategoryProductList/CategoryProductList.tsx index 1fc85f9e6..3959c3bb6 100644 --- a/src/categories/components/CategoryProductList/CategoryProductList.tsx +++ b/src/categories/components/CategoryProductList/CategoryProductList.tsx @@ -14,14 +14,13 @@ import TableCellAvatar, { import TableHead from "@saleor/components/TableHead"; import TablePagination from "@saleor/components/TablePagination"; import { maybe, renderCollection } from "@saleor/misc"; -import { getProductPriceRange } from "@saleor/products/components/ProductListPage/utils"; import { ListActions, ListProps } from "@saleor/types"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; import { CategoryDetails_category_products_edges_node, - CategoryDetails_category_products_edges_node_variants + CategoryDetails_category_products_edges_node_pricing_priceRangeUndiscounted } from "../../types/CategoryDetails"; const useStyles = makeStyles( @@ -99,21 +98,26 @@ export const CategoryProductList: React.FC = props => const numberOfColumns = 5; const getProductPrice = ( - variants: CategoryDetails_category_products_edges_node_variants[] + priceRangeUndiscounted: CategoryDetails_category_products_edges_node_pricing_priceRangeUndiscounted ) => { - if (!variants.length) { + if (!priceRangeUndiscounted) { return null; } - const { max, min } = getProductPriceRange(variants); - const currency = variants[0].price.currency; + const { start, stop } = priceRangeUndiscounted; + const { + gross: { amount: startAmount } + } = start; + const { + gross: { amount: stopAmount } + } = stop; - if (max === min) { + if (startAmount === stopAmount) { return ( ); @@ -122,15 +126,15 @@ export const CategoryProductList: React.FC = props => <> {" - "} @@ -251,8 +255,8 @@ export const CategoryProductList: React.FC = props => )} - {product?.variants ? ( - getProductPrice(product.variants) + {product?.pricing?.priceRangeUndiscounted ? ( + getProductPrice(product?.pricing?.priceRangeUndiscounted) ) : ( )} diff --git a/src/categories/fixtures.ts b/src/categories/fixtures.ts index 6e680a223..60537288d 100644 --- a/src/categories/fixtures.ts +++ b/src/categories/fixtures.ts @@ -120,32 +120,34 @@ export const category: ( id: "UHJvZHVjdDoyMQ==", isAvailable: true, name: "Gardner-Schultz", + pricing: { + __typename: "ProductPricingInfo", + priceRangeUndiscounted: { + __typename: "TaxedMoneyRange", + start: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 3, + currency: "USD" + } + }, + stop: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 8, + currency: "USD" + } + } + } + }, productType: { __typename: "ProductType", id: "UHJvZHVjdFR5cGU6Mw==", name: "Coffee" }, - thumbnail: { __typename: "Image", url: placeholderImage }, - variants: [ - { - __typename: "ProductVariant" as "ProductVariant", - id: "pv70010", - price: { - __typename: "Money" as "Money", - amount: 5, - currency: "USD" - } - }, - { - __typename: "ProductVariant" as "ProductVariant", - id: "pv70010", - price: { - __typename: "Money" as "Money", - amount: 10, - currency: "USD" - } - } - ] + thumbnail: { __typename: "Image", url: placeholderImage } } }, { @@ -156,32 +158,34 @@ export const category: ( id: "UHJvZHVjdDoyMg==", isAvailable: true, name: "James, Martinez and Murray", + pricing: { + __typename: "ProductPricingInfo", + priceRangeUndiscounted: { + __typename: "TaxedMoneyRange", + start: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 3, + currency: "USD" + } + }, + stop: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 8, + currency: "USD" + } + } + } + }, productType: { __typename: "ProductType", id: "UHJvZHVjdFR5cGU6Mw==", name: "Coffee" }, - thumbnail: { __typename: "Image", url: placeholderImage }, - variants: [ - { - __typename: "ProductVariant" as "ProductVariant", - id: "pv70010", - price: { - __typename: "Money" as "Money", - amount: 5, - currency: "USD" - } - }, - { - __typename: "ProductVariant" as "ProductVariant", - id: "pv70010", - price: { - __typename: "Money" as "Money", - amount: 10, - currency: "USD" - } - } - ] + thumbnail: { __typename: "Image", url: placeholderImage } } }, { @@ -192,32 +196,34 @@ export const category: ( id: "UHJvZHVjdDoyMw==", isAvailable: true, name: "Curtis, Joyce and Turner", + pricing: { + __typename: "ProductPricingInfo", + priceRangeUndiscounted: { + __typename: "TaxedMoneyRange", + start: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 3, + currency: "USD" + } + }, + stop: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 8, + currency: "USD" + } + } + } + }, productType: { __typename: "ProductType", id: "UHJvZHVjdFR5cGU6Mw==", name: "Coffee" }, - thumbnail: { __typename: "Image", url: placeholderImage }, - variants: [ - { - __typename: "ProductVariant" as "ProductVariant", - id: "pv70010", - price: { - __typename: "Money" as "Money", - amount: 5, - currency: "USD" - } - }, - { - __typename: "ProductVariant" as "ProductVariant", - id: "pv70010", - price: { - __typename: "Money" as "Money", - amount: 10, - currency: "USD" - } - } - ] + thumbnail: { __typename: "Image", url: placeholderImage } } }, { @@ -228,32 +234,34 @@ export const category: ( id: "UHJvZHVjdDoyNA==", isAvailable: true, name: "Davis, Brown and Ray", + pricing: { + __typename: "ProductPricingInfo", + priceRangeUndiscounted: { + __typename: "TaxedMoneyRange", + start: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 3, + currency: "USD" + } + }, + stop: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 8, + currency: "USD" + } + } + } + }, productType: { __typename: "ProductType", id: "UHJvZHVjdFR5cGU6Mw==", name: "Coffee" }, - thumbnail: { __typename: "Image", url: placeholderImage }, - variants: [ - { - __typename: "ProductVariant" as "ProductVariant", - id: "pv70010", - price: { - __typename: "Money" as "Money", - amount: 5, - currency: "USD" - } - }, - { - __typename: "ProductVariant" as "ProductVariant", - id: "pv70010", - price: { - __typename: "Money" as "Money", - amount: 10, - currency: "USD" - } - } - ] + thumbnail: { __typename: "Image", url: placeholderImage } } }, { @@ -264,32 +272,34 @@ export const category: ( id: "UHJvZHVjdDoyNQ==", isAvailable: true, name: "Gallegos Ltd", + pricing: { + __typename: "ProductPricingInfo", + priceRangeUndiscounted: { + __typename: "TaxedMoneyRange", + start: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 3, + currency: "USD" + } + }, + stop: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 8, + currency: "USD" + } + } + } + }, productType: { __typename: "ProductType", id: "UHJvZHVjdFR5cGU6Mw==", name: "Coffee" }, - thumbnail: { __typename: "Image", url: placeholderImage }, - variants: [ - { - __typename: "ProductVariant" as "ProductVariant", - id: "pv70010", - price: { - __typename: "Money" as "Money", - amount: 5, - currency: "USD" - } - }, - { - __typename: "ProductVariant" as "ProductVariant", - id: "pv70010", - price: { - __typename: "Money" as "Money", - amount: 10, - currency: "USD" - } - } - ] + thumbnail: { __typename: "Image", url: placeholderImage } } }, { @@ -300,32 +310,34 @@ export const category: ( id: "UHJvZHVjdDoyNg==", isAvailable: true, name: "Franklin Inc", + pricing: { + __typename: "ProductPricingInfo", + priceRangeUndiscounted: { + __typename: "TaxedMoneyRange", + start: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 3, + currency: "USD" + } + }, + stop: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 8, + currency: "USD" + } + } + } + }, productType: { __typename: "ProductType", id: "UHJvZHVjdFR5cGU6Mw==", name: "Coffee" }, - thumbnail: { __typename: "Image", url: placeholderImage }, - variants: [ - { - __typename: "ProductVariant" as "ProductVariant", - id: "pv70010", - price: { - __typename: "Money" as "Money", - amount: 5, - currency: "USD" - } - }, - { - __typename: "ProductVariant" as "ProductVariant", - id: "pv70010", - price: { - __typename: "Money" as "Money", - amount: 10, - currency: "USD" - } - } - ] + thumbnail: { __typename: "Image", url: placeholderImage } } }, { @@ -336,32 +348,34 @@ export const category: ( id: "UHJvZHVjdDoyNw==", isAvailable: true, name: "Williams-Taylor", + pricing: { + __typename: "ProductPricingInfo", + priceRangeUndiscounted: { + __typename: "TaxedMoneyRange", + start: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 3, + currency: "USD" + } + }, + stop: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 8, + currency: "USD" + } + } + } + }, productType: { __typename: "ProductType", id: "UHJvZHVjdFR5cGU6Mw==", name: "Coffee" }, - thumbnail: { __typename: "Image", url: placeholderImage }, - variants: [ - { - __typename: "ProductVariant" as "ProductVariant", - id: "pv70010", - price: { - __typename: "Money" as "Money", - amount: 5, - currency: "USD" - } - }, - { - __typename: "ProductVariant" as "ProductVariant", - id: "pv70010", - price: { - __typename: "Money" as "Money", - amount: 10, - currency: "USD" - } - } - ] + thumbnail: { __typename: "Image", url: placeholderImage } } }, { @@ -372,32 +386,34 @@ export const category: ( id: "UHJvZHVjdDoyOA==", isAvailable: true, name: "Riddle, Evans and Hicks", + pricing: { + __typename: "ProductPricingInfo", + priceRangeUndiscounted: { + __typename: "TaxedMoneyRange", + start: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 3, + currency: "USD" + } + }, + stop: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 8, + currency: "USD" + } + } + } + }, productType: { __typename: "ProductType", id: "UHJvZHVjdFR5cGU6Mw==", name: "Coffee" }, - thumbnail: { __typename: "Image", url: placeholderImage }, - variants: [ - { - __typename: "ProductVariant" as "ProductVariant", - id: "pv70010", - price: { - __typename: "Money" as "Money", - amount: 5, - currency: "USD" - } - }, - { - __typename: "ProductVariant" as "ProductVariant", - id: "pv70010", - price: { - __typename: "Money" as "Money", - amount: 10, - currency: "USD" - } - } - ] + thumbnail: { __typename: "Image", url: placeholderImage } } }, { @@ -408,32 +424,34 @@ export const category: ( id: "UHJvZHVjdDoyOQ==", isAvailable: true, name: "Hebert-Sherman", + pricing: { + __typename: "ProductPricingInfo", + priceRangeUndiscounted: { + __typename: "TaxedMoneyRange", + start: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 3, + currency: "USD" + } + }, + stop: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 8, + currency: "USD" + } + } + } + }, productType: { __typename: "ProductType", id: "UHJvZHVjdFR5cGU6Mw==", name: "Coffee" }, - thumbnail: { __typename: "Image", url: placeholderImage }, - variants: [ - { - __typename: "ProductVariant" as "ProductVariant", - id: "pv70010", - price: { - __typename: "Money" as "Money", - amount: 5, - currency: "USD" - } - }, - { - __typename: "ProductVariant" as "ProductVariant", - id: "pv70010", - price: { - __typename: "Money" as "Money", - amount: 10, - currency: "USD" - } - } - ] + thumbnail: { __typename: "Image", url: placeholderImage } } }, { @@ -444,32 +462,34 @@ export const category: ( id: "UHJvZHVjdDozMA==", isAvailable: true, name: "Carter and Sons", + pricing: { + __typename: "ProductPricingInfo", + priceRangeUndiscounted: { + __typename: "TaxedMoneyRange", + start: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 3, + currency: "USD" + } + }, + stop: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 8, + currency: "USD" + } + } + } + }, productType: { __typename: "ProductType", id: "UHJvZHVjdFR5cGU6Mw==", name: "Coffee" }, - thumbnail: { __typename: "Image", url: placeholderImage }, - variants: [ - { - __typename: "ProductVariant" as "ProductVariant", - id: "pv70010", - price: { - __typename: "Money" as "Money", - amount: 5, - currency: "USD" - } - }, - { - __typename: "ProductVariant" as "ProductVariant", - id: "pv70010", - price: { - __typename: "Money" as "Money", - amount: 10, - currency: "USD" - } - } - ] + thumbnail: { __typename: "Image", url: placeholderImage } } } ], diff --git a/src/categories/queries.ts b/src/categories/queries.ts index 0d90be86e..ffa0feeee 100644 --- a/src/categories/queries.ts +++ b/src/categories/queries.ts @@ -8,6 +8,13 @@ import { } from "./types/CategoryDetails"; import { RootCategories } from "./types/RootCategories"; +export const fragmentMoney = gql` + fragment Money on Money { + amount + currency + } +`; + export const categoryFragment = gql` fragment CategoryFragment on Category { id @@ -73,6 +80,7 @@ export const useRootCategoriesQuery = makeQuery( ); export const categoryDetails = gql` + ${fragmentMoney} ${categoryFragment} ${categoryDetailsFragment} ${pageInfoFragment} @@ -112,11 +120,18 @@ export const categoryDetails = gql` id name } - variants { - id - price { - amount - currency + pricing { + priceRangeUndiscounted { + start { + gross { + ...Money + } + } + stop { + gross { + ...Money + } + } } } } diff --git a/src/categories/types/CategoryDetails.ts b/src/categories/types/CategoryDetails.ts index 43f1daf35..40c0869d9 100644 --- a/src/categories/types/CategoryDetails.ts +++ b/src/categories/types/CategoryDetails.ts @@ -73,16 +73,37 @@ export interface CategoryDetails_category_products_edges_node_productType { name: string; } -export interface CategoryDetails_category_products_edges_node_variants_price { +export interface CategoryDetails_category_products_edges_node_pricing_priceRangeUndiscounted_start_gross { __typename: "Money"; amount: number; currency: string; } -export interface CategoryDetails_category_products_edges_node_variants { - __typename: "ProductVariant"; - id: string; - price: CategoryDetails_category_products_edges_node_variants_price | null; +export interface CategoryDetails_category_products_edges_node_pricing_priceRangeUndiscounted_start { + __typename: "TaxedMoney"; + gross: CategoryDetails_category_products_edges_node_pricing_priceRangeUndiscounted_start_gross; +} + +export interface CategoryDetails_category_products_edges_node_pricing_priceRangeUndiscounted_stop_gross { + __typename: "Money"; + amount: number; + currency: string; +} + +export interface CategoryDetails_category_products_edges_node_pricing_priceRangeUndiscounted_stop { + __typename: "TaxedMoney"; + gross: CategoryDetails_category_products_edges_node_pricing_priceRangeUndiscounted_stop_gross; +} + +export interface CategoryDetails_category_products_edges_node_pricing_priceRangeUndiscounted { + __typename: "TaxedMoneyRange"; + start: CategoryDetails_category_products_edges_node_pricing_priceRangeUndiscounted_start | null; + stop: CategoryDetails_category_products_edges_node_pricing_priceRangeUndiscounted_stop | null; +} + +export interface CategoryDetails_category_products_edges_node_pricing { + __typename: "ProductPricingInfo"; + priceRangeUndiscounted: CategoryDetails_category_products_edges_node_pricing_priceRangeUndiscounted | null; } export interface CategoryDetails_category_products_edges_node { @@ -92,7 +113,7 @@ export interface CategoryDetails_category_products_edges_node { isAvailable: boolean | null; thumbnail: CategoryDetails_category_products_edges_node_thumbnail | null; productType: CategoryDetails_category_products_edges_node_productType; - variants: (CategoryDetails_category_products_edges_node_variants | null)[] | null; + pricing: CategoryDetails_category_products_edges_node_pricing | null; } export interface CategoryDetails_category_products_edges { diff --git a/src/products/components/ProductList/ProductList.tsx b/src/products/components/ProductList/ProductList.tsx index 23c81b913..a3649c39a 100644 --- a/src/products/components/ProductList/ProductList.tsx +++ b/src/products/components/ProductList/ProductList.tsx @@ -19,13 +19,12 @@ import { ProductListColumns } from "@saleor/config"; import { maybe, renderCollection } from "@saleor/misc"; import { getAttributeIdFromColumnValue, - getProductPriceRange, isAttributeColumnValue } from "@saleor/products/components/ProductListPage/utils"; import { AvailableInGridAttributes_grid_edges_node } from "@saleor/products/types/AvailableInGridAttributes"; import { ProductList_products_edges_node, - ProductList_products_edges_node_variants + ProductList_products_edges_node_pricing_priceRangeUndiscounted } from "@saleor/products/types/ProductList"; import { ProductListUrlSortField } from "@saleor/products/urls"; import { ListActions, ListProps, SortPage } from "@saleor/types"; @@ -139,21 +138,26 @@ export const ProductList: React.FC = props => { const numberOfColumns = 2 + settings.columns.length; const getProductPrice = ( - variants: ProductList_products_edges_node_variants[] + priceRangeUndiscounted: ProductList_products_edges_node_pricing_priceRangeUndiscounted ) => { - if (!variants.length) { + if (!priceRangeUndiscounted) { return null; } - const { max, min } = getProductPriceRange(variants); - const currency = variants[0].price.currency; + const { start, stop } = priceRangeUndiscounted; + const { + gross: { amount: startAmount } + } = start; + const { + gross: { amount: stopAmount } + } = stop; - if (max === min) { + if (startAmount === stopAmount) { return ( ); @@ -162,15 +166,15 @@ export const ProductList: React.FC = props => { <> {" - "} @@ -441,8 +445,10 @@ export const ProductList: React.FC = props => { displayColumns={settings.columns} > - {product?.variants ? ( - getProductPrice(product.variants) + {product?.pricing?.priceRangeUndiscounted ? ( + getProductPrice( + product?.pricing?.priceRangeUndiscounted + ) ) : ( )} diff --git a/src/products/components/ProductListPage/utils.ts b/src/products/components/ProductListPage/utils.ts index eeaf40224..2f0735182 100644 --- a/src/products/components/ProductListPage/utils.ts +++ b/src/products/components/ProductListPage/utils.ts @@ -1,5 +1,3 @@ -import { ProductList_products_edges_node_variants } from "@saleor/products/types/ProductList"; - const prefix = "attribute"; export function getAttributeColumnValue(id: string) { @@ -13,21 +11,3 @@ export function isAttributeColumnValue(value: string) { export function getAttributeIdFromColumnValue(value: string) { return value.substr(prefix.length + 1); } - -export function getProductPriceRange( - productVariants: ProductList_products_edges_node_variants[] -) { - let max = productVariants[0].price.amount; - let min = productVariants[0].price.amount; - - for (let i = 1, len = productVariants.length; i < len; i++) { - const curr = productVariants[i].price.amount; - max = curr > max ? curr : max; - min = curr < min ? curr : min; - } - - return { - max, - min - }; -} diff --git a/src/products/fixtures.ts b/src/products/fixtures.ts index 6cc5b351c..f9f6c161a 100644 --- a/src/products/fixtures.ts +++ b/src/products/fixtures.ts @@ -153,7 +153,7 @@ export const product: ( name: "Ergonomic Plastic Bacon", pricing: { __typename: "ProductPricingInfo", - priceRange: { + priceRangeUndiscounted: { __typename: "TaxedMoneyRange", start: { __typename: "TaxedMoney", @@ -322,6 +322,28 @@ export const products = ( isAvailable: true, isPublished: true, name: "Nebula Night Sky Paint", + pricing: { + __typename: "ProductPricingInfo", + priceRangeUndiscounted: { + __typename: "TaxedMoneyRange", + start: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 3, + currency: "USD" + } + }, + stop: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 8, + currency: "USD" + } + } + } + }, productType: { __typename: "ProductType", hasVariants: true, @@ -331,36 +353,7 @@ export const products = ( thumbnail: { __typename: "Image", url: placeholderImage - }, - variants: [ - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 15, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 35, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 49, - currency: "USD" - } - } - ] + } }, { __typename: "Product", @@ -369,6 +362,28 @@ export const products = ( isAvailable: true, isPublished: false, name: "Light Speed Yellow Paint", + pricing: { + __typename: "ProductPricingInfo", + priceRangeUndiscounted: { + __typename: "TaxedMoneyRange", + start: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 3, + currency: "USD" + } + }, + stop: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 8, + currency: "USD" + } + } + } + }, productType: { __typename: "ProductType", hasVariants: true, @@ -378,36 +393,7 @@ export const products = ( thumbnail: { __typename: "Image", url: placeholderImage - }, - variants: [ - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 15, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 30, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 49, - currency: "USD" - } - } - ] + } }, { __typename: "Product", @@ -416,6 +402,29 @@ export const products = ( isAvailable: true, isPublished: false, name: "Hyperspace Turquoise Paint", + + pricing: { + __typename: "ProductPricingInfo", + priceRangeUndiscounted: { + __typename: "TaxedMoneyRange", + start: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 3, + currency: "USD" + } + }, + stop: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 8, + currency: "USD" + } + } + } + }, productType: { __typename: "ProductType", hasVariants: true, @@ -425,36 +434,7 @@ export const products = ( thumbnail: { __typename: "Image", url: placeholderImage - }, - variants: [ - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 15, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 30, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 49, - currency: "USD" - } - } - ] + } }, { __typename: "Product", @@ -478,6 +458,29 @@ export const products = ( isAvailable: true, isPublished: true, name: "Pineapple Juice", + + pricing: { + __typename: "ProductPricingInfo", + priceRangeUndiscounted: { + __typename: "TaxedMoneyRange", + start: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 3, + currency: "USD" + } + }, + stop: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 8, + currency: "USD" + } + } + } + }, productType: { __typename: "ProductType", hasVariants: true, @@ -487,36 +490,7 @@ export const products = ( thumbnail: { __typename: "Image", url: placeholderImage - }, - variants: [ - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 3, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 7, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 5, - currency: "USD" - } - } - ] + } }, { __typename: "Product", @@ -540,6 +514,29 @@ export const products = ( isAvailable: true, isPublished: true, name: "Coconut Juice", + + pricing: { + __typename: "ProductPricingInfo", + priceRangeUndiscounted: { + __typename: "TaxedMoneyRange", + start: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 3, + currency: "USD" + } + }, + stop: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 8, + currency: "USD" + } + } + } + }, productType: { __typename: "ProductType", hasVariants: true, @@ -549,36 +546,7 @@ export const products = ( thumbnail: { __typename: "Image", url: placeholderImage - }, - variants: [ - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 3, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 5, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 7, - currency: "USD" - } - } - ] + } }, { __typename: "Product", @@ -602,6 +570,29 @@ export const products = ( isAvailable: true, isPublished: true, name: "Apple Juice", + + pricing: { + __typename: "ProductPricingInfo", + priceRangeUndiscounted: { + __typename: "TaxedMoneyRange", + start: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 3, + currency: "USD" + } + }, + stop: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 8, + currency: "USD" + } + } + } + }, productType: { __typename: "ProductType", hasVariants: true, @@ -611,36 +602,7 @@ export const products = ( thumbnail: { __typename: "Image", url: placeholderImage - }, - variants: [ - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 5, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 7, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 3, - currency: "USD" - } - } - ] + } }, { __typename: "Product", @@ -664,6 +626,29 @@ export const products = ( isAvailable: true, isPublished: true, name: "Orange Juice", + + pricing: { + __typename: "ProductPricingInfo", + priceRangeUndiscounted: { + __typename: "TaxedMoneyRange", + start: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 3, + currency: "USD" + } + }, + stop: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 8, + currency: "USD" + } + } + } + }, productType: { __typename: "ProductType", hasVariants: true, @@ -673,36 +658,7 @@ export const products = ( thumbnail: { __typename: "Image", url: placeholderImage - }, - variants: [ - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 5, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 7, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 3, - currency: "USD" - } - } - ] + } }, { __typename: "Product", @@ -726,6 +682,29 @@ export const products = ( isAvailable: true, isPublished: true, name: "Banana Juice", + + pricing: { + __typename: "ProductPricingInfo", + priceRangeUndiscounted: { + __typename: "TaxedMoneyRange", + start: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 3, + currency: "USD" + } + }, + stop: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 8, + currency: "USD" + } + } + } + }, productType: { __typename: "ProductType", hasVariants: true, @@ -735,36 +714,7 @@ export const products = ( thumbnail: { __typename: "Image", url: placeholderImage - }, - variants: [ - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 5, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 7, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 3, - currency: "USD" - } - } - ] + } }, { __typename: "Product", @@ -788,6 +738,29 @@ export const products = ( isAvailable: true, isPublished: false, name: "Bean Juice", + + pricing: { + __typename: "ProductPricingInfo", + priceRangeUndiscounted: { + __typename: "TaxedMoneyRange", + start: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 3, + currency: "USD" + } + }, + stop: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 8, + currency: "USD" + } + } + } + }, productType: { __typename: "ProductType", hasVariants: true, @@ -797,36 +770,7 @@ export const products = ( thumbnail: { __typename: "Image", url: placeholderImage - }, - variants: [ - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 7, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 3, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 5, - currency: "USD" - } - } - ] + } }, { __typename: "Product", @@ -850,6 +794,29 @@ export const products = ( isAvailable: true, isPublished: true, name: "Carrot Juice", + + pricing: { + __typename: "ProductPricingInfo", + priceRangeUndiscounted: { + __typename: "TaxedMoneyRange", + start: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 3, + currency: "USD" + } + }, + stop: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 8, + currency: "USD" + } + } + } + }, productType: { __typename: "ProductType", hasVariants: true, @@ -859,36 +826,7 @@ export const products = ( thumbnail: { __typename: "Image", url: placeholderImage - }, - variants: [ - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 5, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 7, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 3, - currency: "USD" - } - } - ] + } }, { __typename: "Product", @@ -912,6 +850,29 @@ export const products = ( isAvailable: true, isPublished: true, name: "Green Juice", + + pricing: { + __typename: "ProductPricingInfo", + priceRangeUndiscounted: { + __typename: "TaxedMoneyRange", + start: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 3, + currency: "USD" + } + }, + stop: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 8, + currency: "USD" + } + } + } + }, productType: { __typename: "ProductType", hasVariants: true, @@ -921,36 +882,7 @@ export const products = ( thumbnail: { __typename: "Image", url: placeholderImage - }, - variants: [ - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 5, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 7, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 3, - currency: "USD" - } - } - ] + } }, { __typename: "Product", @@ -974,6 +906,29 @@ export const products = ( isAvailable: true, isPublished: true, name: "Code Division T-shirt", + + pricing: { + __typename: "ProductPricingInfo", + priceRangeUndiscounted: { + __typename: "TaxedMoneyRange", + start: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 3, + currency: "USD" + } + }, + stop: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 8, + currency: "USD" + } + } + } + }, productType: { __typename: "ProductType", hasVariants: true, @@ -983,36 +938,7 @@ export const products = ( thumbnail: { __typename: "Image", url: placeholderImage - }, - variants: [ - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 5, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 7, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 3, - currency: "USD" - } - } - ] + } }, { __typename: "Product", @@ -1036,6 +962,29 @@ export const products = ( isAvailable: true, isPublished: true, name: "Polo Shirt", + + pricing: { + __typename: "ProductPricingInfo", + priceRangeUndiscounted: { + __typename: "TaxedMoneyRange", + start: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 3, + currency: "USD" + } + }, + stop: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 8, + currency: "USD" + } + } + } + }, productType: { __typename: "ProductType", hasVariants: true, @@ -1045,36 +994,7 @@ export const products = ( thumbnail: { __typename: "Image", url: placeholderImage - }, - variants: [ - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 5, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 7, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 3, - currency: "USD" - } - } - ] + } }, { __typename: "Product", @@ -1098,6 +1018,29 @@ export const products = ( isAvailable: true, isPublished: true, name: "Polo Shirt", + + pricing: { + __typename: "ProductPricingInfo", + priceRangeUndiscounted: { + __typename: "TaxedMoneyRange", + start: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 3, + currency: "USD" + } + }, + stop: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 8, + currency: "USD" + } + } + } + }, productType: { __typename: "ProductType", hasVariants: true, @@ -1107,36 +1050,7 @@ export const products = ( thumbnail: { __typename: "Image", url: placeholderImage - }, - variants: [ - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 5, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 7, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 3, - currency: "USD" - } - } - ] + } }, { __typename: "Product", @@ -1160,6 +1074,29 @@ export const products = ( isAvailable: true, isPublished: true, name: "Polo Shirt", + + pricing: { + __typename: "ProductPricingInfo", + priceRangeUndiscounted: { + __typename: "TaxedMoneyRange", + start: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 3, + currency: "USD" + } + }, + stop: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 8, + currency: "USD" + } + } + } + }, productType: { __typename: "ProductType", hasVariants: true, @@ -1169,36 +1106,7 @@ export const products = ( thumbnail: { __typename: "Image", url: placeholderImage - }, - variants: [ - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 5, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 7, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 3, - currency: "USD" - } - } - ] + } }, { __typename: "Product", @@ -1222,6 +1130,29 @@ export const products = ( isAvailable: true, isPublished: true, name: "Polo Shirt", + + pricing: { + __typename: "ProductPricingInfo", + priceRangeUndiscounted: { + __typename: "TaxedMoneyRange", + start: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 3, + currency: "USD" + } + }, + stop: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 8, + currency: "USD" + } + } + } + }, productType: { __typename: "ProductType", hasVariants: true, @@ -1231,36 +1162,7 @@ export const products = ( thumbnail: { __typename: "Image", url: placeholderImage - }, - variants: [ - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 5, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 7, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 3, - currency: "USD" - } - } - ] + } }, { __typename: "Product", @@ -1284,6 +1186,29 @@ export const products = ( isAvailable: true, isPublished: false, name: "Black Hoodie", + + pricing: { + __typename: "ProductPricingInfo", + priceRangeUndiscounted: { + __typename: "TaxedMoneyRange", + start: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 3, + currency: "USD" + } + }, + stop: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 8, + currency: "USD" + } + } + } + }, productType: { __typename: "ProductType", hasVariants: true, @@ -1293,36 +1218,7 @@ export const products = ( thumbnail: { __typename: "Image", url: placeholderImage - }, - variants: [ - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 5, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 7, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 3, - currency: "USD" - } - } - ] + } }, { __typename: "Product", @@ -1346,6 +1242,29 @@ export const products = ( isAvailable: true, isPublished: true, name: "Blue Hoodie", + + pricing: { + __typename: "ProductPricingInfo", + priceRangeUndiscounted: { + __typename: "TaxedMoneyRange", + start: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 3, + currency: "USD" + } + }, + stop: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 8, + currency: "USD" + } + } + } + }, productType: { __typename: "ProductType", hasVariants: true, @@ -1355,36 +1274,7 @@ export const products = ( thumbnail: { __typename: "Image", url: placeholderImage - }, - variants: [ - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 5, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 7, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 3, - currency: "USD" - } - } - ] + } }, { __typename: "Product", @@ -1408,6 +1298,29 @@ export const products = ( isAvailable: true, isPublished: true, name: "Mustard Hoodie", + + pricing: { + __typename: "ProductPricingInfo", + priceRangeUndiscounted: { + __typename: "TaxedMoneyRange", + start: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 3, + currency: "USD" + } + }, + stop: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 8, + currency: "USD" + } + } + } + }, productType: { __typename: "ProductType", hasVariants: true, @@ -1417,36 +1330,7 @@ export const products = ( thumbnail: { __typename: "Image", url: placeholderImage - }, - variants: [ - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 5, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 7, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 3, - currency: "USD" - } - } - ] + } }, { __typename: "Product", @@ -1470,6 +1354,29 @@ export const products = ( isAvailable: true, isPublished: false, name: "Colored Parrot Cushion", + + pricing: { + __typename: "ProductPricingInfo", + priceRangeUndiscounted: { + __typename: "TaxedMoneyRange", + start: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 3, + currency: "USD" + } + }, + stop: { + __typename: "TaxedMoney", + gross: { + __typename: "Money", + amount: 8, + currency: "USD" + } + } + } + }, productType: { __typename: "ProductType", hasVariants: true, @@ -1479,36 +1386,7 @@ export const products = ( thumbnail: { __typename: "Image", url: placeholderImage - }, - variants: [ - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 5, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 7, - currency: "USD" - } - }, - { - __typename: "ProductVariant", - id: "pv70010", - price: { - __typename: "Money", - amount: 3, - currency: "USD" - } - } - ] + } } ]; diff --git a/src/products/queries.ts b/src/products/queries.ts index a98bedbc3..ae361b59f 100644 --- a/src/products/queries.ts +++ b/src/products/queries.ts @@ -113,10 +113,18 @@ const productVariantAttributesFragment = gql` } } } - variants { - id - price { - ...Money + pricing { + priceRangeUndiscounted { + start { + gross { + ...Money + } + } + stop { + gross { + ...Money + } + } } } } @@ -158,14 +166,14 @@ export const productFragmentDetails = gql` chargeTaxes publicationDate pricing { - priceRange { + priceRangeUndiscounted { start { - net { + gross { ...Money } } stop { - net { + gross { ...Money } } @@ -339,10 +347,18 @@ const productListQuery = gql` name } } - variants { - id - price { - ...Money + pricing { + priceRangeUndiscounted { + start { + gross { + ...Money + } + } + stop { + gross { + ...Money + } + } } } } diff --git a/src/products/types/CreateMultipleVariantsData.ts b/src/products/types/CreateMultipleVariantsData.ts index 5654a5d23..ea2d1909f 100644 --- a/src/products/types/CreateMultipleVariantsData.ts +++ b/src/products/types/CreateMultipleVariantsData.ts @@ -58,16 +58,37 @@ export interface CreateMultipleVariantsData_product_productType { variantAttributes: (CreateMultipleVariantsData_product_productType_variantAttributes | null)[] | null; } -export interface CreateMultipleVariantsData_product_variants_price { +export interface CreateMultipleVariantsData_product_pricing_priceRangeUndiscounted_start_gross { __typename: "Money"; amount: number; currency: string; } -export interface CreateMultipleVariantsData_product_variants { - __typename: "ProductVariant"; - id: string; - price: CreateMultipleVariantsData_product_variants_price | null; +export interface CreateMultipleVariantsData_product_pricing_priceRangeUndiscounted_start { + __typename: "TaxedMoney"; + gross: CreateMultipleVariantsData_product_pricing_priceRangeUndiscounted_start_gross; +} + +export interface CreateMultipleVariantsData_product_pricing_priceRangeUndiscounted_stop_gross { + __typename: "Money"; + amount: number; + currency: string; +} + +export interface CreateMultipleVariantsData_product_pricing_priceRangeUndiscounted_stop { + __typename: "TaxedMoney"; + gross: CreateMultipleVariantsData_product_pricing_priceRangeUndiscounted_stop_gross; +} + +export interface CreateMultipleVariantsData_product_pricing_priceRangeUndiscounted { + __typename: "TaxedMoneyRange"; + start: CreateMultipleVariantsData_product_pricing_priceRangeUndiscounted_start | null; + stop: CreateMultipleVariantsData_product_pricing_priceRangeUndiscounted_stop | null; +} + +export interface CreateMultipleVariantsData_product_pricing { + __typename: "ProductPricingInfo"; + priceRangeUndiscounted: CreateMultipleVariantsData_product_pricing_priceRangeUndiscounted | null; } export interface CreateMultipleVariantsData_product { @@ -75,7 +96,7 @@ export interface CreateMultipleVariantsData_product { id: string; attributes: CreateMultipleVariantsData_product_attributes[]; productType: CreateMultipleVariantsData_product_productType; - variants: (CreateMultipleVariantsData_product_variants | null)[] | null; + pricing: CreateMultipleVariantsData_product_pricing | null; } export interface CreateMultipleVariantsData_warehouses_edges_node { diff --git a/src/products/types/Product.ts b/src/products/types/Product.ts index d1e6f806b..cf2a0e75d 100644 --- a/src/products/types/Product.ts +++ b/src/products/types/Product.ts @@ -60,35 +60,37 @@ export interface Product_productType { hasVariants: boolean; } -export interface Product_variants_price { +export interface Product_pricing_priceRangeUndiscounted_start_gross { __typename: "Money"; amount: number; currency: string; } -export interface Product_variants_stocks_warehouse { - __typename: "Warehouse"; - id: string; - name: string; +export interface Product_pricing_priceRangeUndiscounted_start { + __typename: "TaxedMoney"; + gross: Product_pricing_priceRangeUndiscounted_start_gross; } -export interface Product_variants_stocks { - __typename: "Stock"; - id: string; - quantity: number; - quantityAllocated: number; - warehouse: Product_variants_stocks_warehouse; +export interface Product_pricing_priceRangeUndiscounted_stop_gross { + __typename: "Money"; + amount: number; + currency: string; } -export interface Product_variants { - __typename: "ProductVariant"; - id: string; - price: Product_variants_price | null; - sku: string; - name: string; - margin: number | null; - stocks: (Product_variants_stocks | null)[] | null; - trackInventory: boolean; +export interface Product_pricing_priceRangeUndiscounted_stop { + __typename: "TaxedMoney"; + gross: Product_pricing_priceRangeUndiscounted_stop_gross; +} + +export interface Product_pricing_priceRangeUndiscounted { + __typename: "TaxedMoneyRange"; + start: Product_pricing_priceRangeUndiscounted_start | null; + stop: Product_pricing_priceRangeUndiscounted_stop | null; +} + +export interface Product_pricing { + __typename: "ProductPricingInfo"; + priceRangeUndiscounted: Product_pricing_priceRangeUndiscounted | null; } export interface Product_category { @@ -127,39 +129,6 @@ export interface Product_purchaseCost { stop: Product_purchaseCost_stop | null; } -export interface Product_pricing_priceRange_start_net { - __typename: "Money"; - amount: number; - currency: string; -} - -export interface Product_pricing_priceRange_start { - __typename: "TaxedMoney"; - net: Product_pricing_priceRange_start_net; -} - -export interface Product_pricing_priceRange_stop_net { - __typename: "Money"; - amount: number; - currency: string; -} - -export interface Product_pricing_priceRange_stop { - __typename: "TaxedMoney"; - net: Product_pricing_priceRange_stop_net; -} - -export interface Product_pricing_priceRange { - __typename: "TaxedMoneyRange"; - start: Product_pricing_priceRange_start | null; - stop: Product_pricing_priceRange_stop | null; -} - -export interface Product_pricing { - __typename: "ProductPricingInfo"; - priceRange: Product_pricing_priceRange | null; -} - export interface Product_images { __typename: "ProductImage"; id: string; @@ -168,12 +137,43 @@ export interface Product_images { url: string; } +export interface Product_variants_price { + __typename: "Money"; + amount: number; + currency: string; +} + +export interface Product_variants_stocks_warehouse { + __typename: "Warehouse"; + id: string; + name: string; +} + +export interface Product_variants_stocks { + __typename: "Stock"; + id: string; + quantity: number; + quantityAllocated: number; + warehouse: Product_variants_stocks_warehouse; +} + +export interface Product_variants { + __typename: "ProductVariant"; + id: string; + sku: string; + name: string; + price: Product_variants_price | null; + margin: number | null; + stocks: (Product_variants_stocks | null)[] | null; + trackInventory: boolean; +} + export interface Product { __typename: "Product"; id: string; attributes: Product_attributes[]; productType: Product_productType; - variants: (Product_variants | null)[] | null; + pricing: Product_pricing | null; name: string; descriptionJson: any; seoTitle: string | null; @@ -186,6 +186,6 @@ export interface Product { isPublished: boolean; chargeTaxes: boolean; publicationDate: any | null; - pricing: Product_pricing | null; images: (Product_images | null)[] | null; + variants: (Product_variants | null)[] | null; } diff --git a/src/products/types/ProductCreate.ts b/src/products/types/ProductCreate.ts index 9ec93107a..7c169bb7b 100644 --- a/src/products/types/ProductCreate.ts +++ b/src/products/types/ProductCreate.ts @@ -66,35 +66,37 @@ export interface ProductCreate_productCreate_product_productType { hasVariants: boolean; } -export interface ProductCreate_productCreate_product_variants_price { +export interface ProductCreate_productCreate_product_pricing_priceRangeUndiscounted_start_gross { __typename: "Money"; amount: number; currency: string; } -export interface ProductCreate_productCreate_product_variants_stocks_warehouse { - __typename: "Warehouse"; - id: string; - name: string; +export interface ProductCreate_productCreate_product_pricing_priceRangeUndiscounted_start { + __typename: "TaxedMoney"; + gross: ProductCreate_productCreate_product_pricing_priceRangeUndiscounted_start_gross; } -export interface ProductCreate_productCreate_product_variants_stocks { - __typename: "Stock"; - id: string; - quantity: number; - quantityAllocated: number; - warehouse: ProductCreate_productCreate_product_variants_stocks_warehouse; +export interface ProductCreate_productCreate_product_pricing_priceRangeUndiscounted_stop_gross { + __typename: "Money"; + amount: number; + currency: string; } -export interface ProductCreate_productCreate_product_variants { - __typename: "ProductVariant"; - id: string; - price: ProductCreate_productCreate_product_variants_price | null; - sku: string; - name: string; - margin: number | null; - stocks: (ProductCreate_productCreate_product_variants_stocks | null)[] | null; - trackInventory: boolean; +export interface ProductCreate_productCreate_product_pricing_priceRangeUndiscounted_stop { + __typename: "TaxedMoney"; + gross: ProductCreate_productCreate_product_pricing_priceRangeUndiscounted_stop_gross; +} + +export interface ProductCreate_productCreate_product_pricing_priceRangeUndiscounted { + __typename: "TaxedMoneyRange"; + start: ProductCreate_productCreate_product_pricing_priceRangeUndiscounted_start | null; + stop: ProductCreate_productCreate_product_pricing_priceRangeUndiscounted_stop | null; +} + +export interface ProductCreate_productCreate_product_pricing { + __typename: "ProductPricingInfo"; + priceRangeUndiscounted: ProductCreate_productCreate_product_pricing_priceRangeUndiscounted | null; } export interface ProductCreate_productCreate_product_category { @@ -133,39 +135,6 @@ export interface ProductCreate_productCreate_product_purchaseCost { stop: ProductCreate_productCreate_product_purchaseCost_stop | null; } -export interface ProductCreate_productCreate_product_pricing_priceRange_start_net { - __typename: "Money"; - amount: number; - currency: string; -} - -export interface ProductCreate_productCreate_product_pricing_priceRange_start { - __typename: "TaxedMoney"; - net: ProductCreate_productCreate_product_pricing_priceRange_start_net; -} - -export interface ProductCreate_productCreate_product_pricing_priceRange_stop_net { - __typename: "Money"; - amount: number; - currency: string; -} - -export interface ProductCreate_productCreate_product_pricing_priceRange_stop { - __typename: "TaxedMoney"; - net: ProductCreate_productCreate_product_pricing_priceRange_stop_net; -} - -export interface ProductCreate_productCreate_product_pricing_priceRange { - __typename: "TaxedMoneyRange"; - start: ProductCreate_productCreate_product_pricing_priceRange_start | null; - stop: ProductCreate_productCreate_product_pricing_priceRange_stop | null; -} - -export interface ProductCreate_productCreate_product_pricing { - __typename: "ProductPricingInfo"; - priceRange: ProductCreate_productCreate_product_pricing_priceRange | null; -} - export interface ProductCreate_productCreate_product_images { __typename: "ProductImage"; id: string; @@ -174,12 +143,43 @@ export interface ProductCreate_productCreate_product_images { url: string; } +export interface ProductCreate_productCreate_product_variants_price { + __typename: "Money"; + amount: number; + currency: string; +} + +export interface ProductCreate_productCreate_product_variants_stocks_warehouse { + __typename: "Warehouse"; + id: string; + name: string; +} + +export interface ProductCreate_productCreate_product_variants_stocks { + __typename: "Stock"; + id: string; + quantity: number; + quantityAllocated: number; + warehouse: ProductCreate_productCreate_product_variants_stocks_warehouse; +} + +export interface ProductCreate_productCreate_product_variants { + __typename: "ProductVariant"; + id: string; + sku: string; + name: string; + price: ProductCreate_productCreate_product_variants_price | null; + margin: number | null; + stocks: (ProductCreate_productCreate_product_variants_stocks | null)[] | null; + trackInventory: boolean; +} + export interface ProductCreate_productCreate_product { __typename: "Product"; id: string; attributes: ProductCreate_productCreate_product_attributes[]; productType: ProductCreate_productCreate_product_productType; - variants: (ProductCreate_productCreate_product_variants | null)[] | null; + pricing: ProductCreate_productCreate_product_pricing | null; name: string; descriptionJson: any; seoTitle: string | null; @@ -192,8 +192,8 @@ export interface ProductCreate_productCreate_product { isPublished: boolean; chargeTaxes: boolean; publicationDate: any | null; - pricing: ProductCreate_productCreate_product_pricing | null; images: (ProductCreate_productCreate_product_images | null)[] | null; + variants: (ProductCreate_productCreate_product_variants | null)[] | null; } export interface ProductCreate_productCreate { diff --git a/src/products/types/ProductDetails.ts b/src/products/types/ProductDetails.ts index 28469777d..6182eb1bf 100644 --- a/src/products/types/ProductDetails.ts +++ b/src/products/types/ProductDetails.ts @@ -60,35 +60,37 @@ export interface ProductDetails_product_productType { hasVariants: boolean; } -export interface ProductDetails_product_variants_price { +export interface ProductDetails_product_pricing_priceRangeUndiscounted_start_gross { __typename: "Money"; amount: number; currency: string; } -export interface ProductDetails_product_variants_stocks_warehouse { - __typename: "Warehouse"; - id: string; - name: string; +export interface ProductDetails_product_pricing_priceRangeUndiscounted_start { + __typename: "TaxedMoney"; + gross: ProductDetails_product_pricing_priceRangeUndiscounted_start_gross; } -export interface ProductDetails_product_variants_stocks { - __typename: "Stock"; - id: string; - quantity: number; - quantityAllocated: number; - warehouse: ProductDetails_product_variants_stocks_warehouse; +export interface ProductDetails_product_pricing_priceRangeUndiscounted_stop_gross { + __typename: "Money"; + amount: number; + currency: string; } -export interface ProductDetails_product_variants { - __typename: "ProductVariant"; - id: string; - price: ProductDetails_product_variants_price | null; - sku: string; - name: string; - margin: number | null; - stocks: (ProductDetails_product_variants_stocks | null)[] | null; - trackInventory: boolean; +export interface ProductDetails_product_pricing_priceRangeUndiscounted_stop { + __typename: "TaxedMoney"; + gross: ProductDetails_product_pricing_priceRangeUndiscounted_stop_gross; +} + +export interface ProductDetails_product_pricing_priceRangeUndiscounted { + __typename: "TaxedMoneyRange"; + start: ProductDetails_product_pricing_priceRangeUndiscounted_start | null; + stop: ProductDetails_product_pricing_priceRangeUndiscounted_stop | null; +} + +export interface ProductDetails_product_pricing { + __typename: "ProductPricingInfo"; + priceRangeUndiscounted: ProductDetails_product_pricing_priceRangeUndiscounted | null; } export interface ProductDetails_product_category { @@ -127,39 +129,6 @@ export interface ProductDetails_product_purchaseCost { stop: ProductDetails_product_purchaseCost_stop | null; } -export interface ProductDetails_product_pricing_priceRange_start_net { - __typename: "Money"; - amount: number; - currency: string; -} - -export interface ProductDetails_product_pricing_priceRange_start { - __typename: "TaxedMoney"; - net: ProductDetails_product_pricing_priceRange_start_net; -} - -export interface ProductDetails_product_pricing_priceRange_stop_net { - __typename: "Money"; - amount: number; - currency: string; -} - -export interface ProductDetails_product_pricing_priceRange_stop { - __typename: "TaxedMoney"; - net: ProductDetails_product_pricing_priceRange_stop_net; -} - -export interface ProductDetails_product_pricing_priceRange { - __typename: "TaxedMoneyRange"; - start: ProductDetails_product_pricing_priceRange_start | null; - stop: ProductDetails_product_pricing_priceRange_stop | null; -} - -export interface ProductDetails_product_pricing { - __typename: "ProductPricingInfo"; - priceRange: ProductDetails_product_pricing_priceRange | null; -} - export interface ProductDetails_product_images { __typename: "ProductImage"; id: string; @@ -168,12 +137,43 @@ export interface ProductDetails_product_images { url: string; } +export interface ProductDetails_product_variants_price { + __typename: "Money"; + amount: number; + currency: string; +} + +export interface ProductDetails_product_variants_stocks_warehouse { + __typename: "Warehouse"; + id: string; + name: string; +} + +export interface ProductDetails_product_variants_stocks { + __typename: "Stock"; + id: string; + quantity: number; + quantityAllocated: number; + warehouse: ProductDetails_product_variants_stocks_warehouse; +} + +export interface ProductDetails_product_variants { + __typename: "ProductVariant"; + id: string; + sku: string; + name: string; + price: ProductDetails_product_variants_price | null; + margin: number | null; + stocks: (ProductDetails_product_variants_stocks | null)[] | null; + trackInventory: boolean; +} + export interface ProductDetails_product { __typename: "Product"; id: string; attributes: ProductDetails_product_attributes[]; productType: ProductDetails_product_productType; - variants: (ProductDetails_product_variants | null)[] | null; + pricing: ProductDetails_product_pricing | null; name: string; descriptionJson: any; seoTitle: string | null; @@ -186,8 +186,8 @@ export interface ProductDetails_product { isPublished: boolean; chargeTaxes: boolean; publicationDate: any | null; - pricing: ProductDetails_product_pricing | null; images: (ProductDetails_product_images | null)[] | null; + variants: (ProductDetails_product_variants | null)[] | null; } export interface ProductDetails { diff --git a/src/products/types/ProductImageCreate.ts b/src/products/types/ProductImageCreate.ts index dcd9ecca8..5e9d14d45 100644 --- a/src/products/types/ProductImageCreate.ts +++ b/src/products/types/ProductImageCreate.ts @@ -66,35 +66,37 @@ export interface ProductImageCreate_productImageCreate_product_productType { hasVariants: boolean; } -export interface ProductImageCreate_productImageCreate_product_variants_price { +export interface ProductImageCreate_productImageCreate_product_pricing_priceRangeUndiscounted_start_gross { __typename: "Money"; amount: number; currency: string; } -export interface ProductImageCreate_productImageCreate_product_variants_stocks_warehouse { - __typename: "Warehouse"; - id: string; - name: string; +export interface ProductImageCreate_productImageCreate_product_pricing_priceRangeUndiscounted_start { + __typename: "TaxedMoney"; + gross: ProductImageCreate_productImageCreate_product_pricing_priceRangeUndiscounted_start_gross; } -export interface ProductImageCreate_productImageCreate_product_variants_stocks { - __typename: "Stock"; - id: string; - quantity: number; - quantityAllocated: number; - warehouse: ProductImageCreate_productImageCreate_product_variants_stocks_warehouse; +export interface ProductImageCreate_productImageCreate_product_pricing_priceRangeUndiscounted_stop_gross { + __typename: "Money"; + amount: number; + currency: string; } -export interface ProductImageCreate_productImageCreate_product_variants { - __typename: "ProductVariant"; - id: string; - price: ProductImageCreate_productImageCreate_product_variants_price | null; - sku: string; - name: string; - margin: number | null; - stocks: (ProductImageCreate_productImageCreate_product_variants_stocks | null)[] | null; - trackInventory: boolean; +export interface ProductImageCreate_productImageCreate_product_pricing_priceRangeUndiscounted_stop { + __typename: "TaxedMoney"; + gross: ProductImageCreate_productImageCreate_product_pricing_priceRangeUndiscounted_stop_gross; +} + +export interface ProductImageCreate_productImageCreate_product_pricing_priceRangeUndiscounted { + __typename: "TaxedMoneyRange"; + start: ProductImageCreate_productImageCreate_product_pricing_priceRangeUndiscounted_start | null; + stop: ProductImageCreate_productImageCreate_product_pricing_priceRangeUndiscounted_stop | null; +} + +export interface ProductImageCreate_productImageCreate_product_pricing { + __typename: "ProductPricingInfo"; + priceRangeUndiscounted: ProductImageCreate_productImageCreate_product_pricing_priceRangeUndiscounted | null; } export interface ProductImageCreate_productImageCreate_product_category { @@ -133,39 +135,6 @@ export interface ProductImageCreate_productImageCreate_product_purchaseCost { stop: ProductImageCreate_productImageCreate_product_purchaseCost_stop | null; } -export interface ProductImageCreate_productImageCreate_product_pricing_priceRange_start_net { - __typename: "Money"; - amount: number; - currency: string; -} - -export interface ProductImageCreate_productImageCreate_product_pricing_priceRange_start { - __typename: "TaxedMoney"; - net: ProductImageCreate_productImageCreate_product_pricing_priceRange_start_net; -} - -export interface ProductImageCreate_productImageCreate_product_pricing_priceRange_stop_net { - __typename: "Money"; - amount: number; - currency: string; -} - -export interface ProductImageCreate_productImageCreate_product_pricing_priceRange_stop { - __typename: "TaxedMoney"; - net: ProductImageCreate_productImageCreate_product_pricing_priceRange_stop_net; -} - -export interface ProductImageCreate_productImageCreate_product_pricing_priceRange { - __typename: "TaxedMoneyRange"; - start: ProductImageCreate_productImageCreate_product_pricing_priceRange_start | null; - stop: ProductImageCreate_productImageCreate_product_pricing_priceRange_stop | null; -} - -export interface ProductImageCreate_productImageCreate_product_pricing { - __typename: "ProductPricingInfo"; - priceRange: ProductImageCreate_productImageCreate_product_pricing_priceRange | null; -} - export interface ProductImageCreate_productImageCreate_product_images { __typename: "ProductImage"; id: string; @@ -174,12 +143,43 @@ export interface ProductImageCreate_productImageCreate_product_images { url: string; } +export interface ProductImageCreate_productImageCreate_product_variants_price { + __typename: "Money"; + amount: number; + currency: string; +} + +export interface ProductImageCreate_productImageCreate_product_variants_stocks_warehouse { + __typename: "Warehouse"; + id: string; + name: string; +} + +export interface ProductImageCreate_productImageCreate_product_variants_stocks { + __typename: "Stock"; + id: string; + quantity: number; + quantityAllocated: number; + warehouse: ProductImageCreate_productImageCreate_product_variants_stocks_warehouse; +} + +export interface ProductImageCreate_productImageCreate_product_variants { + __typename: "ProductVariant"; + id: string; + sku: string; + name: string; + price: ProductImageCreate_productImageCreate_product_variants_price | null; + margin: number | null; + stocks: (ProductImageCreate_productImageCreate_product_variants_stocks | null)[] | null; + trackInventory: boolean; +} + export interface ProductImageCreate_productImageCreate_product { __typename: "Product"; id: string; attributes: ProductImageCreate_productImageCreate_product_attributes[]; productType: ProductImageCreate_productImageCreate_product_productType; - variants: (ProductImageCreate_productImageCreate_product_variants | null)[] | null; + pricing: ProductImageCreate_productImageCreate_product_pricing | null; name: string; descriptionJson: any; seoTitle: string | null; @@ -192,8 +192,8 @@ export interface ProductImageCreate_productImageCreate_product { isPublished: boolean; chargeTaxes: boolean; publicationDate: any | null; - pricing: ProductImageCreate_productImageCreate_product_pricing | null; images: (ProductImageCreate_productImageCreate_product_images | null)[] | null; + variants: (ProductImageCreate_productImageCreate_product_variants | null)[] | null; } export interface ProductImageCreate_productImageCreate { diff --git a/src/products/types/ProductImageUpdate.ts b/src/products/types/ProductImageUpdate.ts index 7d5e39197..a21a344e0 100644 --- a/src/products/types/ProductImageUpdate.ts +++ b/src/products/types/ProductImageUpdate.ts @@ -66,35 +66,37 @@ export interface ProductImageUpdate_productImageUpdate_product_productType { hasVariants: boolean; } -export interface ProductImageUpdate_productImageUpdate_product_variants_price { +export interface ProductImageUpdate_productImageUpdate_product_pricing_priceRangeUndiscounted_start_gross { __typename: "Money"; amount: number; currency: string; } -export interface ProductImageUpdate_productImageUpdate_product_variants_stocks_warehouse { - __typename: "Warehouse"; - id: string; - name: string; +export interface ProductImageUpdate_productImageUpdate_product_pricing_priceRangeUndiscounted_start { + __typename: "TaxedMoney"; + gross: ProductImageUpdate_productImageUpdate_product_pricing_priceRangeUndiscounted_start_gross; } -export interface ProductImageUpdate_productImageUpdate_product_variants_stocks { - __typename: "Stock"; - id: string; - quantity: number; - quantityAllocated: number; - warehouse: ProductImageUpdate_productImageUpdate_product_variants_stocks_warehouse; +export interface ProductImageUpdate_productImageUpdate_product_pricing_priceRangeUndiscounted_stop_gross { + __typename: "Money"; + amount: number; + currency: string; } -export interface ProductImageUpdate_productImageUpdate_product_variants { - __typename: "ProductVariant"; - id: string; - price: ProductImageUpdate_productImageUpdate_product_variants_price | null; - sku: string; - name: string; - margin: number | null; - stocks: (ProductImageUpdate_productImageUpdate_product_variants_stocks | null)[] | null; - trackInventory: boolean; +export interface ProductImageUpdate_productImageUpdate_product_pricing_priceRangeUndiscounted_stop { + __typename: "TaxedMoney"; + gross: ProductImageUpdate_productImageUpdate_product_pricing_priceRangeUndiscounted_stop_gross; +} + +export interface ProductImageUpdate_productImageUpdate_product_pricing_priceRangeUndiscounted { + __typename: "TaxedMoneyRange"; + start: ProductImageUpdate_productImageUpdate_product_pricing_priceRangeUndiscounted_start | null; + stop: ProductImageUpdate_productImageUpdate_product_pricing_priceRangeUndiscounted_stop | null; +} + +export interface ProductImageUpdate_productImageUpdate_product_pricing { + __typename: "ProductPricingInfo"; + priceRangeUndiscounted: ProductImageUpdate_productImageUpdate_product_pricing_priceRangeUndiscounted | null; } export interface ProductImageUpdate_productImageUpdate_product_category { @@ -133,39 +135,6 @@ export interface ProductImageUpdate_productImageUpdate_product_purchaseCost { stop: ProductImageUpdate_productImageUpdate_product_purchaseCost_stop | null; } -export interface ProductImageUpdate_productImageUpdate_product_pricing_priceRange_start_net { - __typename: "Money"; - amount: number; - currency: string; -} - -export interface ProductImageUpdate_productImageUpdate_product_pricing_priceRange_start { - __typename: "TaxedMoney"; - net: ProductImageUpdate_productImageUpdate_product_pricing_priceRange_start_net; -} - -export interface ProductImageUpdate_productImageUpdate_product_pricing_priceRange_stop_net { - __typename: "Money"; - amount: number; - currency: string; -} - -export interface ProductImageUpdate_productImageUpdate_product_pricing_priceRange_stop { - __typename: "TaxedMoney"; - net: ProductImageUpdate_productImageUpdate_product_pricing_priceRange_stop_net; -} - -export interface ProductImageUpdate_productImageUpdate_product_pricing_priceRange { - __typename: "TaxedMoneyRange"; - start: ProductImageUpdate_productImageUpdate_product_pricing_priceRange_start | null; - stop: ProductImageUpdate_productImageUpdate_product_pricing_priceRange_stop | null; -} - -export interface ProductImageUpdate_productImageUpdate_product_pricing { - __typename: "ProductPricingInfo"; - priceRange: ProductImageUpdate_productImageUpdate_product_pricing_priceRange | null; -} - export interface ProductImageUpdate_productImageUpdate_product_images { __typename: "ProductImage"; id: string; @@ -174,12 +143,43 @@ export interface ProductImageUpdate_productImageUpdate_product_images { url: string; } +export interface ProductImageUpdate_productImageUpdate_product_variants_price { + __typename: "Money"; + amount: number; + currency: string; +} + +export interface ProductImageUpdate_productImageUpdate_product_variants_stocks_warehouse { + __typename: "Warehouse"; + id: string; + name: string; +} + +export interface ProductImageUpdate_productImageUpdate_product_variants_stocks { + __typename: "Stock"; + id: string; + quantity: number; + quantityAllocated: number; + warehouse: ProductImageUpdate_productImageUpdate_product_variants_stocks_warehouse; +} + +export interface ProductImageUpdate_productImageUpdate_product_variants { + __typename: "ProductVariant"; + id: string; + sku: string; + name: string; + price: ProductImageUpdate_productImageUpdate_product_variants_price | null; + margin: number | null; + stocks: (ProductImageUpdate_productImageUpdate_product_variants_stocks | null)[] | null; + trackInventory: boolean; +} + export interface ProductImageUpdate_productImageUpdate_product { __typename: "Product"; id: string; attributes: ProductImageUpdate_productImageUpdate_product_attributes[]; productType: ProductImageUpdate_productImageUpdate_product_productType; - variants: (ProductImageUpdate_productImageUpdate_product_variants | null)[] | null; + pricing: ProductImageUpdate_productImageUpdate_product_pricing | null; name: string; descriptionJson: any; seoTitle: string | null; @@ -192,8 +192,8 @@ export interface ProductImageUpdate_productImageUpdate_product { isPublished: boolean; chargeTaxes: boolean; publicationDate: any | null; - pricing: ProductImageUpdate_productImageUpdate_product_pricing | null; images: (ProductImageUpdate_productImageUpdate_product_images | null)[] | null; + variants: (ProductImageUpdate_productImageUpdate_product_variants | null)[] | null; } export interface ProductImageUpdate_productImageUpdate { diff --git a/src/products/types/ProductList.ts b/src/products/types/ProductList.ts index 002a38712..78ec749fb 100644 --- a/src/products/types/ProductList.ts +++ b/src/products/types/ProductList.ts @@ -37,16 +37,37 @@ export interface ProductList_products_edges_node_attributes { values: (ProductList_products_edges_node_attributes_values | null)[]; } -export interface ProductList_products_edges_node_variants_price { +export interface ProductList_products_edges_node_pricing_priceRangeUndiscounted_start_gross { __typename: "Money"; amount: number; currency: string; } -export interface ProductList_products_edges_node_variants { - __typename: "ProductVariant"; - id: string; - price: ProductList_products_edges_node_variants_price | null; +export interface ProductList_products_edges_node_pricing_priceRangeUndiscounted_start { + __typename: "TaxedMoney"; + gross: ProductList_products_edges_node_pricing_priceRangeUndiscounted_start_gross; +} + +export interface ProductList_products_edges_node_pricing_priceRangeUndiscounted_stop_gross { + __typename: "Money"; + amount: number; + currency: string; +} + +export interface ProductList_products_edges_node_pricing_priceRangeUndiscounted_stop { + __typename: "TaxedMoney"; + gross: ProductList_products_edges_node_pricing_priceRangeUndiscounted_stop_gross; +} + +export interface ProductList_products_edges_node_pricing_priceRangeUndiscounted { + __typename: "TaxedMoneyRange"; + start: ProductList_products_edges_node_pricing_priceRangeUndiscounted_start | null; + stop: ProductList_products_edges_node_pricing_priceRangeUndiscounted_stop | null; +} + +export interface ProductList_products_edges_node_pricing { + __typename: "ProductPricingInfo"; + priceRangeUndiscounted: ProductList_products_edges_node_pricing_priceRangeUndiscounted | null; } export interface ProductList_products_edges_node { @@ -58,7 +79,7 @@ export interface ProductList_products_edges_node { isPublished: boolean; productType: ProductList_products_edges_node_productType; attributes: ProductList_products_edges_node_attributes[]; - variants: (ProductList_products_edges_node_variants | null)[] | null; + pricing: ProductList_products_edges_node_pricing | null; } export interface ProductList_products_edges { diff --git a/src/products/types/ProductUpdate.ts b/src/products/types/ProductUpdate.ts index 0bf0f7184..b8667ff60 100644 --- a/src/products/types/ProductUpdate.ts +++ b/src/products/types/ProductUpdate.ts @@ -66,35 +66,37 @@ export interface ProductUpdate_productUpdate_product_productType { hasVariants: boolean; } -export interface ProductUpdate_productUpdate_product_variants_price { +export interface ProductUpdate_productUpdate_product_pricing_priceRangeUndiscounted_start_gross { __typename: "Money"; amount: number; currency: string; } -export interface ProductUpdate_productUpdate_product_variants_stocks_warehouse { - __typename: "Warehouse"; - id: string; - name: string; +export interface ProductUpdate_productUpdate_product_pricing_priceRangeUndiscounted_start { + __typename: "TaxedMoney"; + gross: ProductUpdate_productUpdate_product_pricing_priceRangeUndiscounted_start_gross; } -export interface ProductUpdate_productUpdate_product_variants_stocks { - __typename: "Stock"; - id: string; - quantity: number; - quantityAllocated: number; - warehouse: ProductUpdate_productUpdate_product_variants_stocks_warehouse; +export interface ProductUpdate_productUpdate_product_pricing_priceRangeUndiscounted_stop_gross { + __typename: "Money"; + amount: number; + currency: string; } -export interface ProductUpdate_productUpdate_product_variants { - __typename: "ProductVariant"; - id: string; - price: ProductUpdate_productUpdate_product_variants_price | null; - sku: string; - name: string; - margin: number | null; - stocks: (ProductUpdate_productUpdate_product_variants_stocks | null)[] | null; - trackInventory: boolean; +export interface ProductUpdate_productUpdate_product_pricing_priceRangeUndiscounted_stop { + __typename: "TaxedMoney"; + gross: ProductUpdate_productUpdate_product_pricing_priceRangeUndiscounted_stop_gross; +} + +export interface ProductUpdate_productUpdate_product_pricing_priceRangeUndiscounted { + __typename: "TaxedMoneyRange"; + start: ProductUpdate_productUpdate_product_pricing_priceRangeUndiscounted_start | null; + stop: ProductUpdate_productUpdate_product_pricing_priceRangeUndiscounted_stop | null; +} + +export interface ProductUpdate_productUpdate_product_pricing { + __typename: "ProductPricingInfo"; + priceRangeUndiscounted: ProductUpdate_productUpdate_product_pricing_priceRangeUndiscounted | null; } export interface ProductUpdate_productUpdate_product_category { @@ -133,39 +135,6 @@ export interface ProductUpdate_productUpdate_product_purchaseCost { stop: ProductUpdate_productUpdate_product_purchaseCost_stop | null; } -export interface ProductUpdate_productUpdate_product_pricing_priceRange_start_net { - __typename: "Money"; - amount: number; - currency: string; -} - -export interface ProductUpdate_productUpdate_product_pricing_priceRange_start { - __typename: "TaxedMoney"; - net: ProductUpdate_productUpdate_product_pricing_priceRange_start_net; -} - -export interface ProductUpdate_productUpdate_product_pricing_priceRange_stop_net { - __typename: "Money"; - amount: number; - currency: string; -} - -export interface ProductUpdate_productUpdate_product_pricing_priceRange_stop { - __typename: "TaxedMoney"; - net: ProductUpdate_productUpdate_product_pricing_priceRange_stop_net; -} - -export interface ProductUpdate_productUpdate_product_pricing_priceRange { - __typename: "TaxedMoneyRange"; - start: ProductUpdate_productUpdate_product_pricing_priceRange_start | null; - stop: ProductUpdate_productUpdate_product_pricing_priceRange_stop | null; -} - -export interface ProductUpdate_productUpdate_product_pricing { - __typename: "ProductPricingInfo"; - priceRange: ProductUpdate_productUpdate_product_pricing_priceRange | null; -} - export interface ProductUpdate_productUpdate_product_images { __typename: "ProductImage"; id: string; @@ -174,12 +143,43 @@ export interface ProductUpdate_productUpdate_product_images { url: string; } +export interface ProductUpdate_productUpdate_product_variants_price { + __typename: "Money"; + amount: number; + currency: string; +} + +export interface ProductUpdate_productUpdate_product_variants_stocks_warehouse { + __typename: "Warehouse"; + id: string; + name: string; +} + +export interface ProductUpdate_productUpdate_product_variants_stocks { + __typename: "Stock"; + id: string; + quantity: number; + quantityAllocated: number; + warehouse: ProductUpdate_productUpdate_product_variants_stocks_warehouse; +} + +export interface ProductUpdate_productUpdate_product_variants { + __typename: "ProductVariant"; + id: string; + sku: string; + name: string; + price: ProductUpdate_productUpdate_product_variants_price | null; + margin: number | null; + stocks: (ProductUpdate_productUpdate_product_variants_stocks | null)[] | null; + trackInventory: boolean; +} + export interface ProductUpdate_productUpdate_product { __typename: "Product"; id: string; attributes: ProductUpdate_productUpdate_product_attributes[]; productType: ProductUpdate_productUpdate_product_productType; - variants: (ProductUpdate_productUpdate_product_variants | null)[] | null; + pricing: ProductUpdate_productUpdate_product_pricing | null; name: string; descriptionJson: any; seoTitle: string | null; @@ -192,8 +192,8 @@ export interface ProductUpdate_productUpdate_product { isPublished: boolean; chargeTaxes: boolean; publicationDate: any | null; - pricing: ProductUpdate_productUpdate_product_pricing | null; images: (ProductUpdate_productUpdate_product_images | null)[] | null; + variants: (ProductUpdate_productUpdate_product_variants | null)[] | null; } export interface ProductUpdate_productUpdate { diff --git a/src/products/types/ProductVariantAttributesFragment.ts b/src/products/types/ProductVariantAttributesFragment.ts index 334fa66fd..0349fd386 100644 --- a/src/products/types/ProductVariantAttributesFragment.ts +++ b/src/products/types/ProductVariantAttributesFragment.ts @@ -58,16 +58,37 @@ export interface ProductVariantAttributesFragment_productType { variantAttributes: (ProductVariantAttributesFragment_productType_variantAttributes | null)[] | null; } -export interface ProductVariantAttributesFragment_variants_price { +export interface ProductVariantAttributesFragment_pricing_priceRangeUndiscounted_start_gross { __typename: "Money"; amount: number; currency: string; } -export interface ProductVariantAttributesFragment_variants { - __typename: "ProductVariant"; - id: string; - price: ProductVariantAttributesFragment_variants_price | null; +export interface ProductVariantAttributesFragment_pricing_priceRangeUndiscounted_start { + __typename: "TaxedMoney"; + gross: ProductVariantAttributesFragment_pricing_priceRangeUndiscounted_start_gross; +} + +export interface ProductVariantAttributesFragment_pricing_priceRangeUndiscounted_stop_gross { + __typename: "Money"; + amount: number; + currency: string; +} + +export interface ProductVariantAttributesFragment_pricing_priceRangeUndiscounted_stop { + __typename: "TaxedMoney"; + gross: ProductVariantAttributesFragment_pricing_priceRangeUndiscounted_stop_gross; +} + +export interface ProductVariantAttributesFragment_pricing_priceRangeUndiscounted { + __typename: "TaxedMoneyRange"; + start: ProductVariantAttributesFragment_pricing_priceRangeUndiscounted_start | null; + stop: ProductVariantAttributesFragment_pricing_priceRangeUndiscounted_stop | null; +} + +export interface ProductVariantAttributesFragment_pricing { + __typename: "ProductPricingInfo"; + priceRangeUndiscounted: ProductVariantAttributesFragment_pricing_priceRangeUndiscounted | null; } export interface ProductVariantAttributesFragment { @@ -75,5 +96,5 @@ export interface ProductVariantAttributesFragment { id: string; attributes: ProductVariantAttributesFragment_attributes[]; productType: ProductVariantAttributesFragment_productType; - variants: (ProductVariantAttributesFragment_variants | null)[] | null; + pricing: ProductVariantAttributesFragment_pricing | null; } diff --git a/src/products/types/SimpleProductUpdate.ts b/src/products/types/SimpleProductUpdate.ts index b745c08f9..c0f7f7aef 100644 --- a/src/products/types/SimpleProductUpdate.ts +++ b/src/products/types/SimpleProductUpdate.ts @@ -66,35 +66,37 @@ export interface SimpleProductUpdate_productUpdate_product_productType { hasVariants: boolean; } -export interface SimpleProductUpdate_productUpdate_product_variants_price { +export interface SimpleProductUpdate_productUpdate_product_pricing_priceRangeUndiscounted_start_gross { __typename: "Money"; amount: number; currency: string; } -export interface SimpleProductUpdate_productUpdate_product_variants_stocks_warehouse { - __typename: "Warehouse"; - id: string; - name: string; +export interface SimpleProductUpdate_productUpdate_product_pricing_priceRangeUndiscounted_start { + __typename: "TaxedMoney"; + gross: SimpleProductUpdate_productUpdate_product_pricing_priceRangeUndiscounted_start_gross; } -export interface SimpleProductUpdate_productUpdate_product_variants_stocks { - __typename: "Stock"; - id: string; - quantity: number; - quantityAllocated: number; - warehouse: SimpleProductUpdate_productUpdate_product_variants_stocks_warehouse; +export interface SimpleProductUpdate_productUpdate_product_pricing_priceRangeUndiscounted_stop_gross { + __typename: "Money"; + amount: number; + currency: string; } -export interface SimpleProductUpdate_productUpdate_product_variants { - __typename: "ProductVariant"; - id: string; - price: SimpleProductUpdate_productUpdate_product_variants_price | null; - sku: string; - name: string; - margin: number | null; - stocks: (SimpleProductUpdate_productUpdate_product_variants_stocks | null)[] | null; - trackInventory: boolean; +export interface SimpleProductUpdate_productUpdate_product_pricing_priceRangeUndiscounted_stop { + __typename: "TaxedMoney"; + gross: SimpleProductUpdate_productUpdate_product_pricing_priceRangeUndiscounted_stop_gross; +} + +export interface SimpleProductUpdate_productUpdate_product_pricing_priceRangeUndiscounted { + __typename: "TaxedMoneyRange"; + start: SimpleProductUpdate_productUpdate_product_pricing_priceRangeUndiscounted_start | null; + stop: SimpleProductUpdate_productUpdate_product_pricing_priceRangeUndiscounted_stop | null; +} + +export interface SimpleProductUpdate_productUpdate_product_pricing { + __typename: "ProductPricingInfo"; + priceRangeUndiscounted: SimpleProductUpdate_productUpdate_product_pricing_priceRangeUndiscounted | null; } export interface SimpleProductUpdate_productUpdate_product_category { @@ -133,39 +135,6 @@ export interface SimpleProductUpdate_productUpdate_product_purchaseCost { stop: SimpleProductUpdate_productUpdate_product_purchaseCost_stop | null; } -export interface SimpleProductUpdate_productUpdate_product_pricing_priceRange_start_net { - __typename: "Money"; - amount: number; - currency: string; -} - -export interface SimpleProductUpdate_productUpdate_product_pricing_priceRange_start { - __typename: "TaxedMoney"; - net: SimpleProductUpdate_productUpdate_product_pricing_priceRange_start_net; -} - -export interface SimpleProductUpdate_productUpdate_product_pricing_priceRange_stop_net { - __typename: "Money"; - amount: number; - currency: string; -} - -export interface SimpleProductUpdate_productUpdate_product_pricing_priceRange_stop { - __typename: "TaxedMoney"; - net: SimpleProductUpdate_productUpdate_product_pricing_priceRange_stop_net; -} - -export interface SimpleProductUpdate_productUpdate_product_pricing_priceRange { - __typename: "TaxedMoneyRange"; - start: SimpleProductUpdate_productUpdate_product_pricing_priceRange_start | null; - stop: SimpleProductUpdate_productUpdate_product_pricing_priceRange_stop | null; -} - -export interface SimpleProductUpdate_productUpdate_product_pricing { - __typename: "ProductPricingInfo"; - priceRange: SimpleProductUpdate_productUpdate_product_pricing_priceRange | null; -} - export interface SimpleProductUpdate_productUpdate_product_images { __typename: "ProductImage"; id: string; @@ -174,12 +143,43 @@ export interface SimpleProductUpdate_productUpdate_product_images { url: string; } +export interface SimpleProductUpdate_productUpdate_product_variants_price { + __typename: "Money"; + amount: number; + currency: string; +} + +export interface SimpleProductUpdate_productUpdate_product_variants_stocks_warehouse { + __typename: "Warehouse"; + id: string; + name: string; +} + +export interface SimpleProductUpdate_productUpdate_product_variants_stocks { + __typename: "Stock"; + id: string; + quantity: number; + quantityAllocated: number; + warehouse: SimpleProductUpdate_productUpdate_product_variants_stocks_warehouse; +} + +export interface SimpleProductUpdate_productUpdate_product_variants { + __typename: "ProductVariant"; + id: string; + sku: string; + name: string; + price: SimpleProductUpdate_productUpdate_product_variants_price | null; + margin: number | null; + stocks: (SimpleProductUpdate_productUpdate_product_variants_stocks | null)[] | null; + trackInventory: boolean; +} + export interface SimpleProductUpdate_productUpdate_product { __typename: "Product"; id: string; attributes: SimpleProductUpdate_productUpdate_product_attributes[]; productType: SimpleProductUpdate_productUpdate_product_productType; - variants: (SimpleProductUpdate_productUpdate_product_variants | null)[] | null; + pricing: SimpleProductUpdate_productUpdate_product_pricing | null; name: string; descriptionJson: any; seoTitle: string | null; @@ -192,8 +192,8 @@ export interface SimpleProductUpdate_productUpdate_product { isPublished: boolean; chargeTaxes: boolean; publicationDate: any | null; - pricing: SimpleProductUpdate_productUpdate_product_pricing | null; images: (SimpleProductUpdate_productUpdate_product_images | null)[] | null; + variants: (SimpleProductUpdate_productUpdate_product_variants | null)[] | null; } export interface SimpleProductUpdate_productUpdate { diff --git a/src/products/views/ProductVariantCreator/ProductVariantCreator.tsx b/src/products/views/ProductVariantCreator/ProductVariantCreator.tsx index 807631002..cfff9a11c 100644 --- a/src/products/views/ProductVariantCreator/ProductVariantCreator.tsx +++ b/src/products/views/ProductVariantCreator/ProductVariantCreator.tsx @@ -51,7 +51,7 @@ const ProductVariantCreator: React.FC = ({ })} /> - $5.00 - $10.00 + $3.00 - $8.00 - $5.00 - $10.00 + $3.00 - $8.00 - $5.00 - $10.00 + $3.00 - $8.00 - $5.00 - $10.00 + $3.00 - $8.00 - $5.00 - $10.00 + $3.00 - $8.00 - $5.00 - $10.00 + $3.00 - $8.00 - $5.00 - $10.00 + $3.00 - $8.00 - $5.00 - $10.00 + $3.00 - $8.00 - $5.00 - $10.00 + $3.00 - $8.00 - $5.00 - $10.00 + $3.00 - $8.00 @@ -124314,7 +124314,7 @@ exports[`Storyshots Views / Products / Product list default 1`] = ` - $15.00 - $49.00 + $3.00 - $8.00 - $15.00 - $49.00 + $3.00 - $8.00 - $15.00 - $49.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 @@ -127129,7 +127129,7 @@ exports[`Storyshots Views / Products / Product list not published 1`] = ` - $15.00 - $49.00 + $3.00 - $8.00 - $15.00 - $49.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 @@ -127910,7 +127910,7 @@ exports[`Storyshots Views / Products / Product list published 1`] = ` - $15.00 - $49.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00 - $3.00 - $7.00 + $3.00 - $8.00