const mongoose = require('mongoose'); const partnerApplicationSchema = new mongoose.Schema( { businessName: { type: String, required: true }, contactPerson: { type: String, required: true }, email: { type: String, required: true, lowercase: true }, phone: { type: String }, market: { type: mongoose.Schema.Types.ObjectId, ref: 'Market', required: true }, businessType: { type: String }, yearsInOperation: { type: Number }, status: { type: String, enum: ['new', 'under_review', 'approved', 'rejected'], default: 'new', }, internalNotes: [ { text: { type: String, required: true }, addedBy: { type: mongoose.Schema.Types.ObjectId, ref: 'Admin' }, date: { type: Date, default: Date.now }, }, ], }, { timestamps: true } ); module.exports = mongoose.model('PartnerApplication', partnerApplicationSchema);