User Profile
The user profile system manages user preferences, loyalty programs, and personalization settings.
Overview
User profiles store:
- Personal Information — Name, email, phone, address
- Travel Preferences — Accommodation, flight, and transport preferences
- Loyalty Programs — Airline and hotel loyalty memberships
- Documents — Passport and travel document information
Source Code
| Component | Location |
|---|---|
User | models/database_entities/user.py |
UserService | core/services/user_service.py |
UserPreference | models/database_entities/user_preference.py |
UserLoyaltyProgram | models/database_entities/user_loyalty_program.py |
LoyaltyProgramService | core/services/loyalty_program_service.py |
| User Router | api/v1/routers/user_router.py |
Preferences
User preferences are stored in UserPreference and used for TTV Scoring. See TTV Scoring for how preferences evaluate trip options.
Key attributes:
definition_id— Links to preference type (e.g., MaxPricePreference)condition_value— Configuration (e.g.,{"max_price": 200})weight— Importance multiplier (-100 to 100)
Loyalty Programs
Loyalty memberships are stored in UserLoyaltyProgram, linking users to LoyaltyProgram definitions.
Supported program types:
AIRLINE— Aeroplan, Miles & More, etc.HOTEL— Marriott Bonvoy, Hilton Honors, etc.OTHER— Rail, car rental programs
API Endpoints
| Endpoint | Method | Description |
|---|---|---|
/api/users/profile | GET | Get user profile with preferences |
/api/users/profile | PATCH | Update profile fields |
/api/users/preferences | GET | List user preferences |
/api/users/preferences | PUT | Update preferences batch |
/api/loyalty-programs/user | GET | List user loyalty programs |
/api/loyalty-programs/user | POST | Add loyalty program |
See the OpenAPI spec for full request/response schemas.
Related Documentation
- Backend Architecture — Overall architecture
- TTV Scoring — How preferences are used
- Unit of Work — Transaction management