import { createCrudRoutes } from '@/server/utils/generic-crud.routes';
import { StockXunlianCodes } from '@/server/modules/stock/stock-xunlian-codes.entity';
import { StockXunlianCodesSchema, CreateStockXunlianCodesDto, UpdateStockXunlianCodesDto } from '@/server/modules/stock/stock-xunlian-codes.schema';
import { authMiddleware } from '@/server/middleware/auth.middleware';

const stockXunlianCodesRoutes = createCrudRoutes({
  entity: StockXunlianCodes,
  createSchema: CreateStockXunlianCodesDto,
  updateSchema: UpdateStockXunlianCodesDto,
  getSchema: StockXunlianCodesSchema,
  listSchema: StockXunlianCodesSchema,
  searchFields: ['code', 'stockName', 'name'],
  middleware: [authMiddleware]
});

export default stockXunlianCodesRoutes;