Open paramanandapradhan opened 5 years ago
D -> delete icon A -> Add a new item
Model: // const schema = new mongoose.Schema({ name: String, shortName: String, desc: String, productType: String, // Goods or Service type: Number, // Product type, Any other sub type we need to mention as a number code: String, // Product code quantity: Number, price: Number, // in paisa, sales price purchagePrice: Number, maxDiscountPercent: Number, discountPercent: Number, discountAmount: Number, commissionPercent: Number, commissionAmount: Number, taxes: [ { _id: false, name: String, desc: String, percent: Number, amount: Number, } ], totalTaxAmount: Number, billingFields: [{ _id: false, productKey: String, // Product collecction key, like quantity billingKey: String, // Ref key of billing collection operation: String, // How it will react in billing collection, means Add or replace or extend type: String, // Value type, Number, Days, value: Number, // Default/Fallback value of the product billing fields }], isActive: Boolean, banner: String, canChangeDiscont: Boolean, // At the time of billing, discount can be updated by admin or sales person canChangeQuantity: Boolean, // Can change quentity by Biller,
// Old values, we may not use this on new implementation
requestCredit: Number,
storageCredit: Number,
smsCredit: Number,
emailCredit: Number,
sitePageCredit: Number,
siteTicketCredit: Number,
voiceSmsCredit: Number,
validity: String,
cancelPolicy: String,
docSize: Number,
}, { timestamps: true });
API: billing module router.get("/api/products", AuthCtrl.checkUserIdToken, ProductCtrl.getAllProducts); router.get("/api/products/:productId", AuthCtrl.checkUserIdToken, ProductCtrl.getProduct); router.post("/api/products", AuthCtrl.checkUserIdToken, ProductCtrl.createProduct); router.put("/api/products/:productId", AuthCtrl.checkUserIdToken, ProductCtrl.updateProduct); router.delete("/api/products/:productId", AuthCtrl.checkUserIdToken, ProductCtrl.deleteProduct);
Product create, list & view should updated. Recommended fields for product is:
Please look the following UI Mock