import { createCrudRoutes } from '@/server/utils/generic-crud.routes';
import { ClassroomData } from '@/server/modules/classroom/classroom-data.entity';
import { ClassroomDataSchema, CreateClassroomDataDto, UpdateClassroomDataDto } from '@/server/modules/classroom/classroom-data.schema';
import { authMiddleware } from '@/server/middleware/auth.middleware';

const classroomDataRoutes = createCrudRoutes({
  entity: ClassroomData,
  createSchema: CreateClassroomDataDto,
  updateSchema: UpdateClassroomDataDto,
  getSchema: ClassroomDataSchema,
  listSchema: ClassroomDataSchema,
  searchFields: ['classroomNo', 'code'],
  middleware: [authMiddleware],
  userTracking: {
    createdByField: 'createdBy',
    updatedByField: 'updatedBy'
  }
});

export default classroomDataRoutes;