From 990c6457fe8e1f416c82d6d7c94c49184ad9a03f Mon Sep 17 00:00:00 2001 From: adriano Date: Tue, 23 Sep 2025 10:24:56 -0300 Subject: [PATCH] feat: implemnted the property usedTo on the controller --- controllers/apiUsagePricing.js | 6 ++++-- models/API_Usage.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/controllers/apiUsagePricing.js b/controllers/apiUsagePricing.js index 9631bd5..9bfb763 100644 --- a/controllers/apiUsagePricing.js +++ b/controllers/apiUsagePricing.js @@ -201,7 +201,8 @@ const registerUsage = async (req, res) => { callerId, sessionId, companyId, - format + format, + usedTo } = req.body @@ -235,7 +236,8 @@ const registerUsage = async (req, res) => { billingUnit, companyId, total_cost: calculateApiUsage(price, billingUnit, usage), - format + format, + usedTo }) return res.status(StatusCodes.OK).json({ apiUsage }) diff --git a/models/API_Usage.js b/models/API_Usage.js index af353ed..02025f1 100644 --- a/models/API_Usage.js +++ b/models/API_Usage.js @@ -48,7 +48,7 @@ const apiUsage = new Schema( type: String, enum: ["text", "audio", "image", "video"], }, - used_to: { + usedTo: { type: String, enum: ["stt", "llm", "tts"], },