import mongoose, { Schema, Document } from 'mongoose';

export interface IScheduleBlock extends Document {
  dayOfWeek: string; // "Monday", "Tuesday", etc.
  startTime: string; // "08:30"
  endTime: string;   // "10:30"
  activityName: string;
  blockType: string; // "Course", "Work", "Web Dev", "Sleep", "Bus", "Weekend Class", "Free"
  color: string;     // "#3b82f6"
}

const ScheduleBlockSchema: Schema = new Schema({
  dayOfWeek: { type: String, required: true },
  startTime: { type: String, required: true },
  endTime: { type: String, required: true },
  activityName: { type: String, required: true },
  blockType: { type: String, required: true },
  color: { type: String, required: true },
});

export default mongoose.models.ScheduleBlock || mongoose.model<IScheduleBlock>('ScheduleBlock', ScheduleBlockSchema);
