handle excluded ad in query and selector
This commit is contained in:
parent
0c29e522ed
commit
16ebe8d543
|
@ -26,6 +26,7 @@ export class MatchQuery extends QueryBase {
|
|||
seatsRequested?: number;
|
||||
strict?: boolean;
|
||||
readonly waypoints: Waypoint[];
|
||||
excludedAdId?: string;
|
||||
algorithmType?: AlgorithmType;
|
||||
remoteness?: number;
|
||||
useProportion?: boolean;
|
||||
|
@ -56,6 +57,7 @@ export class MatchQuery extends QueryBase {
|
|||
this.seatsRequested = props.seatsRequested;
|
||||
this.strict = props.strict;
|
||||
this.waypoints = props.waypoints;
|
||||
this.excludedAdId = props.excludedAdId;
|
||||
this.algorithmType = props.algorithmType;
|
||||
this.remoteness = props.remoteness;
|
||||
this.useProportion = props.useProportion;
|
||||
|
|
|
@ -136,6 +136,7 @@ export class PassengerOrientedSelector extends Selector {
|
|||
this._whereStrict(),
|
||||
this._whereDate(),
|
||||
this._whereSchedule(role),
|
||||
this._whereExcludedAd(),
|
||||
this._whereAzimuth(),
|
||||
this._whereProportion(role),
|
||||
this._whereRemoteness(role),
|
||||
|
@ -206,6 +207,9 @@ export class PassengerOrientedSelector extends Selector {
|
|||
return '';
|
||||
};
|
||||
|
||||
private _whereExcludedAd = (): string =>
|
||||
this.query.excludedAdId ? `ad.uuid <> '${this.query.excludedAdId}'` : '';
|
||||
|
||||
private _wherePassengerSchedule = (
|
||||
date: Date,
|
||||
scheduleItem: ScheduleItem,
|
||||
|
|
|
@ -47,6 +47,7 @@ const matchQuery = new MatchQuery(
|
|||
],
|
||||
strict: false,
|
||||
waypoints: [originWaypoint, destinationWaypoint],
|
||||
excludedAdId: '758618c6-dd82-4199-a548-0205161b04d7',
|
||||
},
|
||||
bareMockGeorouter,
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue