import { Controller, Get, Param, ParseUUIDPipe } from "@nestjs/common";
import { ApiOperation, ApiTags } from "@nestjs/swagger";

import { TrackingService } from "./tracking.service";

@ApiTags("tracking")
@Controller("tracking")
export class TrackingController {
  constructor(private readonly trackingService: TrackingService) {}

  @Get(":consignmentId")
  @ApiOperation({ summary: "Get the tracking timeline for a consignment" })
  findByConsignment(
    @Param("consignmentId", ParseUUIDPipe) consignmentId: string,
  ) {
    return this.trackingService.findByConsignment(consignmentId);
  }
}
