import { createCrudRoutes } from '../../utils/generic-crud.routes';
import { ExpressCompany } from '../../modules/logistics/express-company.entity';
import { ExpressCompanySchema, CreateExpressCompanyDto, UpdateExpressCompanyDto } from '../../modules/logistics/express-company.schema';
import { authMiddleware } from '../../middleware/auth.middleware';

const expressCompanyRoutes = createCrudRoutes({
  entity: ExpressCompany,
  createSchema: CreateExpressCompanyDto,
  updateSchema: UpdateExpressCompanyDto,
  getSchema: ExpressCompanySchema,
  listSchema: ExpressCompanySchema,
  searchFields: ['name', 'code'],
  middleware: [authMiddleware],
  userTracking: {
    createdByField: 'created_by',
    updatedByField: 'updated_by'
  }
});

export default expressCompanyRoutes;