import { Controller, Get, Post, Body, HttpCode, HttpStatus, Param } from '@nestjs/common'; import { ApiTags, ApiResponse, ApiOperation } from '@nestjs/swagger'; import { SponsorService } from './SponsorService'; import { GetEntitySponsorshipPricingResultDto, GetSponsorsOutput, CreateSponsorInput, CreateSponsorOutput, GetSponsorDashboardQueryParams, SponsorDashboardDTO, GetSponsorSponsorshipsQueryParams, SponsorSponsorshipsDTO } from './dto/SponsorDto'; @ApiTags('sponsors') @Controller('sponsors') export class SponsorController { constructor(private readonly sponsorService: SponsorService) {} @Get('pricing') @ApiOperation({ summary: 'Get sponsorship pricing for an entity' }) @ApiResponse({ status: 200, description: 'Sponsorship pricing', type: GetEntitySponsorshipPricingResultDto }) async getEntitySponsorshipPricing(): Promise { return this.sponsorService.getEntitySponsorshipPricing(); } @Get() @ApiOperation({ summary: 'Get all sponsors' }) @ApiResponse({ status: 200, description: 'List of sponsors', type: GetSponsorsOutput }) async getSponsors(): Promise { return this.sponsorService.getSponsors(); } @Post() @HttpCode(HttpStatus.CREATED) @ApiOperation({ summary: 'Create a new sponsor' }) @ApiResponse({ status: 201, description: 'Sponsor created', type: CreateSponsorOutput }) async createSponsor(@Body() input: CreateSponsorInput): Promise { return this.sponsorService.createSponsor(input); } // Add other Sponsor endpoints here based on other presenters @Get('dashboard/:sponsorId') @ApiOperation({ summary: 'Get sponsor dashboard metrics and sponsored leagues' }) @ApiResponse({ status: 200, description: 'Sponsor dashboard data', type: SponsorDashboardDTO }) @ApiResponse({ status: 404, description: 'Sponsor not found' }) async getSponsorDashboard(@Param('sponsorId') sponsorId: string): Promise { return this.sponsorService.getSponsorDashboard({ sponsorId }); } @Get(':sponsorId/sponsorships') @ApiOperation({ summary: 'Get all sponsorships for a given sponsor' }) @ApiResponse({ status: 200, description: 'List of sponsorships', type: SponsorSponsorshipsDTO }) @ApiResponse({ status: 404, description: 'Sponsor not found' }) async getSponsorSponsorships(@Param('sponsorId') sponsorId: string): Promise { return this.sponsorService.getSponsorSponsorships({ sponsorId }); } }