@pulsecharterconnect/types 0.2.44 → 0.2.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -201,7 +201,9 @@ class TransportationRequest {
201
201
  }
202
202
  createTripAirSegmentsFromTransportationRequest(localTimezone, distalTimezone) {
203
203
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
204
- const recoveryTimeDuration = (_a = exports.RECOVERY_TIME_DURATION[this.recoveryType]) !== null && _a !== void 0 ? _a : luxon_1.Duration.fromObject({ hours: 3, minutes: 0 });
204
+ const recoveryTimeDuration = this.transportationRequestType === TransportRequestType.ONE_WAY
205
+ ? luxon_1.Duration.fromObject({ minutes: 0 })
206
+ : (_a = exports.RECOVERY_TIME_DURATION[this.recoveryType]) !== null && _a !== void 0 ? _a : luxon_1.Duration.fromObject({ hours: 3, minutes: 0 });
205
207
  const tripDistanceInMiles = this.tripDistanceInMiles || 0;
206
208
  const flightTime = calculateTravelTime(tripDistanceInMiles, exports.AVERAGE_AIR_SPEED);
207
209
  if (this.transportationRequestType === TransportRequestType.ROUND_TRIP) {
@@ -315,7 +317,9 @@ class TransportationRequest {
315
317
  }
316
318
  createTripGroundSegmentsFromTransportationRequest(localTimezone, distalTimezone) {
317
319
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
318
- const recoveryTimeInMinutes = (_a = exports.RECOVERY_TIME_DURATION[this.recoveryType]) !== null && _a !== void 0 ? _a : luxon_1.Duration.fromObject({ hours: 3, minutes: 0 });
320
+ const recoveryTimeInMinutes = this.transportationRequestType === TransportRequestType.ONE_WAY
321
+ ? luxon_1.Duration.fromObject({ minutes: 0 })
322
+ : (_a = exports.RECOVERY_TIME_DURATION[this.recoveryType]) !== null && _a !== void 0 ? _a : luxon_1.Duration.fromObject({ hours: 3, minutes: 0 });
319
323
  const localAirportLocation = {
320
324
  id: "1234",
321
325
  displayName: `${(_b = this.recipientFacility) === null || _b === void 0 ? void 0 : _b.city} area airport`,
@@ -536,16 +540,20 @@ class TransportationRequest {
536
540
  organRecoveryLocation: this.recoveryLocation,
537
541
  scheduledORTime: this.orDateTimeGMT,
538
542
  scheduledORTimeTimezone: this.orTimezone,
539
- estimatedOrganRecoveryTime: luxon_1.DateTime.fromMillis(this.orDateTimeGMT)
540
- .plus(exports.RECOVERY_TIME_DURATION[this.recoveryType] || "3 hours")
541
- .toMillis(),
543
+ estimatedOrganRecoveryTime: this.transportationRequestType === TransportRequestType.ONE_WAY
544
+ ? 0
545
+ : luxon_1.DateTime.fromMillis(this.orDateTimeGMT, { zone: this.orTimezone })
546
+ .plus(exports.RECOVERY_TIME_DURATION[this.recoveryType] || "3 hours")
547
+ .toMillis(),
542
548
  estimatedOrganRecoveryTimeTimezone: this.orTimezone,
543
549
  surgicalTeam: [],
544
550
  scheduledArrivalTimeTimezone: this.orTimezone,
545
- scheduledDepartureTime: luxon_1.DateTime.fromMillis(this.orDateTimeGMT)
546
- .plus(exports.RECOVERY_TIME_DURATION[this.recoveryType] || "3 hours")
547
- .plus({ minutes: 30 })
548
- .toMillis(),
551
+ scheduledDepartureTime: this.transportationRequestType === TransportRequestType.ONE_WAY
552
+ ? this.orDateTimeGMT
553
+ : luxon_1.DateTime.fromMillis(this.orDateTimeGMT)
554
+ .plus(exports.RECOVERY_TIME_DURATION[this.recoveryType] || "3 hours")
555
+ .plus({ minutes: 30 })
556
+ .toMillis(),
549
557
  scheduledDepartureTimeTimezone: this.orTimezone,
550
558
  };
551
559
  return tripOrganRecoverySegment;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pulsecharterconnect/types",
3
- "version": "0.2.44",
3
+ "version": "0.2.46",
4
4
  "description": "A TypeScript library for enhanced type safety.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",