@movmo_app/types 1.1.1 → 1.2.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.
package/dist/auth.d.ts CHANGED
@@ -14,3 +14,10 @@ export declare enum AuthenticationChallengeResponse {
14
14
  SMS_OTP_CODE = "SMS_OTP_CODE",
15
15
  EMAIL_OTP_CODE = "EMAIL_OTP_CODE"
16
16
  }
17
+ /**
18
+ * Response from the login endpoint.
19
+ */
20
+ export type LoginUserResponse = {
21
+ session: string;
22
+ challengeName?: AuthenticationChallengeName;
23
+ };
package/dist/booking.js CHANGED
@@ -16,5 +16,3 @@ var TravelerType;
16
16
  TravelerType["CHILD"] = "child";
17
17
  TravelerType["INFANT"] = "infant";
18
18
  })(TravelerType || (exports.TravelerType = TravelerType = {}));
19
- ;
20
- ;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Identity document types supported by the API.
3
+ */
4
+ export type IdentityDocumentType = 'passport' | 'visa' | 'drivers_license' | 'national_id' | 'known_traveler_number' | 'redress_number' | 'tax_id';
5
+ /**
6
+ * PassengerIdentityDocument represents a persisted identity document in the database.
7
+ * JSON field names use snake_case to match the Go backend.
8
+ */
9
+ export type PassengerIdentityDocument = {
10
+ id: string;
11
+ user_passenger_id: string;
12
+ document_type: IdentityDocumentType;
13
+ document_number: string;
14
+ issuing_country_code: string;
15
+ issuing_authority?: string;
16
+ issued_date?: string;
17
+ expires_on?: string;
18
+ nationality_on_document?: string;
19
+ birth_country?: string;
20
+ is_primary: boolean;
21
+ created_at?: string;
22
+ updated_at?: string;
23
+ };
24
+ /**
25
+ * Payload for creating or updating an identity document.
26
+ * JSON field names use snake_case to match the Go backend.
27
+ */
28
+ export type IdentityDocumentPayload = {
29
+ document_type: IdentityDocumentType;
30
+ document_number: string;
31
+ issuing_country_code: string;
32
+ issuing_authority?: string;
33
+ issued_date?: string;
34
+ expires_on?: string;
35
+ nationality_on_document?: string;
36
+ birth_country?: string;
37
+ is_primary?: boolean;
38
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/index.d.ts CHANGED
@@ -3,3 +3,10 @@ export * from './customers';
3
3
  export * from './users';
4
4
  export * from './booking';
5
5
  export * from './auth';
6
+ export * from './identity_documents';
7
+ export * from './payments';
8
+ export * from './loyalty_programs';
9
+ export * from './trip_summary';
10
+ export * from './travel_preferences';
11
+ export * from './referrals';
12
+ export * from './sessions';
package/dist/index.js CHANGED
@@ -19,3 +19,10 @@ __exportStar(require("./customers"), exports);
19
19
  __exportStar(require("./users"), exports);
20
20
  __exportStar(require("./booking"), exports);
21
21
  __exportStar(require("./auth"), exports);
22
+ __exportStar(require("./identity_documents"), exports);
23
+ __exportStar(require("./payments"), exports);
24
+ __exportStar(require("./loyalty_programs"), exports);
25
+ __exportStar(require("./trip_summary"), exports);
26
+ __exportStar(require("./travel_preferences"), exports);
27
+ __exportStar(require("./referrals"), exports);
28
+ __exportStar(require("./sessions"), exports);
@@ -0,0 +1,36 @@
1
+ /**
2
+ * LoyaltyProgram represents a user's airline frequent flyer program membership.
3
+ * No backend API exists yet — this type is designed for future CRUD endpoints
4
+ * at /v1/users/:id/loyalty-programs.
5
+ */
6
+ export type LoyaltyProgram = {
7
+ id: string;
8
+ user_id: string;
9
+ airline_name: string;
10
+ airline_iata_code?: string;
11
+ member_number: string;
12
+ points?: number;
13
+ tier_status?: string;
14
+ created_at?: string;
15
+ updated_at?: string;
16
+ };
17
+ /**
18
+ * Payload for creating a new loyalty program entry.
19
+ */
20
+ export type CreateLoyaltyProgramPayload = {
21
+ airline_name: string;
22
+ airline_iata_code?: string;
23
+ member_number: string;
24
+ points?: number;
25
+ tier_status?: string;
26
+ };
27
+ /**
28
+ * Payload for updating an existing loyalty program entry.
29
+ */
30
+ export type UpdateLoyaltyProgramPayload = {
31
+ airline_name?: string;
32
+ airline_iata_code?: string;
33
+ member_number?: string;
34
+ points?: number;
35
+ tier_status?: string;
36
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,40 @@
1
+ /**
2
+ * UserPaymentMethod represents a stored payment method (credit card, etc.).
3
+ * Maps to Go backend's PaymentMethod struct in go-services-core/models/payments.go.
4
+ * JSON field names use camelCase to match the Go backend JSON tags.
5
+ */
6
+ export type UserPaymentMethod = {
7
+ id?: string;
8
+ userId: string;
9
+ methodType: string;
10
+ customerId: string;
11
+ paymentMethodId: string;
12
+ token: string;
13
+ last4: string;
14
+ brand: string;
15
+ expMonth: number;
16
+ expYear: number;
17
+ isDefault?: boolean;
18
+ };
19
+ /**
20
+ * Payload for editing a user's payment method.
21
+ * Maps to Go backend's PaymentMethodEdit struct.
22
+ */
23
+ export type EditUserPaymentMethod = {
24
+ expMonth?: number;
25
+ expYear?: number;
26
+ isDefault?: boolean;
27
+ };
28
+ /**
29
+ * Stripe customer reference for a user.
30
+ * Maps to Go backend's PaymentCustomer struct.
31
+ */
32
+ export type UserPaymentCustomer = {
33
+ customerId: string;
34
+ };
35
+ /**
36
+ * Response from creating a new user passenger.
37
+ */
38
+ export type CreateUserPassengerResponse = {
39
+ id: string;
40
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,24 @@
1
+ /**
2
+ * ReferredUser represents a single user who signed up via a referral link.
3
+ */
4
+ export type ReferredUser = {
5
+ id: string;
6
+ name: string;
7
+ username: string;
8
+ avatar_url?: string;
9
+ sign_up_date: string;
10
+ };
11
+ /**
12
+ * Referral represents a user's referral program data.
13
+ * No backend API exists yet — this type is designed for future
14
+ * GET endpoint at /v1/users/:id/referrals.
15
+ */
16
+ export type Referral = {
17
+ user_id: string;
18
+ total_earnings: number;
19
+ currency: string;
20
+ earnings_since: string;
21
+ referral_link: string;
22
+ referral_code: string;
23
+ referred_users: ReferredUser[];
24
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,19 @@
1
+ /**
2
+ * OTPDeliveryMethod represents how one-time passcodes are delivered.
3
+ */
4
+ export type OTPDeliveryMethod = 'email_and_phone' | 'email_only' | 'phone_only';
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.
9
+ */
10
+ export type Session = {
11
+ id: string;
12
+ user_id: string;
13
+ date: string;
14
+ browser: string;
15
+ device: string;
16
+ city: string;
17
+ country_code: string;
18
+ is_current?: boolean;
19
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,51 @@
1
+ /**
2
+ * SeatType preference as shown in the Figma design.
3
+ */
4
+ export type SeatType = 'window' | 'middle' | 'aisle';
5
+ /**
6
+ * SeatingZone preference as shown in the Figma design.
7
+ */
8
+ export type SeatingZone = 'front' | 'middle' | 'back';
9
+ /**
10
+ * MealType options as shown in the Figma design.
11
+ */
12
+ export type MealType = 'standard' | 'vegetarian' | 'vegan' | 'gluten_free' | 'kosher' | 'halal' | 'diabetic';
13
+ /**
14
+ * SpecialAssistance options as shown in the Figma design.
15
+ */
16
+ export type SpecialAssistance = 'wheelchair_assistance' | 'visual_impairment' | 'hearing_impairment' | 'service_animal' | 'infant_or_child';
17
+ /**
18
+ * SeatPreferences represents the seat section of travel preferences.
19
+ */
20
+ export type SeatPreferences = {
21
+ seat_type?: SeatType;
22
+ seating_zone?: SeatingZone;
23
+ extra_legroom: boolean;
24
+ exit_row: boolean;
25
+ };
26
+ /**
27
+ * BagPreferences represents the bag section of travel preferences.
28
+ */
29
+ export type BagPreferences = {
30
+ check_bag: boolean;
31
+ };
32
+ /**
33
+ * MealPreferences represents the meal section of travel preferences.
34
+ */
35
+ export type MealPreferences = {
36
+ meal_types: MealType[];
37
+ dietary_notes?: string;
38
+ };
39
+ /**
40
+ * TravelPreferences represents a user's saved travel preferences.
41
+ * No backend API exists yet — this type is designed for future
42
+ * GET/PUT endpoints at /v1/users/:id/travel-preferences.
43
+ */
44
+ export type TravelPreferences = {
45
+ user_id: string;
46
+ seat: SeatPreferences;
47
+ bag: BagPreferences;
48
+ meal: MealPreferences;
49
+ special_assistance: SpecialAssistance[];
50
+ updated_at?: string;
51
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,37 @@
1
+ /**
2
+ * TripStatus represents the status of a booking in travel history.
3
+ */
4
+ export type TripStatus = 'upcoming' | 'completed' | 'cancelled';
5
+ /**
6
+ * TripType represents whether a trip is one-way or round-trip.
7
+ */
8
+ export type TripType = 'one_way' | 'round_trip';
9
+ /**
10
+ * TripSummary represents a booking record displayed in the travel history page.
11
+ * This maps to the existing GET /v1/users/:id/bookings endpoint
12
+ * (user_bookings.go in monolith-api).
13
+ */
14
+ export type TripSummary = {
15
+ id: string;
16
+ user_id: string;
17
+ status: TripStatus;
18
+ trip_type: TripType;
19
+ origin_city: string;
20
+ origin_iata_code: string;
21
+ destination_city: string;
22
+ destination_iata_code: string;
23
+ departure_date: string;
24
+ return_date?: string;
25
+ airline_name: string;
26
+ airline_iata_code: string;
27
+ airline_logo_url?: string;
28
+ passenger_count: number;
29
+ adult_count?: number;
30
+ child_count?: number;
31
+ infant_count?: number;
32
+ pnr: string;
33
+ total_price?: string;
34
+ currency?: string;
35
+ created_at?: string;
36
+ updated_at?: string;
37
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/users.d.ts CHANGED
@@ -1,19 +1,72 @@
1
- import { Gender } from "./types";
1
+ import { Gender } from './types';
2
+ import { TravelerType } from './booking';
3
+ /**
4
+ * User represents a registered user in the system.
5
+ * JSON field names use snake_case to match the Go backend.
6
+ */
2
7
  export type User = {
3
8
  id: string;
4
- firstName: string;
5
- middleName?: string;
6
- lastName: string;
7
- suffix: string;
9
+ first_name?: string;
10
+ middle_name?: string;
11
+ last_name?: string;
12
+ suffix?: string;
8
13
  email: string;
9
- phoneNumber: string;
10
- dateOfBirth: string;
11
- gender: Gender;
12
- knownTravelerNumber?: string;
13
- passportNumber?: string;
14
+ phone_number: string;
15
+ date_of_birth?: string;
16
+ gender?: Gender;
17
+ known_traveler_number?: string;
18
+ last_login?: string;
19
+ created_at?: string;
20
+ updated_at?: string;
14
21
  };
22
+ /**
23
+ * UserPassenger represents a passenger owned by a specific user.
24
+ * All PII is stored directly on this struct (no separate passengers table).
25
+ * JSON field names use snake_case to match the Go backend.
26
+ */
15
27
  export type UserPassenger = {
16
- userId: string;
17
- passengerId: string;
18
- isDefault: boolean;
28
+ id: string;
29
+ user_id?: string;
30
+ first_name: string;
31
+ middle_name?: string;
32
+ last_name: string;
33
+ gender: Gender;
34
+ date_of_birth: string;
35
+ email?: string;
36
+ phone_number?: string;
37
+ nationality?: string;
38
+ traveler_type?: TravelerType;
39
+ is_default: boolean;
40
+ created_at?: string;
41
+ updated_at?: string;
42
+ };
43
+ /**
44
+ * Payload for creating a new user passenger.
45
+ * JSON field names use snake_case to match the Go backend.
46
+ */
47
+ export type CreateUserPassengerPayload = {
48
+ first_name: string;
49
+ middle_name?: string;
50
+ last_name: string;
51
+ gender: Gender | string;
52
+ date_of_birth: string;
53
+ email?: string;
54
+ phone_number?: string;
55
+ nationality?: string;
56
+ is_default?: boolean;
57
+ };
58
+ /**
59
+ * Payload for updating an existing user passenger.
60
+ * JSON field names use snake_case to match the Go backend.
61
+ */
62
+ export type UpdateUserPassengerPayload = {
63
+ first_name?: string;
64
+ middle_name?: string;
65
+ last_name?: string;
66
+ gender?: Gender | string;
67
+ date_of_birth?: string;
68
+ email?: string;
69
+ phone_number?: string;
70
+ nationality?: string;
71
+ is_default?: boolean;
19
72
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movmo_app/types",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "A collection of Movmo's types",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -27,4 +27,4 @@
27
27
  "url": "https://github.com/movmo-app/react-js-packages/issues"
28
28
  },
29
29
  "homepage": "https://github.com/movmo-app/react-js-packages/blob/main/packages/@movmo_app/types/README.md"
30
- }
30
+ }