50 lines
899 B
JavaScript
50 lines
899 B
JavaScript
const mongoose = require("../db/connect");
|
|
|
|
const { Schema } = mongoose;
|
|
|
|
const apiPricing = new Schema(
|
|
{
|
|
provider: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
product: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
currency: {
|
|
type: String,
|
|
enum: ["dollar", "real"],
|
|
default: "dollar",
|
|
},
|
|
price: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
clientPrice: {
|
|
type: String,
|
|
},
|
|
billingBy: {
|
|
type: String,
|
|
enum: ["minute", "character", "token", "second", "hour"],
|
|
required: true,
|
|
},
|
|
billingUnit: {
|
|
type: Number,
|
|
required: true,
|
|
},
|
|
type: {
|
|
type: String,
|
|
},
|
|
format: {
|
|
type: String,
|
|
enum: ["text", "audio", "image", "video"],
|
|
},
|
|
},
|
|
{ timestamps: true }
|
|
);
|
|
|
|
const API_Pricing = mongoose.model("API_Pricing", apiPricing);
|
|
|
|
module.exports = API_Pricing;
|