import { Controller, Get } from '@nestjs/common';
import { Public } from '../auth/Public';
import { ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
import { PolicyService, PolicySnapshot } from './PolicyService';

@ApiTags('policy')
@Public()
@Controller('policy')
export class PolicyController {
  constructor(private readonly policyService: PolicyService) {}

  @Get('snapshot')
  @ApiOperation({ summary: 'Get current feature availability policy snapshot (read-only)' })
  @ApiResponse({ status: 200, description: 'Policy snapshot', type: Object })
  async getSnapshot(): Promise<PolicySnapshot> {
    return await this.policyService.getSnapshot();
  }
}