@pulsecharterconnect/types 0.2.51 → 0.2.53

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.
@@ -0,0 +1,53 @@
1
+ export declare enum EventTypes {
2
+ EMAIL_NOTIFICATION = "EMAIL-NOTIFICATION",
3
+ SMS_NOTIFICATION = "SMS-NOTIFICATION",
4
+ VOICE_NOTIFICATION = "VOICE-NOTIFICATION",
5
+ IN_APP_NOTIFICATION = "IN-APP-NOTIFICATION",
6
+ TRANSPORTATION_REQUEST_CREATED = "TRANSPORTATION-REQUEST-CREATED",
7
+ TRANSPORTATION_REQUEST_UPDATED = "TRANSPORTATION-REQUEST-UPDATED",
8
+ TRANSPORTATION_REQUEST_CANCELLED = "TRANSPORTATION-REQUEST-CANCELLED",
9
+ TRANSPORTATION_REQUEST_SUBMITTED_FOR_PROPOSAL = "TRANSPORTATION-REQUEST-SUBMITTED-FOR-PROPOSAL",
10
+ REQUEST_FOR_PROPOSAL_CREATED = "REQUEST-FOR-PROPOSAL-CREATED",
11
+ REQUEST_FOR_PROPOSAL_ACCEPTED = "REQUEST-FOR-PROPOSAL-ACCEPTED",
12
+ REQUEST_FOR_PROPOSAL_DECLINED = "REQUEST-FOR-PROPOSAL-DECLINED",
13
+ USER_INACTIVATED = "USER-INACTIVATED",
14
+ USER_DELETED = "USER-DELETED",
15
+ USER_CREATED = "USER-CREATED",
16
+ USER_INVITED = "USER-INVITED",
17
+ TRIP_CREATED = "TRIP-CREATED",
18
+ TRIP_UPDATED = "TRIP-UPDATED",
19
+ TRIP_CANCELLED = "TRIP-CANCELLED",
20
+ TRIP_STARTED = "TRIP-STARTED",
21
+ TRIP_COMPLETED = "TRIP-COMPLETED",
22
+ TRIP_ABORTED = "TRIP-ABORTED",
23
+ TRIP_SEGMENT_STATUS_CHANGED = "TRIP-SEGMENT-STATUS-CHANGED",
24
+ TRIP_PASSENGERS_UPDATED = "TRIP-PASSENGERS-UPDATED",
25
+ TRIP_SURGICAL_SUPPORT_UPDATED = "TRIP-SURGICAL-SUPPORT-UPDATED",
26
+ TRIP_CREW_UPDATED = "TRIP-CREW-UPDATED",
27
+ TRIP_DRIVERS_UPDATED = "TRIP-DRIVERS-UPDATED",
28
+ TRIP_AIRCRAFT_UPDATED = "TRIP-AIRCRAFT-UPDATED",
29
+ TRIP_TIMES_UPDATED = "TRIP-TIMES-UPDATED",
30
+ TRIP_LOCATIONS_UPDATED = "TRIP-LOCATIONS-UPDATED",
31
+ TRIP_OR_INFO_UPDATED = "TRIP-OR-INFO-UPDATED",
32
+ PARTICIPANT_CREATED = "PARTICIPANT-CREATED",
33
+ PARTICIPANT_UPDATED = "PARTICIPANT-UPDATED",
34
+ PARTICIPANT_DELETED = "PARTICIPANT-DELETED",
35
+ PARTICIPANT_ADDED_TO_TRIP = "PARTICIPANT-ADDED-TO-TRIP",
36
+ PARTICIPANT_REMOVED_FROM_TRIP = "PARTICIPANT-REMOVED-FROM-TRIP",
37
+ PARTICIPANT_ROLE_UPDATED = "PARTICIPANT-ROLE-UPDATED",
38
+ PARTICIPANT_PILOT_TIMEOUT_UPDATED = "PARTICIPANT-PILOT-TIMEOUT-UPDATED",
39
+ COMMUNICATIONS_CHANNEL_CREATED = "COMMUNICATIONS-CHANNEL-CREATED"
40
+ }
41
+ export interface IEventLog {
42
+ eventType: EventTypes;
43
+ payload: any;
44
+ createdAt?: number;
45
+ updatedAt?: number;
46
+ }
47
+ export declare class EventLog implements IEventLog {
48
+ eventType: EventTypes;
49
+ payload: any;
50
+ createdAt?: number;
51
+ updatedAt?: number;
52
+ constructor(eventLog: IEventLog);
53
+ }
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EventLog = exports.EventTypes = void 0;
4
+ var EventTypes;
5
+ (function (EventTypes) {
6
+ EventTypes["EMAIL_NOTIFICATION"] = "EMAIL-NOTIFICATION";
7
+ EventTypes["SMS_NOTIFICATION"] = "SMS-NOTIFICATION";
8
+ EventTypes["VOICE_NOTIFICATION"] = "VOICE-NOTIFICATION";
9
+ EventTypes["IN_APP_NOTIFICATION"] = "IN-APP-NOTIFICATION";
10
+ EventTypes["TRANSPORTATION_REQUEST_CREATED"] = "TRANSPORTATION-REQUEST-CREATED";
11
+ EventTypes["TRANSPORTATION_REQUEST_UPDATED"] = "TRANSPORTATION-REQUEST-UPDATED";
12
+ EventTypes["TRANSPORTATION_REQUEST_CANCELLED"] = "TRANSPORTATION-REQUEST-CANCELLED";
13
+ EventTypes["TRANSPORTATION_REQUEST_SUBMITTED_FOR_PROPOSAL"] = "TRANSPORTATION-REQUEST-SUBMITTED-FOR-PROPOSAL";
14
+ EventTypes["REQUEST_FOR_PROPOSAL_CREATED"] = "REQUEST-FOR-PROPOSAL-CREATED";
15
+ EventTypes["REQUEST_FOR_PROPOSAL_ACCEPTED"] = "REQUEST-FOR-PROPOSAL-ACCEPTED";
16
+ EventTypes["REQUEST_FOR_PROPOSAL_DECLINED"] = "REQUEST-FOR-PROPOSAL-DECLINED";
17
+ EventTypes["USER_INACTIVATED"] = "USER-INACTIVATED";
18
+ EventTypes["USER_DELETED"] = "USER-DELETED";
19
+ EventTypes["USER_CREATED"] = "USER-CREATED";
20
+ EventTypes["USER_INVITED"] = "USER-INVITED";
21
+ EventTypes["TRIP_CREATED"] = "TRIP-CREATED";
22
+ EventTypes["TRIP_UPDATED"] = "TRIP-UPDATED";
23
+ EventTypes["TRIP_CANCELLED"] = "TRIP-CANCELLED";
24
+ EventTypes["TRIP_STARTED"] = "TRIP-STARTED";
25
+ EventTypes["TRIP_COMPLETED"] = "TRIP-COMPLETED";
26
+ EventTypes["TRIP_ABORTED"] = "TRIP-ABORTED";
27
+ EventTypes["TRIP_SEGMENT_STATUS_CHANGED"] = "TRIP-SEGMENT-STATUS-CHANGED";
28
+ EventTypes["TRIP_PASSENGERS_UPDATED"] = "TRIP-PASSENGERS-UPDATED";
29
+ EventTypes["TRIP_SURGICAL_SUPPORT_UPDATED"] = "TRIP-SURGICAL-SUPPORT-UPDATED";
30
+ EventTypes["TRIP_CREW_UPDATED"] = "TRIP-CREW-UPDATED";
31
+ EventTypes["TRIP_DRIVERS_UPDATED"] = "TRIP-DRIVERS-UPDATED";
32
+ EventTypes["TRIP_AIRCRAFT_UPDATED"] = "TRIP-AIRCRAFT-UPDATED";
33
+ EventTypes["TRIP_TIMES_UPDATED"] = "TRIP-TIMES-UPDATED";
34
+ EventTypes["TRIP_LOCATIONS_UPDATED"] = "TRIP-LOCATIONS-UPDATED";
35
+ EventTypes["TRIP_OR_INFO_UPDATED"] = "TRIP-OR-INFO-UPDATED";
36
+ EventTypes["PARTICIPANT_CREATED"] = "PARTICIPANT-CREATED";
37
+ EventTypes["PARTICIPANT_UPDATED"] = "PARTICIPANT-UPDATED";
38
+ EventTypes["PARTICIPANT_DELETED"] = "PARTICIPANT-DELETED";
39
+ EventTypes["PARTICIPANT_ADDED_TO_TRIP"] = "PARTICIPANT-ADDED-TO-TRIP";
40
+ EventTypes["PARTICIPANT_REMOVED_FROM_TRIP"] = "PARTICIPANT-REMOVED-FROM-TRIP";
41
+ EventTypes["PARTICIPANT_ROLE_UPDATED"] = "PARTICIPANT-ROLE-UPDATED";
42
+ EventTypes["PARTICIPANT_PILOT_TIMEOUT_UPDATED"] = "PARTICIPANT-PILOT-TIMEOUT-UPDATED";
43
+ EventTypes["COMMUNICATIONS_CHANNEL_CREATED"] = "COMMUNICATIONS-CHANNEL-CREATED";
44
+ })(EventTypes = exports.EventTypes || (exports.EventTypes = {}));
45
+ class EventLog {
46
+ constructor(eventLog) {
47
+ this.eventType = eventLog.eventType;
48
+ this.payload = eventLog.payload;
49
+ this.createdAt = eventLog.createdAt;
50
+ this.updatedAt = eventLog.updatedAt;
51
+ }
52
+ }
53
+ exports.EventLog = EventLog;
@@ -1,6 +1,7 @@
1
1
  import { Duration } from "luxon";
2
2
  import { Facility, GroundService } from "./Organization";
3
3
  import { ITripSegment } from "./Trip";
4
+ import { IEventLog } from "./EventLogger";
4
5
  export declare const DISTANCE_THRESHOLD_MILES_AIR_VS_GROUND = 100;
5
6
  export declare const AVERAGE_AIR_SPEED = 450;
6
7
  export declare enum TransportationRequestStatus {
@@ -154,6 +155,7 @@ export interface ITransportationRequest {
154
155
  transportationOptions: TransportationOptions;
155
156
  status: TransportationRequestStatus;
156
157
  cancellationReason?: string;
158
+ eventLog?: IEventLog[];
157
159
  createdAt?: number;
158
160
  updatedAt?: number;
159
161
  }
@@ -177,6 +179,7 @@ export declare class TransportationRequest implements ITransportationRequest {
177
179
  transportationOptions: TransportationOptions;
178
180
  status: TransportationRequestStatus;
179
181
  cancellationReason?: string | undefined;
182
+ eventLog?: IEventLog[] | undefined;
180
183
  createdAt?: number;
181
184
  updatedAt?: number;
182
185
  constructor(transportationRequest: ITransportationRequest);
@@ -190,6 +190,7 @@ class TransportationRequest {
190
190
  this.transportationOptions = transportationRequest.transportationOptions;
191
191
  this.status = transportationRequest.status;
192
192
  this.cancellationReason = transportationRequest.cancellationReason;
193
+ this.eventLog = transportationRequest.eventLog;
193
194
  this.createdAt = transportationRequest.createdAt;
194
195
  this.updatedAt = transportationRequest.updatedAt;
195
196
  }
@@ -1,7 +1,7 @@
1
1
  import { ICommunicationsChannel } from "./Communications";
2
2
  import { IFlightTrackingLocation } from "./FlightTracking";
3
3
  import { Facility, GroundService } from "./Organization";
4
- import { IProposalSegment } from "./Proposal";
4
+ import { IProposalSegment, TypeOfService } from "./Proposal";
5
5
  import { OrganType, RecoveryType } from "./TransportationRequest";
6
6
  export declare enum TripStatus {
7
7
  PREPARATION = "preparation",
@@ -263,3 +263,7 @@ export declare class Trip implements ITrip {
263
263
  constructor(trip: ITrip);
264
264
  }
265
265
  export declare function sortTripSegments(tripSegments: Array<ITripSegment>): Array<ITripSegment>;
266
+ export declare function isSelectedOperator(trip: ITrip, transportationOperatorId: string): {
267
+ selected: boolean;
268
+ typeOfServices: TypeOfService[];
269
+ };
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sortTripSegments = exports.Trip = exports.Participant = exports.Gender = exports.TripParticipantRole = exports.TripActions = exports.TripSmartCommsActionIds = exports.SegmentType = exports.OrganRecoveryInProcessStatus = exports.SegmentStatus = exports.getOrganRecoveryInProcessStatusLabel = exports.getSegmentStatusLabel = exports.getTripStatusLabel = exports.TripStatus = void 0;
3
+ exports.isSelectedOperator = exports.sortTripSegments = exports.Trip = exports.Participant = exports.Gender = exports.TripParticipantRole = exports.TripActions = exports.TripSmartCommsActionIds = exports.SegmentType = exports.OrganRecoveryInProcessStatus = exports.SegmentStatus = exports.getOrganRecoveryInProcessStatusLabel = exports.getSegmentStatusLabel = exports.getTripStatusLabel = exports.TripStatus = void 0;
4
+ const Proposal_1 = require("./Proposal");
4
5
  var TripStatus;
5
6
  (function (TripStatus) {
6
7
  TripStatus["PREPARATION"] = "preparation";
@@ -195,3 +196,21 @@ function sortTripSegments(tripSegments) {
195
196
  return tripSegments;
196
197
  }
197
198
  exports.sortTripSegments = sortTripSegments;
199
+ function isSelectedOperator(trip, transportationOperatorId) {
200
+ let selected = false;
201
+ let typeOfServices = [];
202
+ if (trip.tripSegments && trip.tripSegments.length > 0) {
203
+ if (trip.tripSegments.some((segment) => segment.segmentType === SegmentType.AIR_TRANSPORTATION &&
204
+ segment.transportationOperatorId ===
205
+ transportationOperatorId))
206
+ typeOfServices = [...typeOfServices, Proposal_1.TypeOfService.AIR];
207
+ if (trip.tripSegments.some((segment) => segment.segmentType === SegmentType.GROUND_TRANSPORTATION &&
208
+ segment.transportationOperatorId ===
209
+ transportationOperatorId))
210
+ typeOfServices = [...typeOfServices, Proposal_1.TypeOfService.GROUND];
211
+ }
212
+ if (typeOfServices.length > 0)
213
+ selected = true;
214
+ return { selected, typeOfServices };
215
+ }
216
+ exports.isSelectedOperator = isSelectedOperator;
@@ -12,3 +12,4 @@ export * from "./Communications";
12
12
  export * from "./FeatureFlag";
13
13
  export * from "./Case";
14
14
  export * from "./FlightTracking";
15
+ export * from "./EventLogger";
@@ -28,3 +28,4 @@ __exportStar(require("./Communications"), exports);
28
28
  __exportStar(require("./FeatureFlag"), exports);
29
29
  __exportStar(require("./Case"), exports);
30
30
  __exportStar(require("./FlightTracking"), exports);
31
+ __exportStar(require("./EventLogger"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pulsecharterconnect/types",
3
- "version": "0.2.51",
3
+ "version": "0.2.53",
4
4
  "description": "A TypeScript library for enhanced type safety.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",