diff --git a/src/modules/ad/ad.mapper.ts b/src/modules/ad/ad.mapper.ts index 373ec5d..1eb7f69 100644 --- a/src/modules/ad/ad.mapper.ts +++ b/src/modules/ad/ad.mapper.ts @@ -52,6 +52,7 @@ export class AdMapper seatsProposed: copy.seatsProposed, seatsRequested: copy.seatsRequested, strict: copy.strict, + pause: copy.pause, driverDuration: copy.driverDuration, driverDistance: copy.driverDistance, passengerDuration: copy.passengerDuration, @@ -100,6 +101,7 @@ export class AdMapper seatsProposed: record.seatsProposed, seatsRequested: record.seatsRequested, strict: record.strict, + pause: record.pause, driverDuration: record.driverDuration, driverDistance: record.driverDistance, passengerDuration: record.passengerDuration, diff --git a/src/modules/ad/core/application/commands/create-ad/create-ad.command.ts b/src/modules/ad/core/application/commands/create-ad/create-ad.command.ts index a2f4922..697e68c 100644 --- a/src/modules/ad/core/application/commands/create-ad/create-ad.command.ts +++ b/src/modules/ad/core/application/commands/create-ad/create-ad.command.ts @@ -15,6 +15,7 @@ export class CreateAdCommand extends Command implements UserAd { readonly seatsRequested: number; readonly strict: boolean; readonly waypoints: Address[]; + readonly pause: boolean; constructor(props: CommandProps) { super(props); @@ -29,5 +30,6 @@ export class CreateAdCommand extends Command implements UserAd { this.seatsRequested = props.seatsRequested; this.strict = props.strict; this.waypoints = props.waypoints; + this.pause = props.pause; } } diff --git a/src/modules/ad/core/application/queries/match/match.query.ts b/src/modules/ad/core/application/queries/match/match.query.ts index ed1341a..b3c53e0 100644 --- a/src/modules/ad/core/application/queries/match/match.query.ts +++ b/src/modules/ad/core/application/queries/match/match.query.ts @@ -25,6 +25,7 @@ export class MatchQuery extends QueryBase { seatsProposed?: number; seatsRequested?: number; strict?: boolean; + pause?: boolean; readonly waypoints: Waypoint[]; excludedAdId?: string; algorithmType?: AlgorithmType; diff --git a/src/modules/ad/core/domain/ad.types.ts b/src/modules/ad/core/domain/ad.types.ts index ee68974..5c0b1b1 100644 --- a/src/modules/ad/core/domain/ad.types.ts +++ b/src/modules/ad/core/domain/ad.types.ts @@ -34,6 +34,7 @@ export interface AdProps { passengerDuration?: number; passengerDistance?: number; waypoints: PointProps[]; + pause: boolean; points: PointProps[]; fwdAzimuth: number; backAzimuth: number; @@ -52,6 +53,7 @@ export interface CreateAdProps { seatsRequested: number; strict: boolean; waypoints: PointProps[]; + pause: boolean; driverDuration?: number; driverDistance?: number; passengerDuration?: number; diff --git a/src/modules/ad/infrastructure/ad.repository.ts b/src/modules/ad/infrastructure/ad.repository.ts index 42c2957..a2f5cfb 100644 --- a/src/modules/ad/infrastructure/ad.repository.ts +++ b/src/modules/ad/infrastructure/ad.repository.ts @@ -20,6 +20,7 @@ export type AdModel = { seatsProposed: number; seatsRequested: number; strict: boolean; + pause: boolean; driverDuration?: number; driverDistance?: number; passengerDuration?: number; @@ -158,6 +159,7 @@ export class AdRepository seatsProposed: ungroupedAd.seatsProposed, seatsRequested: ungroupedAd.seatsRequested, strict: ungroupedAd.strict, + pause: ungroupedAd.pause, driverDuration: ungroupedAd.driverDuration, driverDistance: ungroupedAd.driverDistance, passengerDuration: ungroupedAd.passengerDuration, diff --git a/src/modules/ad/interface/message-handlers/ad-created.message-handler.ts b/src/modules/ad/interface/message-handlers/ad-created.message-handler.ts index 0ef7d85..67a3c6f 100644 --- a/src/modules/ad/interface/message-handlers/ad-created.message-handler.ts +++ b/src/modules/ad/interface/message-handlers/ad-created.message-handler.ts @@ -32,6 +32,7 @@ export class AdCreatedMessageHandler { seatsRequested: createdAd.seatsRequested, strict: createdAd.strict, waypoints: createdAd.waypoints, + pause: createdAd.pause, }), ); } catch (error: any) { diff --git a/src/modules/ad/interface/message-handlers/ad.types.ts b/src/modules/ad/interface/message-handlers/ad.types.ts index e1fac43..cea334f 100644 --- a/src/modules/ad/interface/message-handlers/ad.types.ts +++ b/src/modules/ad/interface/message-handlers/ad.types.ts @@ -15,6 +15,7 @@ export type Ad = AdReference & { seatsRequested: number; strict: boolean; waypoints: Waypoint[]; + pause: boolean; }; export type ScheduleItem = { diff --git a/src/modules/ad/tests/unit/ad.mapper.spec.ts b/src/modules/ad/tests/unit/ad.mapper.spec.ts index 6c2a662..ccb46d8 100644 --- a/src/modules/ad/tests/unit/ad.mapper.spec.ts +++ b/src/modules/ad/tests/unit/ad.mapper.spec.ts @@ -37,6 +37,7 @@ const adEntity: AdEntity = new AdEntity({ }, ], strict: false, + pause: false, seatsProposed: 3, seatsRequested: 1, driverDistance: 350101, @@ -89,6 +90,7 @@ const adReadModel: AdReadModel = { fwdAzimuth: 273, backAzimuth: 93, strict: false, + pause: false, seatsProposed: 3, seatsRequested: 1, createdAt: now, diff --git a/src/modules/ad/tests/unit/core/ad.fixtures.ts b/src/modules/ad/tests/unit/core/ad.fixtures.ts index da6db28..f734761 100644 --- a/src/modules/ad/tests/unit/core/ad.fixtures.ts +++ b/src/modules/ad/tests/unit/core/ad.fixtures.ts @@ -28,6 +28,7 @@ export function createAdProps(): CreateAdProps { seatsProposed: 3, seatsRequested: 1, strict: false, + pause: false, waypoints: [originPointProps, destinationPointProps], driverDistance: 23000, driverDuration: 900, diff --git a/src/modules/ad/tests/unit/core/create-ad.service.spec.ts b/src/modules/ad/tests/unit/core/create-ad.service.spec.ts index fb7ac33..89f4963 100644 --- a/src/modules/ad/tests/unit/core/create-ad.service.spec.ts +++ b/src/modules/ad/tests/unit/core/create-ad.service.spec.ts @@ -37,6 +37,7 @@ const createAdProps: CreateAdProps = { seatsProposed: 3, seatsRequested: 1, strict: false, + pause: false, frequency: Frequency.PUNCTUAL, waypoints: [originWaypoint, destinationWaypoint], driverDistance: 23000, diff --git a/src/modules/ad/tests/unit/infrastructure/ad.repository.spec.ts b/src/modules/ad/tests/unit/infrastructure/ad.repository.spec.ts index b0aca47..18b0664 100644 --- a/src/modules/ad/tests/unit/infrastructure/ad.repository.spec.ts +++ b/src/modules/ad/tests/unit/infrastructure/ad.repository.spec.ts @@ -88,6 +88,7 @@ const mockPrismaService = { seatsProposed: 3, seatsRequested: 1, strict: false, + pause: false, driverDistance: 350000, driverDuration: 14400, passengerDistance: 350000,