import { createCrudRoutes } from '../../utils/generic-crud.routes';
import { AdvertisementType } from '../../modules/advertisements/advertisement-type.entity';
import { AdvertisementTypeSchema, CreateAdvertisementTypeDto, UpdateAdvertisementTypeDto } from '../../modules/advertisements/advertisement-type.schema';
import { authMiddleware } from '../../middleware/auth.middleware';

const advertisementTypeRoutes = createCrudRoutes({
  entity: AdvertisementType,
  createSchema: CreateAdvertisementTypeDto,
  updateSchema: UpdateAdvertisementTypeDto,
  getSchema: AdvertisementTypeSchema,
  listSchema: AdvertisementTypeSchema,
  searchFields: ['name', 'code'],
  middleware: [authMiddleware],
  userTracking: {
    createdByField: 'createdBy',
    updatedByField: 'updatedBy'
  }
});

export default advertisementTypeRoutes;