saleor-dashboard/src/products/fixtures.ts

1787 lines
37 KiB
TypeScript
Raw Normal View History

2019-08-09 11:14:35 +00:00
import { AttributeInputTypeEnum } from "@saleor/types/globalTypes";
2020-02-11 15:32:47 +00:00
import { warehouseList } from "@saleor/warehouses/fixtures";
2019-06-19 14:40:52 +00:00
import { content } from "../storybook/stories/components/RichTextEditor";
import { ProductDetails_product } from "./types/ProductDetails";
import { ProductList_products_edges_node } from "./types/ProductList";
2019-06-19 14:40:52 +00:00
import { ProductVariant } from "./types/ProductVariant";
import { ProductVariantCreateData_product } from "./types/ProductVariantCreateData";
export const product: (
placeholderImage: string
) => ProductDetails_product &
ProductVariantCreateData_product = placeholderImage => ({
2019-08-09 11:14:35 +00:00
__typename: "Product" as "Product",
2019-06-19 14:40:52 +00:00
attributes: [
{
__typename: "SelectedAttribute",
attribute: {
2019-08-09 11:14:35 +00:00
__typename: "Attribute" as "Attribute",
2019-06-19 14:40:52 +00:00
id: "pta18161",
2019-08-09 11:14:35 +00:00
inputType: AttributeInputTypeEnum.DROPDOWN,
2019-06-19 14:40:52 +00:00
name: "Borders",
slug: "Borders",
2019-08-09 11:14:35 +00:00
valueRequired: true,
2019-06-19 14:40:52 +00:00
values: [
{
__typename: "AttributeValue",
id: "ptav47282",
name: "portals",
2019-08-09 11:14:35 +00:00
slug: "portals"
2019-06-19 14:40:52 +00:00
},
{
__typename: "AttributeValue",
id: "ptav17253",
name: "Baht",
2019-08-09 11:14:35 +00:00
slug: "Baht"
2019-06-19 14:40:52 +00:00
}
]
},
2019-08-09 11:14:35 +00:00
values: [
{
__typename: "AttributeValue",
id: "ptav47282",
name: "portals",
slug: "portals"
}
]
2019-06-19 14:40:52 +00:00
},
{
__typename: "SelectedAttribute",
attribute: {
2019-08-09 11:14:35 +00:00
__typename: "Attribute" as "Attribute",
2019-06-19 14:40:52 +00:00
id: "pta22785",
2019-08-09 11:14:35 +00:00
inputType: AttributeInputTypeEnum.MULTISELECT,
2019-06-19 14:40:52 +00:00
name: "Legacy",
slug: "Legacy",
2019-08-09 11:14:35 +00:00
valueRequired: true,
2019-06-19 14:40:52 +00:00
values: [
{
__typename: "AttributeValue",
id: "ptav31282",
name: "payment",
2019-08-09 11:14:35 +00:00
slug: "payment"
2019-06-19 14:40:52 +00:00
},
{
__typename: "AttributeValue",
id: "ptav14907",
name: "Auto Loan Account",
2019-08-09 11:14:35 +00:00
slug: "Auto-Loan-Account"
2019-06-19 14:40:52 +00:00
},
{
__typename: "AttributeValue",
id: "ptav27366",
name: "Garden",
2019-08-09 11:14:35 +00:00
slug: "Garden"
2019-06-19 14:40:52 +00:00
},
{
__typename: "AttributeValue",
id: "ptav11873",
name: "override",
2019-08-09 11:14:35 +00:00
slug: "override"
2019-06-19 14:40:52 +00:00
}
]
},
2019-08-09 11:14:35 +00:00
values: [
{
__typename: "AttributeValue",
id: "ptav14907",
name: "Auto Loan Account",
slug: "Auto-Loan-Account"
}
]
2019-06-19 14:40:52 +00:00
}
],
basePrice: {
__typename: "Money" as "Money",
2019-06-19 14:40:52 +00:00
amount: 339.39,
currency: "NZD",
localized: "339.39 NZD"
},
category: { __typename: "Category", id: "Q2F0ZWdvcnk6MQ==", name: "Apparel" },
chargeTaxes: true,
collections: [
{
__typename: "Collection",
id: "Q29sbGVjdGlvbjoy",
name: "Winter sale"
}
],
descriptionJson: JSON.stringify(content),
id: "p10171",
images: [
{
__typename: "ProductImage",
alt: "Id sit dolores adipisci",
id: "UHJvZHVjdEltYWdlOjE=",
sortOrder: 0,
url: placeholderImage
},
{
__typename: "ProductImage",
alt: "Id sit dolores adipisci",
id: "UHJvZHVjdEltYWdlOaE=",
sortOrder: 2,
url: placeholderImage
},
{
__typename: "ProductImage",
alt: "Id sit dolores adipisci",
id: "UPJvZHVjdEltYWdlOjV=",
sortOrder: 1,
url: placeholderImage
},
{
__typename: "ProductImage",
alt: "Id sit dolores adipisci",
id: "UHJvZHVjdEltYHdlOjX=",
sortOrder: 3,
url: placeholderImage
},
{
__typename: "ProductImage",
alt: "Id sit dolores adipisci",
id: "UHJvZHVjdIlnYWdlOjX=",
sortOrder: 4,
url: placeholderImage
}
],
isAvailable: false,
isFeatured: false,
isPublished: true,
margin: { __typename: "Margin", start: 2, stop: 7 },
name: "Ergonomic Plastic Bacon",
pricing: {
__typename: "ProductPricingInfo",
priceRange: {
__typename: "TaxedMoneyRange",
start: {
__typename: "TaxedMoney",
gross: {
__typename: "Money",
amount: 12.3,
currency: "USD"
},
net: {
__typename: "Money",
amount: 10,
currency: "USD"
}
},
stop: {
__typename: "TaxedMoney",
gross: {
__typename: "Money",
amount: 24.6,
currency: "USD"
},
net: {
__typename: "Money",
amount: 20,
currency: "USD"
}
}
}
},
productType: {
__typename: "ProductType",
hasVariants: true,
id: "pt76406",
name: "Versatile",
seoDescription: "Omnis rerum ea. Fugit dignissimos modi est rerum",
seoTitle: "Ergonomic Plastic Bacon",
variantAttributes: [
{
__typename: "Attribute",
id: "pta18161",
name: "Color",
slug: "color",
sortOrder: 0,
2019-08-09 11:14:35 +00:00
valueRequired: true,
2019-06-19 14:40:52 +00:00
values: [
{
__typename: "AttributeValue",
id: "ptvav47282",
name: "Black",
slug: "black",
sortOrder: 0
},
{
__typename: "AttributeValue",
id: "ptvav17253",
name: "White",
slug: "white",
sortOrder: 1
}
]
}
]
},
publicationDate: "2018-08-25T18:45:54.125Z",
purchaseCost: {
__typename: "MoneyRange",
start: {
__typename: "Money",
amount: 339.39,
currency: "NZD",
localized: "339.39 NZD"
},
stop: {
__typename: "Money",
amount: 678.78,
currency: "NZD",
localized: "678.78 NZD"
}
},
seoDescription: "Seo description",
seoTitle: "Seo title",
sku: "59661-34207",
2019-08-09 11:14:35 +00:00
thumbnail: { __typename: "Image" as "Image", url: placeholderImage },
2019-06-19 14:40:52 +00:00
url: "/example-url",
variants: [
{
__typename: "ProductVariant",
id: "pv75934",
images: [
{
__typename: "ProductImage",
id: "pi92837",
url: placeholderImage
},
{
__typename: "ProductImage",
id: "pi92838",
url: placeholderImage
}
],
margin: 2,
name: "Cordoba Oro",
2020-06-12 11:19:44 +00:00
price: {
2019-06-19 14:40:52 +00:00
__typename: "Money",
amount: 678.78,
currency: "USD"
},
sku: "87192-94370",
stocks: [
2020-02-11 15:32:47 +00:00
{
__typename: "Stock",
id: "1",
quantity: 1,
quantityAllocated: 0,
2020-02-11 15:32:47 +00:00
warehouse: warehouseList[0]
},
{
__typename: "Stock",
id: "2",
quantity: 4,
quantityAllocated: 2,
2020-02-11 15:32:47 +00:00
warehouse: warehouseList[1]
}
],
trackInventory: true
2019-06-19 14:40:52 +00:00
},
{
__typename: "ProductVariant",
id: "pv68615",
images: [
{
__typename: "ProductImage",
id: "pi81234",
url: placeholderImage
},
{
__typename: "ProductImage",
id: "pi1236912",
url: placeholderImage
}
],
margin: 7,
name: "silver",
2020-06-12 11:19:44 +00:00
price: null,
2019-06-19 14:40:52 +00:00
sku: "69055-15190",
stocks: [
2020-02-11 15:32:47 +00:00
{
__typename: "Stock",
id: "1",
quantity: 13,
quantityAllocated: 2,
2020-02-11 15:32:47 +00:00
warehouse: warehouseList[0]
}
],
trackInventory: false
2019-06-19 14:40:52 +00:00
}
]
});
export const products = (
placeholderImage: string
): ProductList_products_edges_node[] => [
{
__typename: "Product",
attributes: [],
id: "UHJvZHVjdDo2MQ==",
isAvailable: true,
isPublished: true,
name: "Nebula Night Sky Paint",
productType: {
__typename: "ProductType",
2020-06-16 10:48:57 +00:00
hasVariants: true,
id: "UHJvZHVjdFR5cGU6Nw==",
name: "Paint"
},
thumbnail: {
__typename: "Image",
url: placeholderImage
2020-06-12 14:44:35 +00:00
},
variants: [
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 15,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 35,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 49,
currency: "USD"
}
}
]
},
{
__typename: "Product",
attributes: [],
id: "UHJvZHVjdDo2NA==",
isAvailable: true,
isPublished: false,
name: "Light Speed Yellow Paint",
productType: {
__typename: "ProductType",
2020-06-16 10:48:57 +00:00
hasVariants: true,
id: "UHJvZHVjdFR5cGU6Nw==",
name: "Paint"
},
thumbnail: {
__typename: "Image",
url: placeholderImage
2020-06-12 14:44:35 +00:00
},
variants: [
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 15,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 30,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 49,
currency: "USD"
}
}
]
},
2019-06-19 14:40:52 +00:00
{
__typename: "Product",
attributes: [],
id: "UHJvZHVjdDo2NQ==",
isAvailable: true,
isPublished: false,
name: "Hyperspace Turquoise Paint",
productType: {
__typename: "ProductType",
2020-06-16 10:48:57 +00:00
hasVariants: true,
id: "UHJvZHVjdFR5cGU6Nw==",
name: "Paint"
},
thumbnail: {
__typename: "Image",
url: placeholderImage
2020-06-12 14:44:35 +00:00
},
variants: [
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 15,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 30,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 49,
currency: "USD"
}
}
]
},
{
__typename: "Product",
2019-06-19 14:40:52 +00:00
attributes: [
{
__typename: "SelectedAttribute",
2019-06-19 14:40:52 +00:00
attribute: {
__typename: "Attribute",
id: "QXR0cmlidXRlOjE2"
2019-06-19 14:40:52 +00:00
},
values: [
{
__typename: "AttributeValue",
id: "QXR0cmlidXRlVmFsdWU6MQ==",
name: "Pineapple"
}
]
2019-06-19 14:40:52 +00:00
}
],
id: "UHJvZHVjdDo3NQ==",
2019-06-19 14:40:52 +00:00
isAvailable: true,
isPublished: true,
name: "Pineapple Juice",
2019-06-19 14:40:52 +00:00
productType: {
__typename: "ProductType",
2020-06-16 10:48:57 +00:00
hasVariants: true,
id: "UHJvZHVjdFR5cGU6OQ==",
name: "Juice"
2019-06-19 14:40:52 +00:00
},
thumbnail: {
__typename: "Image",
url: placeholderImage
2020-06-12 14:44:35 +00:00
},
variants: [
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 3,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 7,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 5,
currency: "USD"
}
}
]
2019-06-19 14:40:52 +00:00
},
{
__typename: "Product",
2019-06-19 14:40:52 +00:00
attributes: [
{
__typename: "SelectedAttribute",
2019-06-19 14:40:52 +00:00
attribute: {
__typename: "Attribute",
id: "QXR0cmlidXRlOjE2"
2019-06-19 14:40:52 +00:00
},
values: [
{
__typename: "AttributeValue",
id: "QXR0cmlidXRlVmFsdWU6Mg==",
name: "Coconut"
}
]
2019-06-19 14:40:52 +00:00
}
],
id: "UHJvZHVjdDo3Ng==",
2019-06-19 14:40:52 +00:00
isAvailable: true,
isPublished: true,
name: "Coconut Juice",
productType: {
__typename: "ProductType",
2020-06-16 10:48:57 +00:00
hasVariants: true,
id: "UHJvZHVjdFR5cGU6OQ==",
name: "Juice"
2019-06-19 14:40:52 +00:00
},
thumbnail: {
__typename: "Image",
url: placeholderImage
2020-06-12 14:44:35 +00:00
},
variants: [
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 3,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 5,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 7,
currency: "USD"
}
}
]
2019-06-19 14:40:52 +00:00
},
{
__typename: "Product",
2019-06-19 14:40:52 +00:00
attributes: [
{
__typename: "SelectedAttribute",
2019-06-19 14:40:52 +00:00
attribute: {
__typename: "Attribute",
id: "QXR0cmlidXRlOjE2"
2019-06-19 14:40:52 +00:00
},
values: [
{
__typename: "AttributeValue",
id: "QXR0cmlidXRlVmFsdWU6Mw==",
name: "Apple"
}
]
2019-06-19 14:40:52 +00:00
}
],
id: "UHJvZHVjdDo3Mg==",
isAvailable: true,
isPublished: true,
name: "Apple Juice",
productType: {
__typename: "ProductType",
2020-06-16 10:48:57 +00:00
hasVariants: true,
id: "UHJvZHVjdFR5cGU6OQ==",
name: "Juice"
2019-06-19 14:40:52 +00:00
},
thumbnail: {
__typename: "Image",
url: placeholderImage
2020-06-12 14:44:35 +00:00
},
variants: [
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 5,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 7,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 3,
currency: "USD"
}
}
]
2019-06-19 14:40:52 +00:00
},
{
__typename: "Product",
2019-06-19 14:40:52 +00:00
attributes: [
{
__typename: "SelectedAttribute",
2019-06-19 14:40:52 +00:00
attribute: {
__typename: "Attribute",
id: "QXR0cmlidXRlOjE2"
2019-06-19 14:40:52 +00:00
},
values: [
{
__typename: "AttributeValue",
id: "QXR0cmlidXRlVmFsdWU6NDk=",
name: "Orange"
}
]
2019-06-19 14:40:52 +00:00
}
],
id: "UHJvZHVjdDo3MQ==",
isAvailable: true,
isPublished: true,
name: "Orange Juice",
productType: {
__typename: "ProductType",
2020-06-16 10:48:57 +00:00
hasVariants: true,
id: "UHJvZHVjdFR5cGU6OQ==",
name: "Juice"
2019-06-19 14:40:52 +00:00
},
thumbnail: {
__typename: "Image",
url: placeholderImage
2020-06-12 14:44:35 +00:00
},
variants: [
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 5,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 7,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 3,
currency: "USD"
}
}
]
2019-06-19 14:40:52 +00:00
},
{
__typename: "Product",
2019-06-19 14:40:52 +00:00
attributes: [
{
__typename: "SelectedAttribute",
2019-06-19 14:40:52 +00:00
attribute: {
__typename: "Attribute",
id: "QXR0cmlidXRlOjE2"
2019-06-19 14:40:52 +00:00
},
values: [
{
__typename: "AttributeValue",
id: "QXR0cmlidXRlVmFsdWU6NTA=",
name: "Banana"
}
]
}
],
id: "UHJvZHVjdDo3NA==",
isAvailable: true,
isPublished: true,
name: "Banana Juice",
productType: {
__typename: "ProductType",
2020-06-16 10:48:57 +00:00
hasVariants: true,
id: "UHJvZHVjdFR5cGU6OQ==",
name: "Juice"
},
thumbnail: {
__typename: "Image",
url: placeholderImage
2020-06-12 14:44:35 +00:00
},
variants: [
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 5,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 7,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 3,
currency: "USD"
}
}
]
},
{
__typename: "Product",
attributes: [
2019-06-19 14:40:52 +00:00
{
__typename: "SelectedAttribute",
2019-06-19 14:40:52 +00:00
attribute: {
__typename: "Attribute",
id: "QXR0cmlidXRlOjE2"
2019-06-19 14:40:52 +00:00
},
values: [
{
__typename: "AttributeValue",
id: "QXR0cmlidXRlVmFsdWU6NTE=",
name: "Bean"
}
]
}
],
id: "UHJvZHVjdDo3OQ==",
isAvailable: true,
isPublished: false,
name: "Bean Juice",
productType: {
__typename: "ProductType",
2020-06-16 10:48:57 +00:00
hasVariants: true,
id: "UHJvZHVjdFR5cGU6OQ==",
name: "Juice"
},
thumbnail: {
__typename: "Image",
url: placeholderImage
2020-06-12 14:44:35 +00:00
},
variants: [
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 7,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 3,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 5,
currency: "USD"
}
}
]
},
{
__typename: "Product",
attributes: [
2019-06-19 14:40:52 +00:00
{
__typename: "SelectedAttribute",
2019-06-19 14:40:52 +00:00
attribute: {
__typename: "Attribute",
id: "QXR0cmlidXRlOjE2"
2019-06-19 14:40:52 +00:00
},
values: [
{
__typename: "AttributeValue",
id: "QXR0cmlidXRlVmFsdWU6NTI=",
name: "Carrot"
}
]
}
],
id: "UHJvZHVjdDo3Mw==",
isAvailable: true,
isPublished: true,
name: "Carrot Juice",
productType: {
__typename: "ProductType",
2020-06-16 10:48:57 +00:00
hasVariants: true,
id: "UHJvZHVjdFR5cGU6OQ==",
name: "Juice"
},
thumbnail: {
__typename: "Image",
url: placeholderImage
2020-06-12 14:44:35 +00:00
},
variants: [
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 5,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 7,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 3,
currency: "USD"
}
}
]
},
{
__typename: "Product",
attributes: [
2019-06-19 14:40:52 +00:00
{
__typename: "SelectedAttribute",
2019-06-19 14:40:52 +00:00
attribute: {
__typename: "Attribute",
id: "QXR0cmlidXRlOjE2"
2019-06-19 14:40:52 +00:00
},
values: [
{
__typename: "AttributeValue",
id: "QXR0cmlidXRlVmFsdWU6NTM=",
name: "Sprouty"
}
]
2019-06-19 14:40:52 +00:00
}
],
id: "UHJvZHVjdDo3OA==",
2019-06-19 14:40:52 +00:00
isAvailable: true,
isPublished: true,
name: "Green Juice",
productType: {
__typename: "ProductType",
2020-06-16 10:48:57 +00:00
hasVariants: true,
id: "UHJvZHVjdFR5cGU6OQ==",
name: "Juice"
2019-06-19 14:40:52 +00:00
},
thumbnail: {
__typename: "Image",
url: placeholderImage
2020-06-12 14:44:35 +00:00
},
variants: [
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 5,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 7,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 3,
currency: "USD"
}
}
]
},
{
__typename: "Product",
attributes: [
{
__typename: "SelectedAttribute",
attribute: {
__typename: "Attribute",
id: "QXR0cmlidXRlOjI1"
2019-06-19 14:40:52 +00:00
},
values: [
{
__typename: "AttributeValue",
id: "QXR0cmlidXRlVmFsdWU6ODI=",
name: "Cotton"
2019-06-19 14:40:52 +00:00
}
]
}
],
id: "UHJvZHVjdDo4OQ==",
isAvailable: true,
isPublished: true,
name: "Code Division T-shirt",
productType: {
__typename: "ProductType",
2020-06-16 10:48:57 +00:00
hasVariants: true,
id: "UHJvZHVjdFR5cGU6MTQ=",
name: "Top (clothing)"
},
thumbnail: {
__typename: "Image",
url: placeholderImage
2020-06-12 14:44:35 +00:00
},
variants: [
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 5,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 7,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 3,
currency: "USD"
}
}
]
2019-06-19 14:40:52 +00:00
},
{
__typename: "Product",
2019-06-19 14:40:52 +00:00
attributes: [
{
__typename: "SelectedAttribute",
2019-06-19 14:40:52 +00:00
attribute: {
__typename: "Attribute",
id: "QXR0cmlidXRlOjI1"
2019-06-19 14:40:52 +00:00
},
values: [
{
__typename: "AttributeValue",
id: "QXR0cmlidXRlVmFsdWU6ODI=",
name: "Cotton"
}
]
2019-06-19 14:40:52 +00:00
}
],
id: "UHJvZHVjdDoxMDc=",
isAvailable: true,
isPublished: true,
name: "Polo Shirt",
productType: {
__typename: "ProductType",
2020-06-16 10:48:57 +00:00
hasVariants: true,
id: "UHJvZHVjdFR5cGU6MTQ=",
name: "Top (clothing)"
2019-06-19 14:40:52 +00:00
},
thumbnail: {
__typename: "Image",
url: placeholderImage
2020-06-12 14:44:35 +00:00
},
variants: [
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 5,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 7,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 3,
currency: "USD"
}
}
]
2019-06-19 14:40:52 +00:00
},
{
__typename: "Product",
2019-06-19 14:40:52 +00:00
attributes: [
{
__typename: "SelectedAttribute",
2019-06-19 14:40:52 +00:00
attribute: {
__typename: "Attribute",
id: "QXR0cmlidXRlOjI1"
2019-06-19 14:40:52 +00:00
},
values: [
{
__typename: "AttributeValue",
id: "QXR0cmlidXRlVmFsdWU6ODI=",
name: "Cotton"
}
]
2019-06-19 14:40:52 +00:00
}
],
id: "UHJvZHVjdDoxMDg=",
isAvailable: true,
isPublished: true,
name: "Polo Shirt",
productType: {
__typename: "ProductType",
2020-06-16 10:48:57 +00:00
hasVariants: true,
id: "UHJvZHVjdFR5cGU6MTQ=",
name: "Top (clothing)"
2019-06-19 14:40:52 +00:00
},
thumbnail: {
__typename: "Image",
url: placeholderImage
2020-06-12 14:44:35 +00:00
},
variants: [
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 5,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 7,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 3,
currency: "USD"
}
}
]
2019-06-19 14:40:52 +00:00
},
{
__typename: "Product",
2019-06-19 14:40:52 +00:00
attributes: [
{
__typename: "SelectedAttribute",
2019-06-19 14:40:52 +00:00
attribute: {
__typename: "Attribute",
id: "QXR0cmlidXRlOjI1"
2019-06-19 14:40:52 +00:00
},
values: [
{
__typename: "AttributeValue",
id: "QXR0cmlidXRlVmFsdWU6ODI=",
name: "Cotton"
}
]
2019-06-19 14:40:52 +00:00
}
],
id: "UHJvZHVjdDoxMDk=",
isAvailable: true,
isPublished: true,
name: "Polo Shirt",
productType: {
__typename: "ProductType",
2020-06-16 10:48:57 +00:00
hasVariants: true,
id: "UHJvZHVjdFR5cGU6MTQ=",
name: "Top (clothing)"
2019-06-19 14:40:52 +00:00
},
thumbnail: {
__typename: "Image",
url: placeholderImage
2020-06-12 14:44:35 +00:00
},
variants: [
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 5,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 7,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 3,
currency: "USD"
}
}
]
2019-06-19 14:40:52 +00:00
},
{
__typename: "Product",
2019-06-19 14:40:52 +00:00
attributes: [
{
__typename: "SelectedAttribute",
2019-06-19 14:40:52 +00:00
attribute: {
__typename: "Attribute",
id: "QXR0cmlidXRlOjI1"
2019-06-19 14:40:52 +00:00
},
values: [
{
__typename: "AttributeValue",
id: "QXR0cmlidXRlVmFsdWU6ODI=",
name: "Cotton"
}
]
}
],
id: "UHJvZHVjdDoxMTA=",
isAvailable: true,
isPublished: true,
name: "Polo Shirt",
productType: {
__typename: "ProductType",
2020-06-16 10:48:57 +00:00
hasVariants: true,
id: "UHJvZHVjdFR5cGU6MTQ=",
name: "Top (clothing)"
},
thumbnail: {
__typename: "Image",
url: placeholderImage
2020-06-12 14:44:35 +00:00
},
variants: [
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 5,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 7,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 3,
currency: "USD"
}
}
]
},
{
__typename: "Product",
attributes: [
2019-06-19 14:40:52 +00:00
{
__typename: "SelectedAttribute",
2019-06-19 14:40:52 +00:00
attribute: {
__typename: "Attribute",
id: "QXR0cmlidXRlOjI1"
2019-06-19 14:40:52 +00:00
},
values: [
{
__typename: "AttributeValue",
id: "QXR0cmlidXRlVmFsdWU6ODI=",
name: "Cotton"
}
]
}
],
id: "UHJvZHVjdDoxMTU=",
isAvailable: true,
isPublished: false,
name: "Black Hoodie",
productType: {
__typename: "ProductType",
2020-06-16 10:48:57 +00:00
hasVariants: true,
id: "UHJvZHVjdFR5cGU6MTQ=",
name: "Top (clothing)"
},
thumbnail: {
__typename: "Image",
url: placeholderImage
2020-06-12 14:44:35 +00:00
},
variants: [
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 5,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 7,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 3,
currency: "USD"
}
}
]
},
{
__typename: "Product",
attributes: [
2019-06-19 14:40:52 +00:00
{
__typename: "SelectedAttribute",
2019-06-19 14:40:52 +00:00
attribute: {
__typename: "Attribute",
id: "QXR0cmlidXRlOjI1"
2019-06-19 14:40:52 +00:00
},
values: [
{
__typename: "AttributeValue",
id: "QXR0cmlidXRlVmFsdWU6ODI=",
name: "Cotton"
}
]
}
],
id: "UHJvZHVjdDoxMTY=",
isAvailable: true,
isPublished: true,
name: "Blue Hoodie",
productType: {
__typename: "ProductType",
2020-06-16 10:48:57 +00:00
hasVariants: true,
id: "UHJvZHVjdFR5cGU6MTQ=",
name: "Top (clothing)"
},
thumbnail: {
__typename: "Image",
url: placeholderImage
2020-06-12 14:44:35 +00:00
},
variants: [
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 5,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 7,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 3,
currency: "USD"
}
}
]
},
{
__typename: "Product",
attributes: [
2019-06-19 14:40:52 +00:00
{
__typename: "SelectedAttribute",
2019-06-19 14:40:52 +00:00
attribute: {
__typename: "Attribute",
id: "QXR0cmlidXRlOjI1"
2019-06-19 14:40:52 +00:00
},
values: [
{
__typename: "AttributeValue",
id: "QXR0cmlidXRlVmFsdWU6ODI=",
name: "Cotton"
}
]
2019-06-19 14:40:52 +00:00
}
],
id: "UHJvZHVjdDoxMTc=",
2019-06-19 14:40:52 +00:00
isAvailable: true,
isPublished: true,
name: "Mustard Hoodie",
productType: {
__typename: "ProductType",
2020-06-16 10:48:57 +00:00
hasVariants: true,
id: "UHJvZHVjdFR5cGU6MTQ=",
name: "Top (clothing)"
2019-06-19 14:40:52 +00:00
},
thumbnail: {
__typename: "Image",
url: placeholderImage
2020-06-12 14:44:35 +00:00
},
variants: [
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 5,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 7,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 3,
currency: "USD"
}
}
]
2019-06-19 14:40:52 +00:00
},
{
__typename: "Product",
2019-06-19 14:40:52 +00:00
attributes: [
{
__typename: "SelectedAttribute",
2019-06-19 14:40:52 +00:00
attribute: {
__typename: "Attribute",
id: "QXR0cmlidXRlOjIz"
2019-06-19 14:40:52 +00:00
},
values: [
{
__typename: "AttributeValue",
id: "QXR0cmlidXRlVmFsdWU6NzI=",
name: "Cotton"
}
]
2019-06-19 14:40:52 +00:00
}
],
id: "UHJvZHVjdDo4NQ==",
isAvailable: true,
isPublished: false,
name: "Colored Parrot Cushion",
productType: {
__typename: "ProductType",
2020-06-16 10:48:57 +00:00
hasVariants: true,
id: "UHJvZHVjdFR5cGU6MTI=",
name: "Cushion"
2019-06-19 14:40:52 +00:00
},
thumbnail: {
__typename: "Image",
url: placeholderImage
2020-06-12 14:44:35 +00:00
},
variants: [
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 5,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 7,
currency: "USD"
}
},
{
__typename: "ProductVariant",
2020-06-17 08:31:33 +00:00
id: "pv70010",
2020-06-12 14:44:35 +00:00
price: {
__typename: "Money",
amount: 3,
currency: "USD"
}
}
]
2019-06-19 14:40:52 +00:00
}
];
2019-06-19 14:40:52 +00:00
export const variant = (placeholderImage: string): ProductVariant => ({
__typename: "ProductVariant",
attributes: [
{
__typename: "SelectedAttribute",
attribute: {
2019-08-09 11:14:35 +00:00
__typename: "Attribute" as "Attribute",
2019-06-19 14:40:52 +00:00
id: "pta18161",
name: "Borders",
slug: "Borders",
2019-08-09 11:14:35 +00:00
valueRequired: true,
2019-06-19 14:40:52 +00:00
values: [
{
__typename: "AttributeValue",
id: "ptav47282",
name: "portals",
slug: "portals"
},
{
__typename: "AttributeValue",
id: "ptav17253",
name: "Baht",
slug: "Baht"
}
]
},
2020-01-09 11:13:24 +00:00
values: [
{
__typename: "AttributeValue",
id: "ptav47282",
name: "portals",
slug: "portals"
}
]
2019-06-19 14:40:52 +00:00
},
{
__typename: "SelectedAttribute",
attribute: {
2019-08-09 11:14:35 +00:00
__typename: "Attribute" as "Attribute",
2019-06-19 14:40:52 +00:00
id: "pta22785",
name: "Legacy",
slug: "Legacy",
2019-08-09 11:14:35 +00:00
valueRequired: true,
2019-06-19 14:40:52 +00:00
values: [
{
__typename: "AttributeValue",
id: "ptav31282",
name: "payment",
slug: "payment"
},
{
__typename: "AttributeValue",
id: "ptav14907",
name: "Auto Loan Account",
slug: "Auto-Loan-Account"
},
{
__typename: "AttributeValue",
id: "ptav27366",
name: "Garden",
slug: "Garden"
},
{
__typename: "AttributeValue",
id: "ptav11873",
name: "override",
slug: "override"
}
]
},
2020-01-09 11:13:24 +00:00
values: [
{
__typename: "AttributeValue",
id: "ptav14907",
name: "Auto Loan Account",
slug: "Auto-Loan-Account"
}
]
2019-06-19 14:40:52 +00:00
}
],
costPrice: {
__typename: "Money",
amount: 12,
currency: "USD"
},
id: "var1",
images: [
{
__typename: "ProductImage",
id: "img1",
url: placeholderImage
},
{
__typename: "ProductImage",
id: "img2",
url: placeholderImage
},
{
__typename: "ProductImage",
id: "img7",
url: placeholderImage
},
{
__typename: "ProductImage",
id: "img8",
url: placeholderImage
}
],
name: "Extended Hard",
2020-06-12 11:19:44 +00:00
price: {
2019-06-19 14:40:52 +00:00
__typename: "Money",
amount: 100,
currency: "USD"
},
product: {
2019-08-09 11:14:35 +00:00
__typename: "Product" as "Product",
2019-06-19 14:40:52 +00:00
id: "prod1",
images: [
{
__typename: "ProductImage",
alt: "Front",
id: "img1",
sortOrder: 1,
url: placeholderImage
},
{
__typename: "ProductImage",
alt: "Back",
id: "img2",
sortOrder: 4,
url: placeholderImage
},
{
__typename: "ProductImage",
alt: "Right side",
id: "img3",
sortOrder: 2,
url: placeholderImage
},
{
__typename: "ProductImage",
alt: "Left side",
id: "img4",
sortOrder: 3,
url: placeholderImage
},
{
__typename: "ProductImage",
alt: "Paper",
id: "img5",
sortOrder: 0,
url: placeholderImage
},
{
__typename: "ProductImage",
alt: "Hard cover",
id: "img6",
sortOrder: 1,
url: placeholderImage
},
{
__typename: "ProductImage",
alt: "Extended version",
id: "img7",
sortOrder: 0,
url: placeholderImage
},
{
__typename: "ProductImage",
alt: "Cut version",
id: "img8",
sortOrder: 2,
url: placeholderImage
},
{
__typename: "ProductImage",
alt: "Soft cover",
id: "img9",
sortOrder: 2,
url: placeholderImage
}
],
name: "Our Awesome Book",
2019-08-09 11:14:35 +00:00
thumbnail: { __typename: "Image" as "Image", url: placeholderImage },
2019-06-19 14:40:52 +00:00
variants: [
{
__typename: "ProductVariant",
id: "var1",
images: [
{
__typename: "ProductImage",
id: "23123",
url: placeholderImage
}
],
name: "Extended Hard",
sku: "13-1337"
},
{
__typename: "ProductVariant",
id: "var2",
images: [
{
__typename: "ProductImage",
id: "23123",
url: placeholderImage
}
],
name: "Extended Soft",
sku: "13-1338"
},
{
__typename: "ProductVariant",
id: "var3",
images: [
{
__typename: "ProductImage",
id: "23123",
url: placeholderImage
}
],
name: "Normal Hard",
sku: "13-1339"
},
{
__typename: "ProductVariant",
id: "var4",
images: [
{
__typename: "ProductImage",
id: "23123",
url: placeholderImage
}
],
name: "Normal Soft",
sku: "13-1340"
}
]
},
2020-02-11 15:32:47 +00:00
sku: "1230959124123",
2020-03-27 14:51:21 +00:00
stocks: [
2020-02-11 15:32:47 +00:00
{
__typename: "Stock",
id: "1",
2020-03-27 14:51:21 +00:00
quantity: 1,
2020-04-29 17:10:04 +00:00
quantityAllocated: 1,
2020-03-27 14:51:21 +00:00
warehouse: {
__typename: "Warehouse",
id: "123",
name: "Warehouse 1"
}
2020-02-11 15:32:47 +00:00
},
{
__typename: "Stock",
id: "2",
2020-03-27 14:51:21 +00:00
quantity: 4,
2020-04-29 17:10:04 +00:00
quantityAllocated: 2,
2020-03-27 14:51:21 +00:00
warehouse: {
__typename: "Warehouse",
id: "1234",
name: "Warehouse 2"
}
2020-02-11 15:32:47 +00:00
}
2020-03-27 14:51:21 +00:00
],
trackInventory: true
2019-06-19 14:40:52 +00:00
});
export const variantImages = (placeholderImage: string) =>
variant(placeholderImage).images;
export const variantProductImages = (placeholderImage: string) =>
variant(placeholderImage).product.images;
export const variantSiblings = (placeholderImage: string) =>
variant(placeholderImage).product.variants;