mirror of
https://gitlab.com/mobicoop/v3/service/matcher.git
synced 2026-01-01 08:32:41 +00:00
use strict null checks
This commit is contained in:
@@ -14,26 +14,20 @@ import { RouteResponseDto } from './interface/dtos/route.response.dto';
|
||||
export class RouteMapper
|
||||
implements Mapper<RouteEntity, undefined, undefined, RouteResponseDto>
|
||||
{
|
||||
toPersistence = (): undefined => {
|
||||
return undefined;
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
toDomain = (): undefined => {
|
||||
return undefined;
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
toResponse = (entity: RouteEntity): RouteResponseDto => {
|
||||
const response = new RouteResponseDto();
|
||||
response.driverDistance = Math.round(entity.getProps().driverDistance);
|
||||
response.driverDuration = Math.round(entity.getProps().driverDuration);
|
||||
response.passengerDistance = Math.round(
|
||||
entity.getProps().passengerDistance,
|
||||
);
|
||||
response.passengerDuration = Math.round(
|
||||
entity.getProps().passengerDuration,
|
||||
);
|
||||
response.driverDistance = entity.getProps().driverDistance
|
||||
? Math.round(entity.getProps().driverDistance as number)
|
||||
: undefined;
|
||||
response.driverDuration = entity.getProps().driverDuration
|
||||
? Math.round(entity.getProps().driverDuration as number)
|
||||
: undefined;
|
||||
response.passengerDistance = entity.getProps().passengerDistance
|
||||
? Math.round(entity.getProps().passengerDistance as number)
|
||||
: undefined;
|
||||
response.passengerDuration = entity.getProps().passengerDuration
|
||||
? Math.round(entity.getProps().passengerDuration as number)
|
||||
: undefined;
|
||||
response.fwdAzimuth = Math.round(entity.getProps().fwdAzimuth);
|
||||
response.backAzimuth = Math.round(entity.getProps().backAzimuth);
|
||||
response.distanceAzimuth = Math.round(entity.getProps().distanceAzimuth);
|
||||
|
||||
Reference in New Issue
Block a user