| Conditions | 2 |
| Total Lines | 12 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import { QueryHandler } from '@nestjs/cqrs'; |
||
| 14 | |||
| 15 | public async execute(query: GetShippingCostByIdQuery): Promise<ShippingCostView> { |
||
| 16 | const shippingCost = await this.shippingcostRepository.findOneById(query.id); |
||
| 17 | |||
| 18 | if (!shippingCost) { |
||
| 19 | throw new ShippingCostNotFoundException(); |
||
| 20 | } |
||
| 21 | |||
| 22 | return new ShippingCostView( |
||
| 23 | shippingCost.getId(), |
||
| 24 | shippingCost.getGrams(), |
||
| 25 | shippingCost.getPriceFromCents(), |
||
| 26 | ); |
||
| 29 |