diff --git a/controllers/apiUsagePricing.js b/controllers/apiUsagePricing.js index e23c043..c540898 100644 --- a/controllers/apiUsagePricing.js +++ b/controllers/apiUsagePricing.js @@ -13,7 +13,7 @@ const API_Usage_Whatsapp = require("../models/API_Usage_Whatsapp.js") const setApiPricing = async (req, res) => { - const { provider, product, currency, price, billingBy, billingUnit, type } = req.body + const { provider, product, currency, price, billingBy, billingUnit, type, clientPrice } = req.body mustContainProperties(req, ['provider', 'product', @@ -37,7 +37,8 @@ const setApiPricing = async (req, res) => { price, billingBy, billingUnit, - type + type, + clientPrice } const options = { new: true, upsert: true } diff --git a/models/API_Pricing.js b/models/API_Pricing.js index a7113b3..9c9e521 100644 --- a/models/API_Pricing.js +++ b/models/API_Pricing.js @@ -19,7 +19,10 @@ const apiPricing = new Schema({ price: { type: String, required: true - }, + }, + clientPrice: { + type: String, + }, billingBy:{ type: String, enum: ['minute', 'character', 'token', 'second', 'hour'], diff --git a/package-lock.json b/package-lock.json index e7f70c7..f7b8e4d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7443,7 +7443,8 @@ "version": "4.4.0", "resolved": "https://registry.npmjs.org/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-4.4.0.tgz", "integrity": "sha512-BabizFdC3wBHhbI4kJh0VkQP9GkBfoHPydD0COMce1nJ1kJAB3F2TmJ/I7diULBKtmEWSwEbuN/KDtgnmUUVmw==", - "dev": true + "dev": true, + "requires": {} }, "create-require": { "version": "1.1.1", @@ -7748,7 +7749,8 @@ "express-async-errors": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/express-async-errors/-/express-async-errors-3.1.1.tgz", - "integrity": "sha512-h6aK1da4tpqWSbyCa3FxB/V6Ehd4EEB15zyQq9qe75OZBp0krinNKuH4rAY+S/U/2I36vdLAUFSjQJ+TFmODng==" + "integrity": "sha512-h6aK1da4tpqWSbyCa3FxB/V6Ehd4EEB15zyQq9qe75OZBp0krinNKuH4rAY+S/U/2I36vdLAUFSjQJ+TFmODng==", + "requires": {} }, "express-fileupload": { "version": "1.2.1",