2025-09-23 09:59:15 +00:00
|
|
|
const mongoose = require("../db/connect");
|
2024-07-30 11:26:42 +00:00
|
|
|
|
2025-09-23 09:59:15 +00:00
|
|
|
const { Schema } = mongoose;
|
2024-07-30 11:26:42 +00:00
|
|
|
|
2025-09-23 09:59:15 +00:00
|
|
|
const apiPricing = new Schema(
|
|
|
|
{
|
2024-07-30 11:26:42 +00:00
|
|
|
provider: {
|
2025-09-23 09:59:15 +00:00
|
|
|
type: String,
|
|
|
|
required: true,
|
2024-07-30 11:26:42 +00:00
|
|
|
},
|
|
|
|
product: {
|
2025-09-23 09:59:15 +00:00
|
|
|
type: String,
|
|
|
|
required: true,
|
2024-07-30 11:26:42 +00:00
|
|
|
},
|
|
|
|
currency: {
|
2025-09-23 09:59:15 +00:00
|
|
|
type: String,
|
|
|
|
enum: ["dollar", "real"],
|
|
|
|
default: "dollar",
|
2024-07-30 11:26:42 +00:00
|
|
|
},
|
|
|
|
price: {
|
2025-09-23 09:59:15 +00:00
|
|
|
type: String,
|
|
|
|
required: true,
|
2025-06-05 19:30:11 +00:00
|
|
|
},
|
|
|
|
clientPrice: {
|
2025-09-23 09:59:15 +00:00
|
|
|
type: String,
|
2025-06-05 19:30:11 +00:00
|
|
|
},
|
2025-09-23 09:59:15 +00:00
|
|
|
billingBy: {
|
|
|
|
type: String,
|
|
|
|
enum: ["minute", "character", "token", "second", "hour"],
|
|
|
|
required: true,
|
2024-07-30 11:26:42 +00:00
|
|
|
},
|
2025-09-23 09:59:15 +00:00
|
|
|
billingUnit: {
|
|
|
|
type: Number,
|
|
|
|
required: true,
|
2024-07-30 11:26:42 +00:00
|
|
|
},
|
|
|
|
type: {
|
2025-09-23 09:59:15 +00:00
|
|
|
type: String,
|
|
|
|
},
|
|
|
|
format: {
|
|
|
|
type: String,
|
|
|
|
enum: ["text", "audio", "image", "video"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{ timestamps: true }
|
|
|
|
);
|
2024-07-30 11:26:42 +00:00
|
|
|
|
2025-09-23 09:59:15 +00:00
|
|
|
const API_Pricing = mongoose.model("API_Pricing", apiPricing);
|
2024-07-30 11:26:42 +00:00
|
|
|
|
2025-09-23 09:59:15 +00:00
|
|
|
module.exports = API_Pricing;
|