settings/models/API_Usage.js

58 lines
966 B
JavaScript
Raw Normal View History

const mongoose = require("../db/connect");
2024-07-30 11:26:42 +00:00
const { Schema } = mongoose;
2024-07-30 11:26:42 +00:00
const apiUsage = new Schema(
{
2024-07-30 11:26:42 +00:00
companyId: {
type: String,
required: true,
2024-07-30 11:26:42 +00:00
},
callerId: {
type: String,
required: true,
2024-07-30 11:26:42 +00:00
},
sessionId: {
type: String,
required: true,
},
2024-07-30 11:26:42 +00:00
provider: {
type: String,
required: true,
2024-07-30 11:26:42 +00:00
},
product: {
type: String,
required: true,
},
2024-07-30 11:26:42 +00:00
usage: {
type: String,
required: true,
2024-07-30 11:26:42 +00:00
},
price: {
type: String,
required: true,
2024-07-30 11:26:42 +00:00
},
billingBy: {
type: String,
required: true,
2024-07-30 11:26:42 +00:00
},
billingUnit: {
type: Number,
required: true,
},
2024-07-30 11:26:42 +00:00
total_cost: {
type: String,
required: true,
},
format: {
type: String,
enum: ["text", "audio", "image", "video"],
},
},
{ timestamps: true }
);
2024-07-30 11:26:42 +00:00
const API_Usage = mongoose.model("API_Usage", apiUsage);
2024-07-30 11:26:42 +00:00
module.exports = API_Usage;