empiria-trade
Version:
Empiria Trade TypeScript Library
183 lines (181 loc) • 6.23 kB
JavaScript
"use strict";
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 __());
};
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var ontology_1 = require('empiria/ontology');
var index_1 = require('./index');
var Product = (function (_super) {
__extends(Product, _super);
function Product() {
_super.apply(this, arguments);
}
Product.parse = function (id) {
return ontology_1.BaseObjectFactory.parse(Product, id);
};
Object.defineProperty(Product, "empty", {
get: function () {
return ontology_1.BaseObjectFactory.parseEmpty(Product);
},
enumerable: true,
configurable: true
});
Product.getList = function (keywords) {
if (keywords === void 0) { keywords = ''; }
return ontology_1.BaseObjectFactory.parseList(Product, keywords);
};
Product.getListAsync = function (keywords) {
if (keywords === void 0) { keywords = ''; }
return ontology_1.BaseObjectFactory.parseAsync(Product, keywords);
};
Product.prototype.onload = function (data) {
if (!this.isEmptyInstance) {
this.data.baseProduct = Product.parse(data['baseProductId']);
}
};
Object.defineProperty(Product.prototype, "category", {
get: function () {
return new index_1.Category(this.data.category);
},
enumerable: true,
configurable: true
});
Object.defineProperty(Product.prototype, "subcategory", {
get: function () {
return new index_1.Subcategory(this.data.subcategory);
},
enumerable: true,
configurable: true
});
Object.defineProperty(Product.prototype, "productTerm", {
get: function () {
return new index_1.ProductTerm(this.data.productTerm);
},
enumerable: true,
configurable: true
});
Object.defineProperty(Product.prototype, "manufacturer", {
get: function () {
return new index_1.Manufacturer(this.data.manufacturer);
},
enumerable: true,
configurable: true
});
Object.defineProperty(Product.prototype, "brand", {
get: function () {
return new index_1.Brand(this.data.brand);
},
enumerable: true,
configurable: true
});
Object.defineProperty(Product.prototype, "partNumber", {
get: function () {
return this.data.partNumber;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Product.prototype, "name", {
get: function () {
return this.data.name;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Product.prototype, "searchTags", {
get: function () {
return this.data.searchTags;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Product.prototype, "description", {
get: function () {
return this.data.description;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Product.prototype, "notes", {
get: function () {
return this.data.notes;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Product.prototype, "presentationUnit", {
get: function () {
return new index_1.PresentationUnit(this.data.presentationUnit);
},
enumerable: true,
configurable: true
});
Object.defineProperty(Product.prototype, "contentQty", {
get: function () {
return this.data.contentQty;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Product.prototype, "contentUnit", {
get: function () {
return new index_1.ContentUnit(this.data.contentUnit);
},
enumerable: true,
configurable: true
});
Object.defineProperty(Product.prototype, "startDate", {
get: function () {
return this.data.startDate;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Product.prototype, "lastUpdated", {
get: function () {
return this.data.lastUpdated;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Product.prototype, "manager", {
get: function () {
return this.data.manager;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Product.prototype, "isBaseProduct", {
get: function () {
return !this.isEmptyInstance &&
this.data.baseProduct &&
this.data.baseProduct.isEmptyInstance;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Product.prototype, "baseProduct", {
get: function () {
return this.data.baseProduct;
},
enumerable: true,
configurable: true
});
Product = __decorate([
ontology_1.empiriaType('Empiria.Trade.PDM.Product'),
__metadata('design:paramtypes', [])
], Product);
return Product;
}(ontology_1.BaseObject));
exports.Product = Product;
//# sourceMappingURL=product.js.map