"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.CartItem = void 0;

var _propTypes = _interopRequireDefault(require("prop-types"));

var _positiveInteger = require("./positive-integer");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

/* * *  *  * *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * */

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

/* * *  *  * *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * */

/**
 * @memberOf module:types
 * @typedef {Object} CartItem
 * @property {String} id The cart id.
 * @property {String} productId The product id.
 * @property {String} productName The product name.
 * @property {module:types.PositiveInteger} quantity The quantity of this product in the cart.
 * @property {Number} baseItemPrice The price for one unit of this product before discounts.
 * @property {Number} baseLinePrice The price for all units of this product before discounts (usually baseItemPrice multiplied by quantity).
 * @property {Number} itemPrice The price for one unit of this product after discounts.
 * @property {Number} linePrice The price for all units of this product in the cart, after discounts (usually baseItemPrice multiplied by quantity).
 */
var CartItem = {
  id: _propTypes["default"].string.isRequired,
  productId: _propTypes["default"].string.isRequired,
  productName: _propTypes["default"].string,
  quantity: _positiveInteger.PositiveInteger.isRequired,
  baseItemPrice: _propTypes["default"].number.isRequired,
  baseLinePrice: _propTypes["default"].number.isRequired,
  itemPrice: _propTypes["default"].number.isRequired,
  linePrice: _propTypes["default"].number.isRequired
};
exports.CartItem = CartItem;