import { createCrudRoutes } from '@d8d/shared-crud';
import { authMiddleware } from '@d8d/auth-module';
import { BankName } from '../entities/bank-name.entity';
import { BankNameSchema, CreateBankNameDto, UpdateBankNameDto } from '../schemas/bank-name.schema';

export const bankNameRoutes = createCrudRoutes({
  entity: BankName,
  createSchema: CreateBankNameDto,
  updateSchema: UpdateBankNameDto,
  getSchema: BankNameSchema,
  listSchema: BankNameSchema,
  searchFields: ['name', 'code'],
  middleware: [authMiddleware],
  userTracking: {
    createdByField: 'createdBy',
    updatedByField: 'updatedBy'
  }
});