import { Controller, Get, Query, HttpCode, HttpStatus } from '@nestjs/common';
import { SuburbsService } from '@/modules/suburbs/suburbs.service';
import { SuburbQueryDto } from '@/modules/suburbs/suburbs.dto';

@Controller('suburbs')
export class SuburbsController {
  constructor(private readonly suburbsService: SuburbsService) {}

  @Get()
  @HttpCode(HttpStatus.OK)
  getSuburbs() {
    return this.suburbsService.getSuburbs();
  }

  @Get('info')
  @HttpCode(HttpStatus.OK)
  getSuburbsInfo(@Query() query: SuburbQueryDto) {
    return this.suburbsService.getSuburbsInfo(query.suburb ?? '');
  }
}
