feat: implemnted the property usedTo on the controller

main
adriano 2025-09-23 10:24:56 -03:00
parent 6b9100fd2e
commit 990c6457fe
2 changed files with 5 additions and 3 deletions

View File

@ -201,7 +201,8 @@ const registerUsage = async (req, res) => {
callerId, callerId,
sessionId, sessionId,
companyId, companyId,
format format,
usedTo
} = req.body } = req.body
@ -235,7 +236,8 @@ const registerUsage = async (req, res) => {
billingUnit, billingUnit,
companyId, companyId,
total_cost: calculateApiUsage(price, billingUnit, usage), total_cost: calculateApiUsage(price, billingUnit, usage),
format format,
usedTo
}) })
return res.status(StatusCodes.OK).json({ apiUsage }) return res.status(StatusCodes.OK).json({ apiUsage })

View File

@ -48,7 +48,7 @@ const apiUsage = new Schema(
type: String, type: String,
enum: ["text", "audio", "image", "video"], enum: ["text", "audio", "image", "video"],
}, },
used_to: { usedTo: {
type: String, type: String,
enum: ["stt", "llm", "tts"], enum: ["stt", "llm", "tts"],
}, },