import { Controller, Get, Post, Body, Patch, Param, Delete, Query } from '@nestjs/common';
import { UsersService } from './location.service';
import { ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
import { Public } from '@/common/decorators';
// import { Roles } from '../../common/decorators/roles.decorator';
// import { PaginationDto } from '../../common/dto/pagination.dto';
@Public()
@ApiTags('location')
@Controller('location')
export class UsersController {
  constructor(private readonly usersService: UsersService) {}

  @Get("state")
  // @Roles('admin')
  // @ApiOperation({ summary: 'Get all users with pagination and filters' })
  // @ApiResponse({ status: 200, description: 'Return paginated users.' })
  async findState() {
    const data = await this.usersService.StateAll();
    return { message: 'Data fetched successfully', data};
  }

  @Get('municipality/:id')
  // @Roles('admin')
  // @ApiOperation({ summary: 'Get a user by ID' })
  // @ApiResponse({ status: 200, description: 'Return the user.' })
  // @ApiResponse({ status: 404, description: 'User not found.' })
  async findMunicipality(@Param('id') id: string) {
    const data = await this.usersService.MunicioalityAll(id);
    return { message: 'Data fetched successfully', data };
  }

  @Get('parish/:id')
  // @Roles('admin')
  // @ApiOperation({ summary: 'Get a user by ID' })
  // @ApiResponse({ status: 200, description: 'Return the user.' })
  // @ApiResponse({ status: 404, description: 'User not found.' })
  async findParish(@Param('id') id: string) {
    const data = await this.usersService.ParishAll(id);
    return { message: 'Data fetched successfully', data };
  }
}
