import { createCrudRoutes } from '../../utils/generic-crud.routes';
import { City } from '../../modules/system/city.entity';
import { CitySchema, CreateCityDto, UpdateCityDto } from '../../modules/system/city.schema';
import { authMiddleware } from '../../middleware/auth.middleware';

const cityRoutes = createCrudRoutes({
  entity: City,
  createSchema: CreateCityDto,
  updateSchema: UpdateCityDto,
  getSchema: CitySchema,
  listSchema: CitySchema,
  searchFields: ['name'],
  middleware: [authMiddleware],
  userTracking: {
    createdByField: 'created_by',
    updatedByField: 'updated_by'
  }
});

export default cityRoutes;