import mongoose from 'mongoose'

const tagSuggestionSchema = new mongoose.Schema({
  label: { type: String, required: true },
  pool: { type: String, enum: ['craft', 'cooperative'], required: true },
  suggestedBy: { type: mongoose.Schema.Types.ObjectId, ref: 'Member', required: true },
  status: { type: String, enum: ['pending', 'approved', 'rejected'], default: 'pending' },
  createdAt: { type: Date, default: Date.now },
})

tagSuggestionSchema.index({ pool: 1, status: 1 })

export default mongoose.models.TagSuggestion || mongoose.model('TagSuggestion', tagSuggestionSchema)
