From de239848c38401011ba5d3ca7a5038be6e0e31fd Mon Sep 17 00:00:00 2001 From: Sylvain Briat Date: Tue, 21 Nov 2023 16:32:32 +0100 Subject: [PATCH 1/2] fix bad validation for distance and duration ratio, and for proportion --- .../interface/grpc-controllers/dtos/match.request.dto.ts | 8 ++++---- src/modules/ad/interface/grpc-controllers/matcher.proto | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/modules/ad/interface/grpc-controllers/dtos/match.request.dto.ts b/src/modules/ad/interface/grpc-controllers/dtos/match.request.dto.ts index 70131e2..19777fd 100644 --- a/src/modules/ad/interface/grpc-controllers/dtos/match.request.dto.ts +++ b/src/modules/ad/interface/grpc-controllers/dtos/match.request.dto.ts @@ -2,10 +2,10 @@ import { ArrayMinSize, IsArray, IsBoolean, - IsDecimal, IsEnum, IsISO8601, IsInt, + IsNumber, IsOptional, IsUUID, Max, @@ -93,7 +93,7 @@ export class MatchRequestDto { useProportion?: boolean; @IsOptional() - @IsDecimal() + @IsNumber() @Min(0) @Max(1) proportion?: number; @@ -109,13 +109,13 @@ export class MatchRequestDto { azimuthMargin?: number; @IsOptional() - @IsDecimal() + @IsNumber() @Min(0) @Max(1) maxDetourDistanceRatio?: number; @IsOptional() - @IsDecimal() + @IsNumber() @Min(0) @Max(1) maxDetourDurationRatio?: number; diff --git a/src/modules/ad/interface/grpc-controllers/matcher.proto b/src/modules/ad/interface/grpc-controllers/matcher.proto index 0b774e7..18344dc 100644 --- a/src/modules/ad/interface/grpc-controllers/matcher.proto +++ b/src/modules/ad/interface/grpc-controllers/matcher.proto @@ -19,7 +19,7 @@ message MatchRequest { AlgorithmType algorithmType = 10; int32 remoteness = 11; bool useProportion = 12; - int32 proportion = 13; + float proportion = 13; bool useAzimuth = 14; int32 azimuthMargin = 15; float maxDetourDistanceRatio = 16; From df92231f04a3189f2f439b777de13228f966d289 Mon Sep 17 00:00:00 2001 From: Sylvain Briat Date: Tue, 21 Nov 2023 16:32:41 +0100 Subject: [PATCH 2/2] 1.4.4 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6c3068e..c00c9b1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@mobicoop/matcher", - "version": "1.4.3", + "version": "1.4.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@mobicoop/matcher", - "version": "1.4.3", + "version": "1.4.4", "license": "AGPL", "dependencies": { "@grpc/grpc-js": "^1.9.9", diff --git a/package.json b/package.json index ca73892..aa5c1cf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mobicoop/matcher", - "version": "1.4.3", + "version": "1.4.4", "description": "Mobicoop V3 Matcher", "author": "sbriat", "private": true,