feat: Added client price to api_pricings colletion

feat/client_price
adriano 2025-06-05 16:30:11 -03:00
parent 99259b69a2
commit feb05b3e6e
3 changed files with 11 additions and 5 deletions

View File

@ -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 }

View File

@ -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'],

6
package-lock.json generated
View File

@ -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",