28 lines
751 B
TypeScript
28 lines
751 B
TypeScript
import { Controller, Get } from '@nestjs/common';
|
|
import { ShipmentsService } from '@/shipments/shipments.service';
|
|
import { ApiExtraModels, ApiOkResponse, getSchemaPath } from '@nestjs/swagger';
|
|
import {
|
|
ShipmentContainerDto,
|
|
ShipmentDto,
|
|
ShipmentLiveTrackingDto,
|
|
} from '@/dtos/shipment.dto';
|
|
|
|
@Controller('shipments')
|
|
@ApiExtraModels(ShipmentDto, ShipmentContainerDto, ShipmentLiveTrackingDto)
|
|
export class ShipmentsController {
|
|
constructor(private readonly shipmentsService: ShipmentsService) {}
|
|
|
|
@Get()
|
|
@ApiOkResponse({
|
|
description: 'Returns a list of shipments',
|
|
schema: {
|
|
items: {
|
|
$ref: getSchemaPath(ShipmentDto),
|
|
},
|
|
},
|
|
})
|
|
getShipments() {
|
|
return this.shipmentsService.getShipments();
|
|
}
|
|
}
|