@movmo_app/types 1.3.0 → 1.5.0

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,23 @@
1
+ /**
2
+ * BookingPassenger represents a passenger associated with a booking,
3
+ * including full user passenger details and ticketing information.
4
+ * Maps to the BookingPassengerWithDetails model in go-services-core.
5
+ */
6
+ export type BookingPassenger = {
7
+ id: string;
8
+ user_id: string;
9
+ first_name: string;
10
+ middle_name?: string;
11
+ last_name: string;
12
+ gender: string;
13
+ date_of_birth: string;
14
+ traveler_type: string;
15
+ is_default: boolean;
16
+ email?: string;
17
+ phone_number?: string;
18
+ nationality?: string;
19
+ known_traveler_number?: string;
20
+ ticket_number?: string;
21
+ seat_number?: string;
22
+ fare_basis_code?: string;
23
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/index.d.ts CHANGED
@@ -10,3 +10,5 @@ export * from './trip_summary';
10
10
  export * from './travel_preferences';
11
11
  export * from './referrals';
12
12
  export * from './sessions';
13
+ export * from './booking_passenger';
14
+ export * from './movmo_flight_offer';
package/dist/index.js CHANGED
@@ -26,3 +26,5 @@ __exportStar(require("./trip_summary"), exports);
26
26
  __exportStar(require("./travel_preferences"), exports);
27
27
  __exportStar(require("./referrals"), exports);
28
28
  __exportStar(require("./sessions"), exports);
29
+ __exportStar(require("./booking_passenger"), exports);
30
+ __exportStar(require("./movmo_flight_offer"), exports);
@@ -0,0 +1,225 @@
1
+ /**
2
+ * MovmoFlightOffer type tree — shared types for the normalized flight offer model.
3
+ * These mirror the Go models in go-services-core/models/flights.go.
4
+ *
5
+ * Originally defined in flights-ui/src/services/flights.ts.
6
+ * NOTE: The existing FlightOffer type in booking.ts is a legacy model with a
7
+ * completely different shape. Both coexist — no breaking changes.
8
+ */
9
+ export type MovmoConditionDetail = {
10
+ penalty_currency?: string;
11
+ penalty_amount?: string;
12
+ allowed: boolean;
13
+ };
14
+ export type MovmoConditions = {
15
+ refunds_before_departure?: MovmoConditionDetail;
16
+ changes_before_departure?: MovmoConditionDetail;
17
+ };
18
+ export type MovmoPaymentRequirements = {
19
+ requires_instant_payment: boolean;
20
+ price_guarantee_expires_at?: string;
21
+ payment_required_by?: string;
22
+ };
23
+ export type MovmoPrivateFare = {
24
+ corporate_code?: string;
25
+ tour_code?: string;
26
+ tracking_reference?: string;
27
+ };
28
+ export type MovmoAvailableService = {
29
+ id: string;
30
+ type: string;
31
+ total_amount: string;
32
+ total_currency: string;
33
+ segment_ids?: string[];
34
+ passenger_ids?: string[];
35
+ maximum_quantity?: number;
36
+ };
37
+ export type MovmoIdentityDocument = {
38
+ expires_on: string;
39
+ issuing_country_code: string;
40
+ type: string;
41
+ unique_identifier: string;
42
+ };
43
+ export type MovmoLoyaltyProgrammeAccount = {
44
+ airline_iata_code: string;
45
+ account_number: string;
46
+ };
47
+ export type MovmoPassenger = {
48
+ id: string;
49
+ provider_passenger_id: string;
50
+ type?: string;
51
+ age?: number;
52
+ first_name?: string;
53
+ middle_name?: string;
54
+ last_name?: string;
55
+ fare_type?: string;
56
+ born_on?: string;
57
+ email?: string;
58
+ phone_number?: string;
59
+ title?: string;
60
+ gender?: string;
61
+ known_traveler_number?: string;
62
+ passport_number?: string;
63
+ identity_documents?: MovmoIdentityDocument[];
64
+ loyalty_programme_accounts?: MovmoLoyaltyProgrammeAccount[];
65
+ traveler_type?: string;
66
+ };
67
+ export type MovmoCarrier = {
68
+ id: string;
69
+ name: string;
70
+ logo_symbol_url?: string;
71
+ logo_lockup_url?: string;
72
+ iata_code?: string;
73
+ conditions_of_carriage_url?: string;
74
+ };
75
+ export type MovmoCity = {
76
+ id: string;
77
+ name: string;
78
+ iata_country_code?: string;
79
+ iata_code: string;
80
+ airports?: MovmoPlace[];
81
+ };
82
+ export type MovmoPlace = {
83
+ id: string;
84
+ type: string;
85
+ time_zone: string;
86
+ name: string;
87
+ longitude: number;
88
+ latitude: number;
89
+ icao_code: string;
90
+ iata_country_code: string;
91
+ iata_code: string;
92
+ iata_city_code: string;
93
+ city_name: string;
94
+ city?: MovmoCity;
95
+ airports?: MovmoPlace[];
96
+ };
97
+ export type MovmoWifiAmenity = {
98
+ cost?: string;
99
+ available?: boolean;
100
+ };
101
+ export type MovmoPowerAmenity = {
102
+ available?: boolean;
103
+ };
104
+ export type MovmoSeatAmenity = {
105
+ type?: string;
106
+ pitch?: string;
107
+ legroom?: string;
108
+ };
109
+ export type MovmoCabinAmenities = {
110
+ wifi?: MovmoWifiAmenity;
111
+ seat?: MovmoSeatAmenity;
112
+ power?: MovmoPowerAmenity;
113
+ };
114
+ export type MovmoCabin = {
115
+ name: string;
116
+ marketing_name?: string;
117
+ amenities?: MovmoCabinAmenities;
118
+ };
119
+ export type MovmoBaggage = {
120
+ type: string;
121
+ quantity: number;
122
+ };
123
+ export type MovmoSegmentPassenger = {
124
+ passenger_id: string;
125
+ fare_basis_code?: string;
126
+ cabin_class: CabinClass;
127
+ cabin_class_marketing_name?: string;
128
+ cabin?: MovmoCabin;
129
+ baggages?: MovmoBaggage[];
130
+ };
131
+ export type MovmoAircraft = {
132
+ id: string;
133
+ name: string;
134
+ iata_code: string;
135
+ };
136
+ export type MovmoStop = {
137
+ id: string;
138
+ duration: string;
139
+ departing_at: string;
140
+ arriving_at: string;
141
+ airport: MovmoPlace;
142
+ };
143
+ export type MovmoSegment = {
144
+ id: string;
145
+ origin: MovmoPlace;
146
+ destination: MovmoPlace;
147
+ departing_at: string;
148
+ arriving_at: string;
149
+ duration?: string;
150
+ distance?: string;
151
+ origin_terminal?: string;
152
+ destination_terminal?: string;
153
+ marketing_carrier: MovmoCarrier;
154
+ marketing_carrier_flight_number: string;
155
+ operating_carrier: MovmoCarrier;
156
+ operating_carrier_flight_number?: string;
157
+ aircraft?: MovmoAircraft;
158
+ passengers?: MovmoSegmentPassenger[];
159
+ stops?: MovmoStop[];
160
+ is_overnight: boolean;
161
+ layover_duration?: string;
162
+ };
163
+ export type MovmoSliceConditions = {
164
+ priorityCheckIn?: boolean;
165
+ priorityBoarding?: boolean;
166
+ changesBeforeDeparture?: MovmoConditionDetail;
167
+ advanceSeatSelection?: boolean;
168
+ };
169
+ export type MovmoOfferSlice = {
170
+ id: string;
171
+ origin_type: string;
172
+ origin: MovmoPlace;
173
+ destination_type: string;
174
+ destination: MovmoPlace;
175
+ segments: MovmoSegment[];
176
+ duration?: string;
177
+ fare_brand_name?: string;
178
+ conditions?: MovmoSliceConditions;
179
+ comparison_key?: string;
180
+ ngs_shelf?: number;
181
+ arrives_on_different_day?: boolean;
182
+ };
183
+ export type BoardingPriority = 'last' | 'standard' | 'early' | 'priority';
184
+ export type CabinClass = 'economy' | 'premium_economy' | 'business' | 'first';
185
+ export type FareClassMetadata = {
186
+ seat_selection_allowed: boolean;
187
+ seat_selection_fee?: string;
188
+ seat_selection_currency?: string;
189
+ extra_legroom: boolean;
190
+ carry_on_bags: number;
191
+ checked_bags: number;
192
+ checked_bags_paid: boolean;
193
+ changes_allowed: boolean;
194
+ change_penalty_amount?: string;
195
+ change_penalty_currency?: string;
196
+ refunds_allowed: boolean;
197
+ refund_penalty_amount?: string;
198
+ refund_penalty_currency?: string;
199
+ boarding_priority: BoardingPriority;
200
+ };
201
+ export type MovmoFlightOffer = {
202
+ id: string;
203
+ provider_id: string;
204
+ created_at: string;
205
+ updated_at: string;
206
+ expires_at: string;
207
+ total_amount: string;
208
+ total_currency: string;
209
+ base_amount: string;
210
+ base_currency: string;
211
+ tax_amount?: string;
212
+ tax_currency?: string;
213
+ total_emissions_kg?: string;
214
+ passenger_identity_documents_required: boolean;
215
+ supported_passenger_identity_document_types: string[];
216
+ supported_loyalty_programmes: string[];
217
+ owner: MovmoCarrier;
218
+ passengers: MovmoPassenger[];
219
+ slices: MovmoOfferSlice[];
220
+ conditions: MovmoConditions;
221
+ payment_requirements: MovmoPaymentRequirements;
222
+ private_fares?: MovmoPrivateFare[];
223
+ available_services?: MovmoAvailableService[];
224
+ fare_class_metadata?: FareClassMetadata;
225
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ /**
3
+ * MovmoFlightOffer type tree — shared types for the normalized flight offer model.
4
+ * These mirror the Go models in go-services-core/models/flights.go.
5
+ *
6
+ * Originally defined in flights-ui/src/services/flights.ts.
7
+ * NOTE: The existing FlightOffer type in booking.ts is a legacy model with a
8
+ * completely different shape. Both coexist — no breaking changes.
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -3,9 +3,25 @@
3
3
  */
4
4
  export type OTPDeliveryMethod = 'email_and_phone' | 'email_only' | 'phone_only';
5
5
  /**
6
- * Session represents a login session record displayed on the Security page.
7
- * No backend API exists yet — this type is designed for future
8
- * GET/DELETE endpoints at /v1/users/:id/sessions.
6
+ * AuthEvent represents a recorded authentication event returned by
7
+ * GET /v1/users/me/auth-events.
8
+ */
9
+ export type AuthEvent = {
10
+ id: string;
11
+ user_id: string;
12
+ event_type: 'sign_in' | 'sign_up';
13
+ browser: string;
14
+ device_type: string;
15
+ os: string;
16
+ ip_address: string;
17
+ city: string;
18
+ country: string;
19
+ timezone: string;
20
+ created_at: string;
21
+ };
22
+ /**
23
+ * @deprecated Use AuthEvent instead. This type was a placeholder before the
24
+ * auth events API existed.
9
25
  */
10
26
  export type Session = {
11
27
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movmo_app/types",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
4
4
  "description": "A collection of Movmo's types",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",