Issue when creating a collection


//classServices.js
const db = require('../../../models/studentClass');

class classCreation{
    
    createClass=async(details)=>{
        
            

            //create a new class document
            const data =new db.class.create(details)
            // save the document to the class collection
            const savedData=await data.save();
            return savedData;
    
        
        }
}



module.exports={classCreation};


/////////////////////////////////////////////////
//classController.js


//services

const { classCreation } =require('./classServices');
const addClass= new classCreation();

const createClass = async (req,res) =>{
    try{
        
        const standard= req.body.standard;
        const division=req.body.division;
        console.log("standard=",req.body.standard);
        console.log("division",req.body.division);
        const details={
            standard:standard,
            division:division,
        };
        console.log("Details=",details);
       const classDetails=await addClass.createClass(details);

    res.status(201).json(classDetails);
  } catch (error) {
    console.error('Error creating class:', error);
    res.status(500).json({ error: 'Error creating class' });
  }
};



module.exports={createClass};


////////////////////////////////////////////////
//class.js

const mongoose  = require('mongoose');

const classSchema = new mongoose.Schema({
    standard :{
    type :String
    },
    division :{
        type:String
    },
})

module.exports=classSchema;

Error creating class: TypeError: Cannot read properties of undefined (reading ‘create’)