Skip to content

Commit

Permalink
Merge branch 'main' into orv2-3367
Browse files Browse the repository at this point in the history
  • Loading branch information
krishnan-aot authored Jan 29, 2025
2 parents 122b717 + 81d3916 commit 34c9d00
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ export class ReadShoppingCartDto {
})
duration: number;

@ApiProperty({
description: 'The total distance',
example: 30,
})
totalDistance?: number;

@AutoMap()
@ApiProperty({
enum: PermitApplicationOrigin,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ export class ShoppingCartProfile extends AutomapperProfile {
return +parsedPermitData?.permitDuration;
}),
),
forMember(
(d) => d.totalDistance,
mapFrom((s) => {
const parsedPermitData = JSON.parse(
s?.permitData?.permitData,
) as PermitData;
return +parsedPermitData?.permittedRoute?.manualRoute
?.totalDistance;
}),
),
forMember(
(d) => d.plate,
mapFrom((s) => s?.permitData?.plate),
Expand Down

0 comments on commit 34c9d00

Please sign in to comment.