import { createCrudRoutes } from '../../utils/generic-crud.routes';
import { Config } from '../../modules/system/config.entity';
import { ConfigSchema, CreateConfigDto, UpdateConfigDto } from '../../modules/system/config.schema';
import { authMiddleware } from '../../middleware/auth.middleware';

const configRoutes = createCrudRoutes({
  entity: Config,
  createSchema: CreateConfigDto,
  updateSchema: UpdateConfigDto,
  getSchema: ConfigSchema,
  listSchema: ConfigSchema,
  searchFields: ['key', 'value'],
  middleware: [authMiddleware],
  userTracking: {
    createdByField: 'created_by',
    updatedByField: 'updated_by'
  }
});

export default configRoutes;