Source: types/product.js

/* * *  *  * *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * */
/* Copyright (c) 2018 Mobify Research & Development Inc. All rights reserved. */
/* * *  *  * *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * */

import PropTypes from 'prop-types'
import {ImageSet} from './image-set'
import {Integer} from './integer'
import {Variation} from './variation'
import {VariationProperty} from './variation-property'

/**
 * @memberOf module:types
 * @typedef {Object} Product
 * @property {String} id The product id.
 * @property {String} name The product name.
 * @property {Array.<module:types.ImageSet>} imageSets The product's image-sets.
 * @property {String} description The product's description.
 * @property {String} categoryId The product's main category id.
 * @property {String} brand The product's brand name.
 * @property {module:types.Integer} minimumOrderQuantity The product's minimum order quantity.
 * @property {module:types.Integer} stepQuantity The product's step quantity.
 * @property {String} upc The product's universal product code.
 * @property {String} unit The product's units, such as 'each', 'ea', or 'pair'.
 * @property {Number} price The default price.
 * @property {Object} prices The map of price type label and value. For example: {'Regular': 99.99, 'Sale': 69.99}
 * @property {Array.<module:types.Variation>} variations The different variations of the product.
 * @property {Array.<module:types.VariationProperty>} variationProperties All the product variations' different properties.
 * @property {Object} variationValues The product's property values.
 */
export const Product = {
    id: PropTypes.string.isRequired,
    name: PropTypes.string,
    imageSets: PropTypes.arrayOf(PropTypes.shape(ImageSet)),
    description: PropTypes.string,
    categoryId: PropTypes.string,
    brand: PropTypes.string,
    minimumOrderQuantity: Integer,
    stepQuantity: Integer,
    upc: PropTypes.string,
    unit: PropTypes.string,
    price: PropTypes.number,
    prices: PropTypes.object,
    variations: PropTypes.arrayOf(PropTypes.shape(Variation)),
    variationProperties: PropTypes.arrayOf(PropTypes.shape(VariationProperty)),
    variationValues: PropTypes.object
}