import { Controller, Get, Delete, Param, UseGuards } from '@nestjs/common';
import { FamiliesService } from './families.service';
import { AdminGuard } from '../../../common/guards/admin.guard';

@Controller('api/v1/admin/families')
@UseGuards(AdminGuard)
export class FamiliesController {
  constructor(private readonly familiesService: FamiliesService) {}

  @Get()
  async listFamilies() {
    return this.familiesService.listFamilies();
  }

  @Get(':id')
  async getFamilyById(@Param('id') id: string) {
    return this.familiesService.getFamilyById(id);
  }

  @Delete(':id')
  async deleteFamily(@Param('id') id: string) {
    return this.familiesService.deleteFamily(id);
  }
}
