var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
/// <reference path="../../base/BaseClass.ts"/>
/// <reference path="../../serialization/ISerializable.ts" />
var econda;
(function (econda) {
    var recengine;
    (function (recengine) {
        var context;
        (function (context) {
            /**
             * Reference for a single product.
             * @class econda.recengine.context.ProductReference
             */
            var ProductReference = (function (_super) {
                __extends(ProductReference, _super);
                function ProductReference(cfg) {
                    _super.call(this);
                    /**
                     * Product id. Must be identical for all variants (if available)
                     * @cfg {String} id
                     * @accessor
                     */
                    this._id = null;
                    /**
                     * Sku (stock keeping unit). Unique id for each product. Each variant must have a unique sku!
                     * @cfg {String} sku
                     * @accessor
                     */
                    this._sku = null;
                    if (cfg instanceof ProductReference) {
                        return cfg;
                    }
                    else {
                        this.initConfig(cfg);
                    }
                }
                ProductReference.prototype.getId = function () {
                    return this._id;
                };
                ProductReference.prototype.setId = function (id) {
                    this._id = id;
                    return this;
                };
                ProductReference.prototype.getSku = function () {
                    return this._sku;
                };
                ProductReference.prototype.setSku = function (sku) {
                    this._sku = sku;
                    return this;
                };
                ProductReference.prototype.getObjectData = function () {
                    return {
                        className: 'econda.recengine.context.ProductReference',
                        data: {
                            id: this._id,
                            sku: this._sku
                        }
                    };
                };
                ProductReference.prototype.setObjectData = function (data) {
                    if (typeof data === 'object' && data !== null) {
                        this._id = data.id || null;
                        this._sku = data.sku || null;
                    }
                };
                return ProductReference;
            }(econda.base.BaseClass));
            context.ProductReference = ProductReference; // end of class
        })(context = recengine.context || (recengine.context = {}));
    })(recengine = econda.recengine || (econda.recengine = {}));
})(econda || (econda = {})); // end of module