39 lines
668 B
JavaScript
39 lines
668 B
JavaScript
export class Variant{
|
|
constructor() {
|
|
this.id = 0;
|
|
this.name = "";
|
|
this.article_id = 0;
|
|
this.price = 0;
|
|
}
|
|
get Name() {
|
|
return this.name;
|
|
}
|
|
set Name(value) {
|
|
this.name = value;
|
|
}
|
|
get ArticleId() {
|
|
return this.article_id;
|
|
}
|
|
set ArticleId(value) {
|
|
this.article_id = value;
|
|
}
|
|
get Price() {
|
|
return this.price;
|
|
}
|
|
set Price(value) {
|
|
this.price = value;
|
|
}
|
|
}
|
|
|
|
Variant.thaw = function (json) {
|
|
var variant = new Variant();
|
|
variant.id = json.id;
|
|
variant.Name = json.name;
|
|
variant.ArticleId = json.article_id;
|
|
variant.Price = json.price;
|
|
|
|
return variant;
|
|
};
|
|
|
|
export const thawVariant = Variant.thaw;
|