/***
 *
 * @description This model represent the gym services collection schema in mongodb
 * * source : https://mongoosejs.com/docs/guide.html
 */
import mongoose, { Model } from 'mongoose';
import { IServicesSchema } from '@/types/IDB';
// define the schema
const servicesSchema = new mongoose.Schema<IServicesSchema>({
    name: String,
    description: String,
    price: Number,
    status: {
        type: String,
        default: 'active',
    },
    totalSubscribers: {
        type: Number,
        default: 0,
    }
}, { timestamps: true });
// export the model
const serviceModel: Model<IServicesSchema> = mongoose.models.services || mongoose.model<IServicesSchema>('services', servicesSchema);
export default serviceModel