foundation is set
This commit is contained in:
50
whatsapp-web.js/src/models/product.js
Normal file
50
whatsapp-web.js/src/models/product.js
Normal file
@@ -0,0 +1,50 @@
|
||||
|
||||
class Product {
|
||||
|
||||
constructor({ id = '', name = '', desc = '', cost = 0, image = null }) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.desc = desc;
|
||||
this.cost = cost;
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
getId(){
|
||||
return this.id;
|
||||
}
|
||||
|
||||
setName(name){
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
getName(){
|
||||
return this.name;
|
||||
}
|
||||
|
||||
setDesc(desc){
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
getDesc(){
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
setCost(cost){
|
||||
this.cost = cost;
|
||||
}
|
||||
|
||||
getCost(){
|
||||
return this.cost;
|
||||
}
|
||||
|
||||
setImage(image){
|
||||
this.imageUrl = image;
|
||||
}
|
||||
|
||||
getImage(){
|
||||
return this.imageUrl;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports.Product = Product;
|
||||
23
whatsapp-web.js/src/models/website.js
Normal file
23
whatsapp-web.js/src/models/website.js
Normal file
@@ -0,0 +1,23 @@
|
||||
const {Product} = require('./product');
|
||||
|
||||
class Website {
|
||||
|
||||
/**
|
||||
* @param {Map<string,string>} details
|
||||
*/
|
||||
constructor(details){
|
||||
this.details = details;
|
||||
this.products = [];
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {Product} product
|
||||
*/
|
||||
addProduct(product){
|
||||
this.products.push(product);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports.Website = Website;
|
||||
Reference in New Issue
Block a user