UNPKG

vinmonopolet-ts

Version:

Extracts information on products, categories and stores from Vinmonopolet

221 lines (220 loc) 6.79 kB
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; }; import { IsBoolean, IsNotEmpty, IsNumber, IsOptional, IsString, } from "class-validator"; import BaseProduct from "./BaseProduct"; export class PopulatedProduct extends BaseProduct { // Detailed product info /** * The abv (alcohol by volume) of the product. */ abv; /** * If any, the allergens of the product. */ allergens; /** * a bool representing if the product is bioDynamic. */ bioDynamic; /** * A string representation of the products color. */ color; /** * A bool representing if the product is eco */ eco; /** * A bool representing if the product has environmental packaging. */ environmentalPackaging; /** * A bool representing if the product is expired. */ expired; /** * A bool representing if the product is fairtrade. */ fairTrade; /** * A bool representing if the product is gluten-free */ glutenFree; /** * A set of Foodpairing objects. Describes what food the product pairs well with. */ foodPairing; /** * A bool representing if the product is kosher. */ kosher; /** * A string representation of whether the product can be aged further. */ storable; /** * A string representation of the container type and material. */ containerType; /** * A string representation of the products taste. */ taste; /** * A string representation of the products aroma. */ aroma; // Ingredients /** * An array of RawMaterial objects. */ rawMaterial; /** * A string or number representing the amount of sugar per litre in the product. */ sugar; /** * The acidity of the product in percentage. */ acid; /** * The amounts of tannins in percentage */ tannins; // Tasting notes /** * The bitterness of the product in percentage. */ bitterness; /** * The freshness of the product in percentage. */ freshness; /** * The fullness of the product in percentage. */ fullness; // meta /** * The minimum age limit in order to buy this product. */ ageLimit; // These tend to not be set description; summary; method; // Producer/distributer/importer etc distributor; distributorId; wholesaler; vintage; constructor(code, name, url, price, pricePerLiter, images, volume, mainCategory, subCategory, country, district, subDistrict, productSeelection, buyable, status, abv, allergens, bioDynamic, color, eco, environmentalPackaging, expired, fairTrade, gluten, foodPairing, kosher, storable, containerType, taste, aroma, rawMaterial, sugar, acid, tannins, bitterness, freshness, fullness, ageLimit, description, summary, method, distributor, distributorId, wholesaler, vintage) { super(code, name, url, price, pricePerLiter, images, volume, mainCategory, subCategory, country, district, subDistrict, productSeelection, undefined, buyable, status); this.abv = abv; this.allergens = allergens; this.bioDynamic = bioDynamic; this.color = color; this.eco = eco; this.environmentalPackaging = environmentalPackaging; this.expired = expired; this.fairTrade = fairTrade; this.glutenFree = gluten; this.foodPairing = foodPairing; this.kosher = kosher; this.storable = storable; this.containerType = containerType; this.taste = taste; this.aroma = aroma; this.rawMaterial = rawMaterial; this.sugar = sugar; this.acid = acid; this.tannins = tannins; this.bitterness = bitterness; this.freshness = freshness; this.fullness = fullness; this.ageLimit = ageLimit; this.description = description; this.summary = summary; this.method = method; this.distributor = distributor; this.distributorId = distributorId; this.wholesaler = wholesaler; this.vintage = vintage; } } __decorate([ IsNotEmpty(), IsNumber() ], PopulatedProduct.prototype, "abv", void 0); __decorate([ IsString(), IsOptional() ], PopulatedProduct.prototype, "allergens", void 0); __decorate([ IsBoolean() ], PopulatedProduct.prototype, "bioDynamic", void 0); __decorate([ IsString() ], PopulatedProduct.prototype, "color", void 0); __decorate([ IsBoolean() ], PopulatedProduct.prototype, "eco", void 0); __decorate([ IsBoolean() ], PopulatedProduct.prototype, "environmentalPackaging", void 0); __decorate([ IsBoolean() ], PopulatedProduct.prototype, "expired", void 0); __decorate([ IsBoolean() ], PopulatedProduct.prototype, "fairTrade", void 0); __decorate([ IsBoolean() ], PopulatedProduct.prototype, "glutenFree", void 0); __decorate([ IsBoolean() ], PopulatedProduct.prototype, "kosher", void 0); __decorate([ IsOptional(), IsString() ], PopulatedProduct.prototype, "storable", void 0); __decorate([ IsOptional(), IsString() ], PopulatedProduct.prototype, "containerType", void 0); __decorate([ IsOptional(), IsString() ], PopulatedProduct.prototype, "taste", void 0); __decorate([ IsOptional(), IsString() ], PopulatedProduct.prototype, "aroma", void 0); __decorate([ IsOptional() ], PopulatedProduct.prototype, "sugar", void 0); __decorate([ IsOptional(), IsNumber() ], PopulatedProduct.prototype, "acid", void 0); __decorate([ IsOptional(), IsNumber() ], PopulatedProduct.prototype, "tannins", void 0); __decorate([ IsOptional(), IsNumber() ], PopulatedProduct.prototype, "bitterness", void 0); __decorate([ IsOptional(), IsNumber() ], PopulatedProduct.prototype, "freshness", void 0); __decorate([ IsOptional(), IsNumber() ], PopulatedProduct.prototype, "fullness", void 0); export default PopulatedProduct;