Updated the passenger web portal and added more endpoints to the api

This commit is contained in:
Stephanos A
2026-06-02 14:51:12 +03:00
parent 5059a1fe58
commit ed30ab0cda
34 changed files with 3396 additions and 674 deletions

View File

@@ -314,9 +314,34 @@ Content-Type: application/json
}
```
#### 4. Register International Passenger
#### 4. Universal Passenger Registration (NEW)
```bash
POST /passengers/register-international
# Guest Ethiopian with Fayda verification
POST /passengers/register
Content-Type: application/json
{
"passengerName": "Abebe Kebede",
"dateOfBirth": "1985-03-15",
"nationalId": "ET123456789",
"phone": "+251911234567",
"deviceId": "device-uuid-123"
}
# Logged-in user with JWT token
POST /passengers/register
Authorization: Bearer <jwt-token>
Content-Type: application/json
{
"passengerName": "Abebe Kebede",
"dateOfBirth": "1985-03-15",
"nationalId": "ET123456789",
"phone": "+251911234567"
}
# International passenger (passport)
POST /passengers/register
Content-Type: application/json
{
@@ -326,11 +351,42 @@ Content-Type: application/json
"passportCountry": "Kenya",
"nationality": "Kenyan",
"phone": "+254712345678",
"email": "john@example.com"
"email": "john@example.com",
"deviceId": "device-uuid-123"
}
```
#### 5. Search Trips
#### 5. Get User Profile (NEW)
```bash
GET /auth/profile
Authorization: Bearer <jwt-token>
# Response includes user, passenger, loyalty, and wallet details
{
"id": "uuid",
"email": "user@example.com",
"phone": "+251911234567",
"fullName": "John Doe",
"role": "PASSENGER",
"nationality": "Ethiopian",
"faydaVerified": true,
"faydaVerifiedAt": "2024-01-15T10:30:00.000Z",
"passenger": {
"id": "uuid",
"loyalty": {
"tier": "SILVER",
"pointsBalance": 1500,
"lifetimePoints": 3000
},
"wallet": {
"balanceMinor": 50000,
"currency": "ETB"
}
}
}
```
#### 6. Search Trips
```bash
POST /search
Content-Type: application/json
@@ -344,7 +400,7 @@ Content-Type: application/json
}
```
#### 6. Get Fare Quote
#### 7. Get Fare Quote
```bash
POST /search/fare-quote
Content-Type: application/json
@@ -373,7 +429,7 @@ Content-Type: application/json
}
```
#### 7. Guest Booking (No Login Required)
#### 8. Guest Booking (No Login Required)
```bash
POST /bookings/guest
Content-Type: application/json
@@ -398,7 +454,7 @@ Content-Type: application/json
}
```
#### 8. Agent Booking (IAM Auth)
#### 9. Agent Booking (IAM Auth)
```bash
POST /agents/bookings
Authorization: Bearer <iam-token>