import { Body, Controller, Inject, Post } from '@nestjs/common';
import { WINSTON_MODULE_PROVIDER } from 'nest-winston';
import { UserListingCriteria } from 'src/models/main.model.js';
import { Logger } from 'winston';
import { UserService } from '../user/user.service.js';

@Controller('listings/professionals_brokers')
export class BrokerListingsController {
  constructor(
    private readonly userService: UserService,
    @Inject(WINSTON_MODULE_PROVIDER) private readonly logger: Logger,
  ) {}

  @Post('search')
  find(@Body() criteria: UserListingCriteria): any {
    return this.userService.searchUserListings(criteria);
  }
}
