mirror of
https://gitlab.com/mobicoop/v3/service/matcher.git
synced 2026-02-22 20:10:45 +00:00
handle excluded ad in query and selector
This commit is contained in:
@@ -26,6 +26,7 @@ export class MatchQuery extends QueryBase {
|
|||||||
seatsRequested?: number;
|
seatsRequested?: number;
|
||||||
strict?: boolean;
|
strict?: boolean;
|
||||||
readonly waypoints: Waypoint[];
|
readonly waypoints: Waypoint[];
|
||||||
|
excludedAdId?: string;
|
||||||
algorithmType?: AlgorithmType;
|
algorithmType?: AlgorithmType;
|
||||||
remoteness?: number;
|
remoteness?: number;
|
||||||
useProportion?: boolean;
|
useProportion?: boolean;
|
||||||
@@ -56,6 +57,7 @@ export class MatchQuery extends QueryBase {
|
|||||||
this.seatsRequested = props.seatsRequested;
|
this.seatsRequested = props.seatsRequested;
|
||||||
this.strict = props.strict;
|
this.strict = props.strict;
|
||||||
this.waypoints = props.waypoints;
|
this.waypoints = props.waypoints;
|
||||||
|
this.excludedAdId = props.excludedAdId;
|
||||||
this.algorithmType = props.algorithmType;
|
this.algorithmType = props.algorithmType;
|
||||||
this.remoteness = props.remoteness;
|
this.remoteness = props.remoteness;
|
||||||
this.useProportion = props.useProportion;
|
this.useProportion = props.useProportion;
|
||||||
|
|||||||
@@ -136,6 +136,7 @@ export class PassengerOrientedSelector extends Selector {
|
|||||||
this._whereStrict(),
|
this._whereStrict(),
|
||||||
this._whereDate(),
|
this._whereDate(),
|
||||||
this._whereSchedule(role),
|
this._whereSchedule(role),
|
||||||
|
this._whereExcludedAd(),
|
||||||
this._whereAzimuth(),
|
this._whereAzimuth(),
|
||||||
this._whereProportion(role),
|
this._whereProportion(role),
|
||||||
this._whereRemoteness(role),
|
this._whereRemoteness(role),
|
||||||
@@ -206,6 +207,9 @@ export class PassengerOrientedSelector extends Selector {
|
|||||||
return '';
|
return '';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private _whereExcludedAd = (): string =>
|
||||||
|
this.query.excludedAdId ? `ad.uuid <> '${this.query.excludedAdId}'` : '';
|
||||||
|
|
||||||
private _wherePassengerSchedule = (
|
private _wherePassengerSchedule = (
|
||||||
date: Date,
|
date: Date,
|
||||||
scheduleItem: ScheduleItem,
|
scheduleItem: ScheduleItem,
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ const matchQuery = new MatchQuery(
|
|||||||
],
|
],
|
||||||
strict: false,
|
strict: false,
|
||||||
waypoints: [originWaypoint, destinationWaypoint],
|
waypoints: [originWaypoint, destinationWaypoint],
|
||||||
|
excludedAdId: '758618c6-dd82-4199-a548-0205161b04d7',
|
||||||
},
|
},
|
||||||
bareMockGeorouter,
|
bareMockGeorouter,
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user