// Import necessary decorators from NestJS
import { Controller, Get, Query } from '@nestjs/common';

// Import Swagger decorator for API documentation
import { ApiTags } from '@nestjs/swagger';

// Import the service that contains business logic
import { QuoteMasterService } from './quote-master.service';

/**
 * QuoteMasterController - Handles HTTP requests for quote master dashboard data
 *
 * This controller provides a simple endpoint for retrieving quote dashboard information.
 * It follows the minimal controller pattern with a single, focused endpoint.
 *
 * Key Characteristics:
 * - Single responsibility: Focuses only on quote dashboard data
 * - Simple GET endpoint: No complex CRUD operations
 * - Minimal dependencies: Only injects the necessary service
 *
 * @ApiTags('Quote Master') - Groups this endpoint under "Quote Master" in Swagger UI
 * @Controller('') - Base route (empty string typically means it uses module prefix)
 */
@ApiTags('Quote Master')
@Controller('')
export class QuoteMasterController {
  /**
   * Constructor with dependency injection
   *
   * @param quoteMasterService - Injected service containing quote dashboard business logic
   */
  constructor(private readonly quoteMasterService: QuoteMasterService) {}

  /**
   * GET /dashboard-quote - Retrieves quote dashboard data
   *
   * This endpoint provides aggregated or summarized quote data suitable for dashboard displays.
   * It likely returns metrics, summaries, or high-level overview of quotes.
   *
   * Endpoint Characteristics:
   * - HTTP GET: Suitable for data retrieval (idempotent)
   * - No parameters: Returns default/fixed dashboard view
   * - No query parameters: Could be extended with filters if needed
   *
   * Expected Response:
   * - Likely returns aggregated statistics (counts, totals, averages)
   * - May include recent quotes, status breakdowns, or performance metrics
   * - Format: JSON object with dashboard-specific structure
   *
   * Potential Use Cases:
   * - Admin dashboard showing quote overview
   * - Sales dashboard with quote performance
   * - Manager dashboard for quote tracking
   *
   * Security Considerations:
   * - Should have appropriate guards (not shown but likely in module)
   * - May filter data based on user role/permissions
   *
   * Improvement Opportunities:
   * - Could add query parameters for date ranges, filters
   * - Could support different dashboard views/types
   * - Could add pagination for quote lists within dashboard
   */
  @Get('dashboard-quote')
  findAll() {
    return this.quoteMasterService.getAllQuoteMasterDashboard();
  }
}
