diff --git a/controllers/apiUsagePricing.js b/controllers/apiUsagePricing.js index 7730b64..e23c043 100644 --- a/controllers/apiUsagePricing.js +++ b/controllers/apiUsagePricing.js @@ -99,11 +99,14 @@ const registerUsage = async (req, res) => { const registerWhatsappUsage = async (req, res) => { const { companyId, + companyPhone, + clientPhone, provider, product, type, msgId, ticketId, + ticketUrl, billable, pricing_model, } = req.body @@ -116,7 +119,9 @@ const registerWhatsappUsage = async (req, res) => { 'msgId', 'ticketId', 'billable', - 'pricing_model' + 'pricing_model', + 'companyPhone', + 'clientPhone', ]) const apiPricing = await API_Pricing.findOne({ @@ -132,11 +137,14 @@ const registerWhatsappUsage = async (req, res) => { const apiUsageWhatsapp = await API_Usage_Whatsapp.create({ companyId, + companyPhone, + clientPhone, provider: provider.trim().toLowerCase(), product: product.trim().toLowerCase(), price, msgId, ticketId, + ticketUrl, billable, pricing_model, type diff --git a/models/API_Usage_Whatsapp.js b/models/API_Usage_Whatsapp.js index db5fd8c..5ac8736 100644 --- a/models/API_Usage_Whatsapp.js +++ b/models/API_Usage_Whatsapp.js @@ -7,6 +7,14 @@ const apiUsageWhatsapp = new Schema({ type: String, required: true, }, + companyPhone: { + type: String, + required: true, + }, + clientPhone: { + type: String, + required: true, + }, msgId: { type: String, required: true, @@ -15,6 +23,10 @@ const apiUsageWhatsapp = new Schema({ type: String, required: true, }, + ticketUrl: { + type: String, + required: true, + }, provider: { type: String, required: true,