import { Controller, Get, Query } from '@nestjs/common';
import { ManagementService } from './management.service';

@Controller('management')
export class ManagementController {
  constructor(private readonly managementService: ManagementService) {}

  @Get('overview')
  getOverview(
    @Query('actorId') actorId: string,
    @Query('permissions') permissions?: string,
  ) {
    return this.managementService.getOverview({
      actorId,
      permissions: permissions ? permissions.split(',').map((item) => item.trim()).filter(Boolean) : [],
    });
  }
}
