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,
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 })

View File

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