feat: implemnted the property usedTo on the controller
parent
6b9100fd2e
commit
990c6457fe
|
@ -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 })
|
||||||
|
|
|
@ -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"],
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue