All files / apps/api-gateway/src/gateway/summary property-summary.controller.ts

100% Statements 10/10
100% Branches 8/8
100% Functions 2/2
100% Lines 8/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 332x 2x             2x 2x                 2x 2x                 2x 1x      
import { Controller, Get, Param, ParseUUIDPipe } from '@nestjs/common';
import {
  ApiBearerAuth,
  ApiOkResponse,
  ApiOperation,
  ApiTags,
  ApiUnauthorizedResponse,
} from '@nestjs/swagger';
import { PropertySummaryDto } from '../http/api-types';
import {
  PropertySummary,
  PropertySummaryService,
} from './property-summary.service';
 
@ApiTags('properties')
@ApiBearerAuth()
@ApiUnauthorizedResponse({ description: 'Missing or invalid token' })
@Controller('properties')
export class PropertySummaryController {
  constructor(private readonly summaryService: PropertySummaryService) {}
 
  @ApiOperation({
    summary: 'Property summary (composed)',
    description:
      'Roles: any authenticated user. Composes properties + work-orders; degrades gracefully when work-orders is down (flow 6).',
  })
  @ApiOkResponse({ type: PropertySummaryDto })
  @Get(':id/summary')
  getSummary(@Param('id', ParseUUIDPipe) id: string): Promise<PropertySummary> {
    return this.summaryService.getSummary(id);
  }
}