text: const mongoose = require("mongoose");
  const Schema = mongoose.Schema;
  
  const workoutSchema = new Schema({
    day: {
      type: Date,
      default: Date.now,
    },
    exercises: [
      {
        type: {
          type: String,
          trim: true,
        },
        name: {
          type: String,
          trim: true,
        },
        weight: {
          type: Number,
          default: 0,
        },
        sets: {
          type: Number,
          default: 0,
        },
        reps: {
          type: Number,
          default: 0,
        },
        duration: {
          type: Number,
        },
        distance: {
          type: Number,
        },
      },
    ],
    totalDuration: {
      type: Number,
      default: 0,
    },
  });
  
  const workout = mongoose.model("workout", workoutSchema);
  
  module.exports = workout;
  