import mongoose, { Schema, Document } from 'mongoose';
import { Media } from '../../../domain/entities/Media';

const MediaSchema = new Schema({
  filename: { type: String, required: true },
  originalname: { type: String, required: true },
  mimetype: { type: String, required: true },
  size: { type: Number, required: true },
  path: { type: String, required: true },
  url: { type: String, required: true },
  category: String
}, { 
  timestamps: true,
  collection: 'media'
});

export interface MediaDocument extends Omit<Media, 'id'>, Document {}

export const MediaModel = mongoose.model<MediaDocument>('Media', MediaSchema);
