Booking Lifecycle Management - Test Cases¶
Status: M1-M9 Complete -- This document covers M1 through M9 (Admin Maintenance & Data Health).
1. Introduction¶
1.1 Purpose¶
This document defines the test cases for the Booking Lifecycle Management (BLM) module. It provides comprehensive test scenarios covering functional, integration, and API testing to ensure the module meets all requirements defined in requirements.md.
1.2 Scope¶
This document covers test cases for M1: - Booking CRUD operations - Service line management - Passenger management - Status lifecycle transitions - Option hold and expiry - Amendment tracking - Activity logging - Email notifications - API validation and error handling
1.3 References¶
- Requirements: requirements.md
- Use Cases: use-cases.md
- Technical Implementation: technical-implementation.md
1.4 Test Environment Requirements¶
- TQPro application server running with
TLINQ_HOMEset to theconfig/directory - PostgreSQL database with booking schema deployed (
0044-booking-core.sql) - Test user accounts with
agentandadminroles - API testing tool (Postman, curl, or integration test harness)
- Odoo ERP instance available (or mocked) for ERP integration tests
- Email service configured (or mocked) for notification tests
2. Test Case Summary¶
2.1 Test Case Categories¶
| Category | ID Range | Count | Description |
|---|---|---|---|
| Booking CRUD | TC-BK-001 to TC-BK-007 | 7 | Create, read, update, list, delete bookings |
| Service Line Operations | TC-BK-010 to TC-BK-017 | 8 | Add, update, remove, duplicate, confirm, list service lines |
| Passenger Management | TC-BK-020 to TC-BK-025 | 6 | Add, update, remove, set lead, validate passport |
| Status Lifecycle | TC-BK-030 to TC-BK-038 | 9 | Valid transitions, invalid transitions, cancellation |
| Option Hold | TC-BK-040 to TC-BK-044 | 5 | Set hold, extend, automatic expiry, on-read expiry |
| Amendments | TC-BK-050 to TC-BK-052 | 3 | Auto-amendment on confirmed bookings |
| Activity Log | TC-BK-060 to TC-BK-064 | 5 | Auto-logging, manual notes, querying |
| Notifications | TC-BK-070 to TC-BK-072 | 3 | Confirmation, reminder, expiry notification |
| API Validation | TC-BK-080 to TC-BK-085 | 6 | Missing params, auth, error handling |
| Action Template Management | TC-BK-200 to TC-BK-206 | 7 | Template set and template CRUD operations |
| Action Generation | TC-BK-210 to TC-BK-216 | 7 | Automatic action creation on confirmation |
| Action Operations | TC-BK-220 to TC-BK-230 | 11 | Complete, fail, reassign, custom actions, voucher checks |
| TripMaker Conversion | TC-BK-300 to TC-BK-309 | 10 | Convert QUOTED project to booking, service lines, passengers |
| Inbound Group Conversion | TC-BK-310 to TC-BK-322 | 13 | Create booking from inbound group, re-sync, passengers |
| Source Type Display | TC-BK-325 to TC-BK-327 | 3 | Source badges in booking list UI |
2.2 Priority Definitions¶
| Priority | Description | Execution |
|---|---|---|
| P1 - Critical | Core functionality, blocking issues | Every build |
| P2 - High | Important features, major workflows | Every release |
| P3 - Medium | Secondary features, edge cases | Weekly regression |
| P4 - Low | Minor features, cosmetic issues | Monthly regression |
3. Booking CRUD Test Cases¶
TC-BK-001: Create Booking - Minimal Fields¶
| Attribute | Value |
|---|---|
| ID | TC-BK-001 |
| Title | Create Booking with Minimal Required Fields |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-01 |
| Related Requirements | BK-001, BK-002, BK-003, BK-004, BK-005 |
Preconditions:
- Agent is authenticated with agent role.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/booking/create with { "session": "..." } |
Booking created successfully |
| 2 | Verify response contains bookingId |
bookingId is a positive integer |
| 3 | Verify response contains bookingRef |
bookingRef matches pattern TQ-YYYY-NNNNN |
| 4 | Verify status field | status = "ENQUIRY" |
| 5 | Verify paymentStatus field | paymentStatus = "UNPAID" |
| 6 | Verify currency field | currency = system local currency (e.g., "AED") |
| 7 | Verify createdDate and updatedDate are set | Both are non-null timestamps |
Test Data:
TC-BK-002: Create Booking - Full Fields with Customer¶
| Attribute | Value |
|---|---|
| ID | TC-BK-002 |
| Title | Create Booking with All Fields and New Customer |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-01 |
| Related Requirements | BK-001, BK-006, BK-007, BK-008 |
Preconditions: - Agent is authenticated. Odoo ERP is available.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/booking/create with customer details, dates, currency, notes |
Booking created |
| 2 | Verify customer fields populated | customerId or erpCustomerId is set |
| 3 | Verify travel dates | travelStartDate and travelEndDate match input |
| 4 | Verify currency | currency matches input |
| 5 | Verify ERP references | erpCustomerId and erpLeadId are populated (if ERP available) |
| 6 | Verify assignedAgentId | Set to agent's display name or email |
Test Data:
{
"session": "<valid-session>",
"customerName": "John Smith",
"email": "john.smith@example.com",
"phone": "+971501234567",
"travelStartDate": "2026-05-01",
"travelEndDate": "2026-05-10",
"currency": "USD",
"notes": "Family holiday"
}
TC-BK-003: Create Booking - Unique Reference Generation¶
| Attribute | Value |
|---|---|
| ID | TC-BK-003 |
| Title | Verify Unique Booking Reference Under Concurrent Creation |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-01 |
| Related Requirements | BK-002, BK-NF-003 |
Preconditions: - Agent is authenticated.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | Create 10 bookings in rapid succession | All 10 bookings created |
| 2 | Collect all bookingRef values | All 10 references are unique |
| 3 | Verify reference format | All match TQ-YYYY-NNNNN with sequential numbers |
TC-BK-004: Read Booking by ID¶
| Attribute | Value |
|---|---|
| ID | TC-BK-004 |
| Title | Read Booking by ID |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-09 |
| Related Requirements | BK-040 |
Preconditions: - A booking exists with a known bookingId.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/booking/read with bookingId |
Booking returned |
| 2 | Verify all fields match the created booking | Fields are consistent |
| 3 | POST with non-existent bookingId | Error response with NOTFOUND code |
TC-BK-005: Read Booking by Reference¶
| Attribute | Value |
|---|---|
| ID | TC-BK-005 |
| Title | Read Booking by Reference |
| Priority | P2 - High |
| Related Use Case | UC-BK-09 |
| Related Requirements | BK-040 |
Preconditions: - A booking exists with a known bookingRef.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/booking/readByRef with bookingRef |
Booking returned |
| 2 | Verify bookingRef matches | Exact match |
| 3 | POST with non-existent bookingRef | Error response with NOTFOUND code |
TC-BK-006: Update Booking¶
| Attribute | Value |
|---|---|
| ID | TC-BK-006 |
| Title | Update Booking Fields |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-01 |
| Related Requirements | BK-001 |
Preconditions: - A booking exists.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/booking/update with new notes |
Booking updated |
| 2 | Verify notes field changed | notes matches new value |
| 3 | Verify updatedDate changed | updatedDate is later than before |
| 4 | Verify unchanged fields remain | Other fields unchanged |
TC-BK-007: List Bookings with Filters¶
| Attribute | Value |
|---|---|
| ID | TC-BK-007 |
| Title | List Bookings with Various Filters |
| Priority | P2 - High |
| Related Use Case | UC-BK-08 |
| Related Requirements | BK-039 |
Preconditions: - Multiple bookings exist with different statuses, agents, and dates.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/booking/list with no filters |
All bookings returned |
| 2 | Filter by status = "ENQUIRY" | Only ENQUIRY bookings returned |
| 3 | Filter by agentId | Only bookings for that agent returned |
| 4 | Filter by bookingRef (partial) | Bookings with matching partial ref returned |
| 5 | Filter by date range | Only bookings within range returned |
| 6 | Combine multiple filters | Results match all criteria |
4. Service Line Operations Test Cases¶
TC-BK-010: Add Service Line¶
| Attribute | Value |
|---|---|
| ID | TC-BK-010 |
| Title | Add Service Line to Booking |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-02 |
| Related Requirements | BK-019, BK-020, BK-021, BK-022 |
Preconditions: - A booking exists in ENQUIRY status.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/serviceline/add with HOTEL type, cost=500, sellPrice=700, currency=USD |
Service line created |
| 2 | Verify confirmationStatus | confirmationStatus = "PENDING" |
| 3 | Verify costLocal is populated | costLocal has value in local currency |
| 4 | Read the parent booking | totalCost and totalSell updated |
| 5 | Verify balanceDue | balanceDue = totalSell - totalPaid |
TC-BK-011: Add Service Charge Line¶
| Attribute | Value |
|---|---|
| ID | TC-BK-011 |
| Title | Add Service Charge Line (isServiceCharge=true) |
| Priority | P2 - High |
| Related Use Case | UC-BK-02 |
| Related Requirements | BK-022 |
Preconditions: - A booking exists with at least one regular service line.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/serviceline/add with isServiceCharge=true, sellPrice=50 |
Service charge line created |
| 2 | Read the parent booking | totalServiceCharges includes the 50 |
| 3 | Verify totalSell does not include the service charge | totalSell unchanged |
| 4 | Verify balanceDue includes service charges | balanceDue = totalSell + totalServiceCharges - totalPaid |
TC-BK-012: Update Service Line¶
| Attribute | Value |
|---|---|
| ID | TC-BK-012 |
| Title | Update Service Line Fields |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-02 |
| Related Requirements | BK-023, BK-022 |
Preconditions: - A service line exists on a booking.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/serviceline/update with new sellPrice |
Service line updated |
| 2 | Verify sellPrice changed | Matches new value |
| 3 | Read the parent booking | Totals recalculated with new sell price |
TC-BK-013: Remove Service Line¶
| Attribute | Value |
|---|---|
| ID | TC-BK-013 |
| Title | Remove Service Line from Booking |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-02 |
| Related Requirements | BK-024, BK-022 |
Preconditions: - A booking has at least two service lines.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | Record current booking totals | Note totalCost, totalSell |
| 2 | POST to blm/serviceline/remove |
Service line removed |
| 3 | Verify service line no longer in list | Not returned by serviceline/list |
| 4 | Read the parent booking | Totals reduced by the removed line's values |
TC-BK-014: Duplicate Service Line¶
| Attribute | Value |
|---|---|
| ID | TC-BK-014 |
| Title | Duplicate Service Line |
| Priority | P2 - High |
| Related Use Case | UC-BK-02 |
| Related Requirements | BK-025 |
Preconditions: - A service line exists with CONFIRMED status and a supplier reference.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/serviceline/duplicate |
New service line created |
| 2 | Verify the copy has a different serviceLineId | IDs are different |
| 3 | Verify the copy has confirmationStatus = "PENDING" | Status reset to PENDING |
| 4 | Verify the copy has supplierRef = null | Supplier reference cleared |
| 5 | Verify other fields match the original | serviceType, description, cost, sell, etc. match |
TC-BK-015: Confirm Service Line¶
| Attribute | Value |
|---|---|
| ID | TC-BK-015 |
| Title | Confirm Service Line with Supplier Reference |
| Priority | P2 - High |
| Related Use Case | UC-BK-02 |
| Related Requirements | BK-026 |
Preconditions: - A service line exists with PENDING confirmation status.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/serviceline/confirm with supplierRef="HTL-12345" |
Service line confirmed |
| 2 | Verify confirmationStatus = "CONFIRMED" | Status updated |
| 3 | Verify supplierRef = "HTL-12345" | Reference stored |
TC-BK-016: List Service Lines Sorted¶
| Attribute | Value |
|---|---|
| ID | TC-BK-016 |
| Title | List Service Lines Sorted by Sort Order |
| Priority | P3 - Medium |
| Related Use Case | UC-BK-02 |
| Related Requirements | BK-019 |
Preconditions: - A booking has multiple service lines with different sortOrder values.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/serviceline/list |
Service lines returned |
| 2 | Verify ordering | Lines are sorted by sortOrder ascending |
TC-BK-017: Service Line Currency Conversion¶
| Attribute | Value |
|---|---|
| ID | TC-BK-017 |
| Title | Verify Cost to Local Currency Conversion |
| Priority | P2 - High |
| Related Use Case | UC-BK-02 |
| Related Requirements | BK-021 |
Preconditions: - Exchange rate service is available. Local currency is AED.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | Add service line with cost=100, currency=USD | Service line created |
| 2 | Verify costLocal is populated | costLocal = 100 * USD-to-AED rate |
| 3 | Add service line with cost=200, currency=AED | Service line created |
| 4 | Verify costLocal equals cost | costLocal = 200 (no conversion needed) |
5. Passenger Management Test Cases¶
TC-BK-020: Add Passenger¶
| Attribute | Value |
|---|---|
| ID | TC-BK-020 |
| Title | Add Passenger to Booking |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-03 |
| Related Requirements | BK-030 |
Preconditions: - A booking exists.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/passenger/add with firstName, lastName, and all optional fields |
Passenger created |
| 2 | Verify passengerId assigned | Positive integer |
| 3 | Verify all fields stored correctly | firstName, lastName, DOB, nationality, passport, gender, phone, email |
TC-BK-021: Add Lead Passenger¶
| Attribute | Value |
|---|---|
| ID | TC-BK-021 |
| Title | Add Passenger as Lead and Verify Booking Update |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-03 |
| Related Requirements | BK-031, BK-032 |
Preconditions: - A booking exists with no lead passenger.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/passenger/add with isLead=true |
Passenger created |
| 2 | Read the booking | leadPassengerId = new passenger's ID |
TC-BK-022: Set Lead Passenger¶
| Attribute | Value |
|---|---|
| ID | TC-BK-022 |
| Title | Change Lead Passenger |
| Priority | P2 - High |
| Related Use Case | UC-BK-03 |
| Related Requirements | BK-031, BK-032 |
Preconditions: - A booking has two passengers, one is lead.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/passenger/setLead with the second passenger's ID |
Lead changed |
| 2 | List passengers | Second passenger has isLead=true, first has isLead=false |
| 3 | Read the booking | leadPassengerId = second passenger's ID |
TC-BK-023: Remove Lead Passenger¶
| Attribute | Value |
|---|---|
| ID | TC-BK-023 |
| Title | Remove Lead Passenger and Verify Booking Cleared |
| Priority | P2 - High |
| Related Use Case | UC-BK-03 |
| Related Requirements | BK-032 |
Preconditions: - A booking has a lead passenger.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/passenger/remove with the lead passenger's ID |
Passenger removed |
| 2 | Read the booking | leadPassengerId = null |
TC-BK-024: Update Passenger¶
| Attribute | Value |
|---|---|
| ID | TC-BK-024 |
| Title | Update Passenger Details |
| Priority | P2 - High |
| Related Use Case | UC-BK-03 |
| Related Requirements | BK-030 |
Preconditions: - A passenger exists on a booking.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/passenger/update with new passportNumber |
Passenger updated |
| 2 | Verify passportNumber changed | Matches new value |
| 3 | Verify other fields unchanged | firstName, lastName, etc. remain |
TC-BK-025: Validate Passport Expiry¶
| Attribute | Value |
|---|---|
| ID | TC-BK-025 |
| Title | Validate Passport Expiry Against Travel Date |
| Priority | P2 - High |
| Related Use Case | UC-BK-03 |
| Related Requirements | BK-033 |
Preconditions: - A booking has travelStartDate = 2026-06-01 and two passengers: one with passportExpiry = 2026-08-01 (less than 6 months), one with passportExpiry = 2028-01-01 (valid).
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/passenger/validate |
Warnings returned |
| 2 | Verify one warning for the first passenger | Warning includes passenger name and expiry date |
| 3 | Verify no warning for the second passenger | Only one warning in the list |
6. Status Lifecycle Test Cases¶
TC-BK-030: Valid Transition - ENQUIRY to QUOTED¶
| Attribute | Value |
|---|---|
| ID | TC-BK-030 |
| Title | Transition from ENQUIRY to QUOTED |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-04 |
| Related Requirements | BK-010, BK-011, BK-013, BK-014 |
Preconditions: - A booking exists in ENQUIRY status.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/booking/changeStatus with newStatus="QUOTED" |
Status changed |
| 2 | Verify booking status = "QUOTED" | Status updated |
| 3 | Check status history | New entry with previousStatus=ENQUIRY, newStatus=QUOTED |
| 4 | Check activity log | STATUS_CHANGED entry exists |
TC-BK-031: Valid Transition - QUOTED to CONFIRMED¶
| Attribute | Value |
|---|---|
| ID | TC-BK-031 |
| Title | Transition from QUOTED to CONFIRMED |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-04 |
| Related Requirements | BK-010, BK-011 |
Preconditions: - A booking exists in QUOTED status.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/booking/changeStatus with newStatus="CONFIRMED" |
Status changed |
| 2 | Verify booking status = "CONFIRMED" | Updated |
TC-BK-032: Valid Transition - CONFIRMED to AMENDED¶
| Attribute | Value |
|---|---|
| ID | TC-BK-032 |
| Title | Transition from CONFIRMED to AMENDED |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-04 |
| Related Requirements | BK-010, BK-011 |
Preconditions: - A booking exists in CONFIRMED status.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/booking/changeStatus with newStatus="AMENDED" |
Status changed |
| 2 | Verify booking status = "AMENDED" | Updated |
TC-BK-033: Valid Transition - Full Lifecycle¶
| Attribute | Value |
|---|---|
| ID | TC-BK-033 |
| Title | Walk Through Complete Happy-Path Lifecycle |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-04 |
| Related Requirements | BK-010, BK-011 |
Preconditions: - A new booking is created.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | Create booking | Status = ENQUIRY |
| 2 | Change to QUOTED | Status = QUOTED |
| 3 | Change to CONFIRMED | Status = CONFIRMED |
| 4 | Change to TICKETED | Status = TICKETED |
| 5 | Change to COMPLETED | Status = COMPLETED |
| 6 | Check status history | 5 entries: null->ENQUIRY, ENQUIRY->QUOTED, QUOTED->CONFIRMED, CONFIRMED->TICKETED, TICKETED->COMPLETED |
TC-BK-034: Invalid Transition - ENQUIRY to COMPLETED¶
| Attribute | Value |
|---|---|
| ID | TC-BK-034 |
| Title | Reject Invalid Transition from ENQUIRY to COMPLETED |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-04 |
| Related Requirements | BK-012 |
Preconditions: - A booking exists in ENQUIRY status.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/booking/changeStatus with newStatus="COMPLETED" |
Error response |
| 2 | Verify error message | "Invalid transition from ENQUIRY to COMPLETED" |
| 3 | Verify booking status unchanged | Still ENQUIRY |
TC-BK-035: Invalid Transition - COMPLETED to Any¶
| Attribute | Value |
|---|---|
| ID | TC-BK-035 |
| Title | Reject Transition from Terminal Status COMPLETED |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-04 |
| Related Requirements | BK-012 |
Preconditions: - A booking exists in COMPLETED status.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | Attempt to change to ENQUIRY | Error: invalid transition |
| 2 | Attempt to change to CANCELLED | Error: invalid transition |
| 3 | Booking status remains COMPLETED | Unchanged |
TC-BK-036: Cancel Booking from ENQUIRY¶
| Attribute | Value |
|---|---|
| ID | TC-BK-036 |
| Title | Cancel Booking via Cancel Endpoint |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-04 |
| Related Requirements | BK-010, BK-011 |
Preconditions: - A booking exists in ENQUIRY status.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/booking/cancel with reasonText |
Status changed to CANCELLED |
| 2 | Verify status = "CANCELLED" | Updated |
| 3 | Check status history | Entry with notes containing the reason |
TC-BK-037: Cancel Booking from CONFIRMED¶
| Attribute | Value |
|---|---|
| ID | TC-BK-037 |
| Title | Cancel Confirmed Booking |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-04 |
| Related Requirements | BK-010, BK-011 |
Preconditions: - A booking exists in CONFIRMED status.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/booking/cancel |
Status changed to CANCELLED |
| 2 | Verify status = "CANCELLED" | Updated |
TC-BK-038: Transition EXPIRED to QUOTED (Re-quote)¶
| Attribute | Value |
|---|---|
| ID | TC-BK-038 |
| Title | Re-quote an Expired Booking |
| Priority | P2 - High |
| Related Use Case | UC-BK-04 |
| Related Requirements | BK-010, BK-011 |
Preconditions: - A booking exists in EXPIRED status.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/booking/changeStatus with newStatus="QUOTED" |
Status changed |
| 2 | Verify status = "QUOTED" | Updated |
7. Option Hold Test Cases¶
TC-BK-040: Set Option Hold¶
| Attribute | Value |
|---|---|
| ID | TC-BK-040 |
| Title | Set Option Hold on Quoted Booking |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-05 |
| Related Requirements | BK-015 |
Preconditions: - A booking exists in QUOTED status.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/booking/changeStatus with newStatus="OPTION_HELD", optionExpiryDate="2026-04-15T18:00:00" |
Status changed to OPTION_HELD |
| 2 | Read the booking | optionExpiryDate is set to the specified date |
| 3 | Verify status = "OPTION_HELD" | Updated |
TC-BK-041: Extend Option Hold¶
| Attribute | Value |
|---|---|
| ID | TC-BK-041 |
| Title | Extend Option Hold Expiry Date |
| Priority | P2 - High |
| Related Use Case | UC-BK-05 |
| Related Requirements | BK-016 |
Preconditions: - A booking exists in OPTION_HELD status with an expiry date.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/booking/extendHold with newExpiryDate 7 days later |
Hold extended |
| 2 | Read the booking | optionExpiryDate updated to new date |
| 3 | Verify status still OPTION_HELD | Unchanged |
| 4 | Check activity log | HOLD_EXTENDED entry exists |
TC-BK-042: Extend Hold Rejected for Non-OPTION_HELD¶
| Attribute | Value |
|---|---|
| ID | TC-BK-042 |
| Title | Reject Extend Hold for Non-OPTION_HELD Booking |
| Priority | P2 - High |
| Related Use Case | UC-BK-05 |
| Related Requirements | BK-016 |
Preconditions: - A booking exists in CONFIRMED status.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/booking/extendHold |
Error response |
| 2 | Verify error message | "Booking is not in OPTION_HELD status" |
TC-BK-043: On-Read Option Expiry¶
| Attribute | Value |
|---|---|
| ID | TC-BK-043 |
| Title | Automatic Expiry on Read When Past Deadline |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-05 |
| Related Requirements | BK-017 |
Preconditions: - A booking is in OPTION_HELD status with optionExpiryDate in the past.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/booking/read |
Booking returned with status = "EXPIRED" |
| 2 | Check status history | OPTION_HELD -> EXPIRED transition recorded |
TC-BK-044: Get Expiring Bookings¶
| Attribute | Value |
|---|---|
| ID | TC-BK-044 |
| Title | Query Bookings Expiring Within N Hours |
| Priority | P2 - High |
| Related Use Case | UC-BK-05 |
| Related Requirements | BK-018 |
Preconditions: - Multiple OPTION_HELD bookings exist with varying expiry dates.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/booking/expiring with hoursAhead=24 |
Bookings expiring within 24 hours returned |
| 2 | Verify only bookings with expiryDate <= now+24h are included | Correct filtering |
8. Amendment Test Cases¶
TC-BK-050: Auto-Amendment on Service Line Add¶
| Attribute | Value |
|---|---|
| ID | TC-BK-050 |
| Title | Amendment Created When Adding Service Line to Confirmed Booking |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-02 |
| Related Requirements | BK-027, BK-028, BK-029 |
Preconditions: - A booking exists in CONFIRMED status with totalSell = 1000.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | Add a service line with sellPrice=500 | Service line created |
| 2 | List amendments for the booking | One amendment exists |
| 3 | Verify amendmentNumber = 1 | First amendment |
| 4 | Verify previousTotal = 1000 | Recorded before change |
| 5 | Verify newTotal = 1500 | Recorded after change |
| 6 | Verify description mentions "Service line added" | Descriptive text |
TC-BK-051: Auto-Amendment on Service Line Remove¶
| Attribute | Value |
|---|---|
| ID | TC-BK-051 |
| Title | Amendment Created When Removing Service Line from Confirmed Booking |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-02 |
| Related Requirements | BK-027, BK-028 |
Preconditions: - A booking in CONFIRMED status with at least one service line.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | Record current totalSell | Note the value |
| 2 | Remove a service line | Removed |
| 3 | List amendments | New amendment exists |
| 4 | Verify previous and new totals | Reflect the removal |
TC-BK-052: No Amendment on ENQUIRY Booking¶
| Attribute | Value |
|---|---|
| ID | TC-BK-052 |
| Title | No Amendment Created for Non-Confirmed Booking |
| Priority | P2 - High |
| Related Use Case | UC-BK-02 |
| Related Requirements | BK-027 |
Preconditions: - A booking exists in ENQUIRY status.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | Add a service line | Created |
| 2 | List amendments | Empty list (no amendments) |
9. Activity Log Test Cases¶
TC-BK-060: Auto-Log on Booking Creation¶
| Attribute | Value |
|---|---|
| ID | TC-BK-060 |
| Title | Activity Log Entry Created on Booking Creation |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-06 |
| Related Requirements | BK-034 |
Preconditions: - None (new booking).
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | Create a booking | Booking created |
| 2 | List activity log for the booking | At least one entry |
| 3 | Verify entry with activityType = "BOOKING_CREATED" | Entry exists |
TC-BK-061: Auto-Log on Status Change¶
| Attribute | Value |
|---|---|
| ID | TC-BK-061 |
| Title | Activity Log Entry on Status Transition |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-06 |
| Related Requirements | BK-034 |
Preconditions: - A booking exists.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | Change booking status from ENQUIRY to QUOTED | Status changed |
| 2 | List activity log | Entry with activityType = "STATUS_CHANGED" |
| 3 | Verify description | "Status changed from ENQUIRY to QUOTED" |
TC-BK-062: Auto-Log on Service Line Operations¶
| Attribute | Value |
|---|---|
| ID | TC-BK-062 |
| Title | Activity Log Entries for Service Line Add/Update/Remove |
| Priority | P2 - High |
| Related Use Case | UC-BK-06 |
| Related Requirements | BK-034 |
Preconditions: - A booking exists.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | Add a service line | SERVICE_ADDED log entry |
| 2 | Update the service line | SERVICE_UPDATED log entry |
| 3 | Remove the service line | SERVICE_REMOVED log entry |
TC-BK-063: Add Agent Note¶
| Attribute | Value |
|---|---|
| ID | TC-BK-063 |
| Title | Add Manual Agent Note to Activity Log |
| Priority | P2 - High |
| Related Use Case | UC-BK-06 |
| Related Requirements | BK-035 |
Preconditions: - A booking exists.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/activity/add with note="Customer requested upgrade" |
Note added |
| 2 | List activity log | Entry with activityType = "NOTE_ADDED" |
| 3 | Verify description | Contains the note text |
TC-BK-064: Activity Log Limit¶
| Attribute | Value |
|---|---|
| ID | TC-BK-064 |
| Title | Verify Activity Log Respects Limit Parameter |
| Priority | P3 - Medium |
| Related Use Case | UC-BK-06 |
| Related Requirements | BK-036 |
Preconditions: - A booking has more than 10 activity log entries.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/activity/list with limit=5 |
At most 5 entries returned |
| 2 | POST with no limit | Default (50) entries returned |
10. Notification Test Cases¶
TC-BK-070: Send Booking Confirmation¶
| Attribute | Value |
|---|---|
| ID | TC-BK-070 |
| Title | Send Booking Confirmation Email |
| Priority | P2 - High |
| Related Use Case | UC-BK-07 |
| Related Requirements | BK-037 |
Preconditions: - A booking exists. Email service is configured/mocked.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/booking/sendConfirmation |
Success response "Confirmation sent" |
| 2 | Verify email sent (or mock invoked) | Email composed with booking details |
| 3 | Check activity log | NOTIFICATION_SENT entry exists |
TC-BK-071: Send Payment Reminder¶
| Attribute | Value |
|---|---|
| ID | TC-BK-071 |
| Title | Send Payment Reminder Email |
| Priority | P2 - High |
| Related Use Case | UC-BK-07 |
| Related Requirements | BK-038 |
Preconditions: - A booking exists with balanceDue > 0.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/booking/sendReminder |
Success response "Reminder sent" |
| 2 | Verify email sent | Email contains outstanding balance |
TC-BK-072: Option Expiry Notification¶
| Attribute | Value |
|---|---|
| ID | TC-BK-072 |
| Title | Notification on Option Expiry |
| Priority | P3 - Medium |
| Related Use Case | UC-BK-05 |
| Related Requirements | BK-017 |
Preconditions: - A booking in OPTION_HELD status is past its expiry date.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | OptionExpiryRunner runs and expires the booking | Booking status = EXPIRED |
| 2 | Verify expiry notification sent | Notification triggered |
11. API Validation Test Cases¶
TC-BK-080: Missing Required Parameter - session¶
| Attribute | Value |
|---|---|
| ID | TC-BK-080 |
| Title | Reject Request with Missing Session Parameter |
| Priority | P1 - Critical |
| Related Requirements | BK-NF-001 |
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/booking/read without session |
Error response |
| 2 | Verify error code | INVALID_PARAMETER or equivalent |
TC-BK-081: Missing Required Parameter - bookingId¶
| Attribute | Value |
|---|---|
| ID | TC-BK-081 |
| Title | Reject Request with Missing Booking ID |
| Priority | P1 - Critical |
| Related Requirements | BK-NF-001 |
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/booking/read with session but no bookingId |
Error response |
| 2 | Verify error code | INVALID_PARAMETER |
TC-BK-082: Non-Existent Booking ID¶
| Attribute | Value |
|---|---|
| ID | TC-BK-082 |
| Title | Handle Non-Existent Booking ID Gracefully |
| Priority | P1 - Critical |
| Related Requirements | BK-040 |
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/booking/read with bookingId=999999 |
Error response |
| 2 | Verify error code | NOTFOUND |
| 3 | Verify error message | "Booking not found" |
TC-BK-083: Unauthorized Access - Guest Role¶
| Attribute | Value |
|---|---|
| ID | TC-BK-083 |
| Title | Reject Guest Access to BLM Endpoints |
| Priority | P1 - Critical |
| Related Requirements | BK-NF-001 |
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/booking/list with guest credentials |
Access denied |
| 2 | Verify HTTP status or error code | 401/403 or ACCESS_DENIED |
TC-BK-084: Service Line Missing Required Type¶
| Attribute | Value |
|---|---|
| ID | TC-BK-084 |
| Title | Reject Service Line Without Required Service Type |
| Priority | P2 - High |
| Related Requirements | BK-019 |
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/serviceline/add without serviceType |
Error response |
| 2 | Verify error | INVALID_PARAMETER indicating serviceType is required |
TC-BK-085: Passenger Missing Required Names¶
| Attribute | Value |
|---|---|
| ID | TC-BK-085 |
| Title | Reject Passenger Without First/Last Name |
| Priority | P2 - High |
| Related Requirements | BK-030 |
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/passenger/add with bookingId but no firstName |
Error response |
| 2 | POST with firstName but no lastName | Error response |
| 3 | Verify error | INVALID_PARAMETER for each |
12. M5 -- Actions Framework Test Cases¶
Action Template Management¶
TC-BK-200: List Template Sets¶
| Attribute | Value |
|---|---|
| ID | TC-BK-200 |
| Title | List Action Template Sets |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-18 |
Preconditions:
- Admin is authenticated with admin role.
- At least one action template set exists.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/actiontemplateset/list with session |
Template sets returned |
| 2 | Verify response contains template set entries | Each entry has id, name, serviceType, status |
| 3 | Verify active and inactive sets are both included | Status field distinguishes them |
Automated: Yes
TC-BK-201: Create Template Set¶
| Attribute | Value |
|---|---|
| ID | TC-BK-201 |
| Title | Create Action Template Set |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-18 |
Preconditions:
- Admin is authenticated with admin role.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/actiontemplateset/create with name="Hotel Check-in Actions", serviceType="HOTEL", status="ACTIVE" |
Template set created |
| 2 | Verify response contains templateSetId | Positive integer |
| 3 | Verify name, serviceType, and status match input | Fields stored correctly |
| 4 | List template sets | New set appears in the list |
Automated: Yes
TC-BK-202: Edit Template Set¶
| Attribute | Value |
|---|---|
| ID | TC-BK-202 |
| Title | Edit Action Template Set |
| Priority | P2 - High |
| Related Use Case | UC-BK-18 |
Preconditions: - An action template set exists.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/actiontemplateset/update with new name and description |
Template set updated |
| 2 | Verify name changed | Matches new value |
| 3 | Verify description changed | Matches new value |
| 4 | Verify serviceType unchanged | Original value preserved |
Automated: Yes
TC-BK-203: Deactivate Template Set¶
| Attribute | Value |
|---|---|
| ID | TC-BK-203 |
| Title | Deactivate Action Template Set |
| Priority | P2 - High |
| Related Use Case | UC-BK-18 |
Preconditions: - An active action template set exists.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/actiontemplateset/update with status="INACTIVE" |
Template set deactivated |
| 2 | Verify status = "INACTIVE" | Status updated |
| 3 | Confirm a booking with a service line matching this set's service type | No actions generated for this set |
Automated: Yes
TC-BK-204: Create Action Template via Wizard¶
| Attribute | Value |
|---|---|
| ID | TC-BK-204 |
| Title | Create Action Template with All Wizard Steps |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-19 |
Preconditions: - An action template set exists.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/actiontemplate/create with templateSetId, description="Send hotel voucher", sequence=1, creationMode="ALWAYS" |
Template created |
| 2 | Verify deadlineRule is stored | e.g., daysBefore=3, relativeTo="TRAVEL_START" |
| 3 | Verify assignee is stored | e.g., "operations" |
| 4 | Verify dependsOnSequence is stored | e.g., null (no dependency) |
| 5 | Verify resultFields are stored | e.g., [{"name":"confirmationNumber","type":"TEXT","required":true}] |
| 6 | Verify notes are stored | Instructions text preserved |
| 7 | List templates for the set | New template appears with correct sequence |
Automated: Yes
TC-BK-205: Edit Action Template¶
| Attribute | Value |
|---|---|
| ID | TC-BK-205 |
| Title | Edit Action Template |
| Priority | P2 - High |
| Related Use Case | UC-BK-19 |
Preconditions: - An action template exists within a template set.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/actiontemplate/update with new description and assignee |
Template updated |
| 2 | Verify description changed | Matches new value |
| 3 | Verify assignee changed | Matches new value |
| 4 | Verify existing action items are unaffected | Previously generated items retain original values |
Automated: Yes
TC-BK-206: Delete Action Template¶
| Attribute | Value |
|---|---|
| ID | TC-BK-206 |
| Title | Delete Action Template (With and Without Referencing Items) |
| Priority | P2 - High |
| Related Use Case | UC-BK-19 |
Preconditions: - Two action templates exist: one with no referencing action items, one with existing action items.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/actiontemplate/delete for the template with no references |
Template deleted |
| 2 | List templates for the set | Deleted template no longer appears |
| 3 | POST to blm/actiontemplate/delete for the template with references |
Error response |
| 4 | Verify error message | Indicates template cannot be deleted due to existing action items |
Automated: Yes
Action Generation¶
TC-BK-210: Generate Actions on Booking Confirmation (Hotel)¶
| Attribute | Value |
|---|---|
| ID | TC-BK-210 |
| Title | Generate Actions on Booking Confirmation for Hotel Service Line |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-20 |
Preconditions: - An active template set exists for serviceType=HOTEL with 3 templates (seq 1, 2, 3). - A booking exists in ENQUIRY status with one HOTEL service line.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | Change booking status to CONFIRMED | Status changed |
| 2 | List action items for the booking | 3 action items created |
| 3 | Verify each action has status = "PENDING" | All PENDING |
| 4 | Verify each action references the correct service line | serviceLineId matches |
| 5 | Verify each action references the source template | templateId is set |
| 6 | Check activity log | ACTIONS_GENERATED entry exists |
Automated: Yes
TC-BK-211: Generate Actions on Booking Confirmation (Flight)¶
| Attribute | Value |
|---|---|
| ID | TC-BK-211 |
| Title | Generate Actions on Booking Confirmation for Flight Service Line |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-20 |
Preconditions: - An active template set exists for serviceType=FLIGHT with 2 templates. - A booking exists in ENQUIRY status with one FLIGHT service line.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | Change booking status to CONFIRMED | Status changed |
| 2 | List action items for the booking | 2 action items created |
| 3 | Verify descriptions match template descriptions | Correct templates used |
| 4 | Verify assignees match template defaults | Assignees populated |
Automated: Yes
TC-BK-212: Conditional Action Included (specialRequests Present)¶
| Attribute | Value |
|---|---|
| ID | TC-BK-212 |
| Title | Conditional Action Created When Condition Met |
| Priority | P2 - High |
| Related Use Case | UC-BK-20 |
Preconditions:
- A template set with a CONDITIONAL template that checks specialRequests is not empty.
- A booking with a service line that has specialRequests = "Extra bed needed".
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | Change booking status to CONFIRMED | Status changed |
| 2 | List action items for the booking | Conditional action item is present |
| 3 | Verify the conditional action description | Matches the conditional template |
Automated: Yes
TC-BK-213: Conditional Action Skipped (specialRequests Empty)¶
| Attribute | Value |
|---|---|
| ID | TC-BK-213 |
| Title | Conditional Action Skipped When Condition Not Met |
| Priority | P2 - High |
| Related Use Case | UC-BK-20 |
Preconditions: - Same template set as TC-BK-212. - A booking with a service line that has specialRequests = null or empty.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | Change booking status to CONFIRMED | Status changed |
| 2 | List action items for the booking | Conditional action item is NOT present |
| 3 | Verify only ALWAYS-mode actions were created | Count matches ALWAYS templates only |
Automated: Yes
TC-BK-214: Deadline Calculation (Before Travel Start)¶
| Attribute | Value |
|---|---|
| ID | TC-BK-214 |
| Title | Verify Deadline Calculation Relative to Travel Start Date |
| Priority | P2 - High |
| Related Use Case | UC-BK-20 |
Preconditions: - A template with deadlineRule: 3 days before travel start. - A booking with travelStartDate = 2026-06-15 and a matching service line.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | Change booking status to CONFIRMED | Status changed |
| 2 | Read the generated action item | Action item returned |
| 3 | Verify deadline | deadline = 2026-06-12 (3 days before travel start) |
Automated: Yes
TC-BK-215: Dependency Wiring (Seq 2 Depends on Seq 1)¶
| Attribute | Value |
|---|---|
| ID | TC-BK-215 |
| Title | Verify Dependency Chain Between Generated Actions |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-20 |
Preconditions: - A template set with template A (seq 1) and template B (seq 2, depends on seq 1). - A booking with a matching service line.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | Change booking status to CONFIRMED | Status changed |
| 2 | List action items | Two action items created |
| 3 | Verify action B has dependsOnActionId pointing to action A | Dependency wired |
| 4 | Attempt to complete action B | Blocked: dependency not completed |
| 5 | Complete action A | Action A status = COMPLETED |
| 6 | Attempt to complete action B again | Allowed: action B can now be completed |
Automated: Yes
TC-BK-216: Generate Actions for Service Line Added to Confirmed Booking¶
| Attribute | Value |
|---|---|
| ID | TC-BK-216 |
| Title | Generate Actions When Service Line Added to Confirmed Booking |
| Priority | P2 - High |
| Related Use Case | UC-BK-24 |
Preconditions: - A booking in CONFIRMED status with existing action items for a HOTEL service line. - An active template set exists for serviceType=FLIGHT.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | Add a FLIGHT service line to the confirmed booking | Service line added |
| 2 | List action items for the booking | New action items created for the FLIGHT line |
| 3 | Verify existing HOTEL action items are unchanged | Original items unmodified |
| 4 | Verify new action items reference the FLIGHT service line | serviceLineId matches new line |
| 5 | Check activity log | ACTIONS_GENERATED entry for the new service line |
Automated: Yes
Action Operations¶
TC-BK-220: Complete Action (No Dependencies)¶
| Attribute | Value |
|---|---|
| ID | TC-BK-220 |
| Title | Complete Action Item with No Dependencies |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-21 |
Preconditions: - A booking has a PENDING action item with no dependency.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/actionitem/complete with actionItemId |
Action completed |
| 2 | Verify status = "COMPLETED" | Status updated |
| 3 | Verify completedDate is set | Non-null timestamp |
| 4 | Check activity log | ACTION_COMPLETED entry exists |
Automated: Yes
TC-BK-221: Complete Action with Result Data¶
| Attribute | Value |
|---|---|
| ID | TC-BK-221 |
| Title | Complete Action Item with Result Data Fields |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-21 |
Preconditions: - A PENDING action item with required result field "confirmationNumber" (type TEXT).
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/actionitem/complete with resultData={"confirmationNumber":"HTL-99887"} |
Action completed |
| 2 | Verify status = "COMPLETED" | Status updated |
| 3 | Verify resultData stored | resultData.confirmationNumber = "HTL-99887" |
| 4 | Verify completionNotes stored (if provided) | Notes preserved |
Automated: Yes
TC-BK-222: Complete Action Blocked by Dependency¶
| Attribute | Value |
|---|---|
| ID | TC-BK-222 |
| Title | Reject Completion of Action Blocked by Incomplete Dependency |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-21 |
Preconditions: - Action B depends on action A. Action A is in PENDING status.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/actionitem/complete for action B |
Error response |
| 2 | Verify error message | "Action is blocked by incomplete dependency" |
| 3 | Verify action B status unchanged | Still PENDING |
Automated: Yes
TC-BK-223: Complete Action Missing Required Result Field¶
| Attribute | Value |
|---|---|
| ID | TC-BK-223 |
| Title | Reject Completion When Required Result Field Missing |
| Priority | P2 - High |
| Related Use Case | UC-BK-21 |
Preconditions: - A PENDING action item with a required result field "confirmationNumber".
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/actionitem/complete with empty resultData |
Error response |
| 2 | Verify error message | Indicates required field "confirmationNumber" is missing |
| 3 | Verify action status unchanged | Still PENDING |
Automated: Yes
TC-BK-224: Fail Action¶
| Attribute | Value |
|---|---|
| ID | TC-BK-224 |
| Title | Fail an Action Item with Reason |
| Priority | P2 - High |
| Related Use Case | UC-BK-22 |
Preconditions: - A PENDING or IN_PROGRESS action item exists.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/actionitem/update with status="FAILED", failureReason="Supplier declined" |
Action failed |
| 2 | Verify status = "FAILED" | Status updated |
| 3 | Verify failureReason stored | "Supplier declined" |
| 4 | Check activity log | ACTION_FAILED entry exists |
Automated: Yes
TC-BK-225: Mark Action as Not Required¶
| Attribute | Value |
|---|---|
| ID | TC-BK-225 |
| Title | Mark Action Item as Not Required |
| Priority | P2 - High |
| Related Use Case | UC-BK-22 |
Preconditions: - Action A is PENDING. Action B depends on action A.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/actionitem/update with status="NOT_REQUIRED" for action A |
Status updated |
| 2 | Verify status = "NOT_REQUIRED" | Status updated |
| 3 | Attempt to complete action B | Allowed: dependency treated as satisfied |
Automated: Yes
TC-BK-226: Reassign Action¶
| Attribute | Value |
|---|---|
| ID | TC-BK-226 |
| Title | Reassign Action Item to Another User |
| Priority | P3 - Medium |
| Related Use Case | UC-BK-22 |
Preconditions: - A PENDING action item assigned to "operations".
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/actionitem/update with assignee="ticketing" |
Assignee changed |
| 2 | Verify assignee = "ticketing" | Updated |
| 3 | Check activity log | Reassignment entry exists |
Automated: Yes
TC-BK-227: Update Action Status to In Progress¶
| Attribute | Value |
|---|---|
| ID | TC-BK-227 |
| Title | Transition Action Item to In Progress |
| Priority | P3 - Medium |
| Related Use Case | UC-BK-22 |
Preconditions: - A PENDING action item exists.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/actionitem/update with status="IN_PROGRESS" |
Status changed |
| 2 | Verify status = "IN_PROGRESS" | Updated |
Automated: Yes
TC-BK-228: Create Custom Action¶
| Attribute | Value |
|---|---|
| ID | TC-BK-228 |
| Title | Create Custom (Ad-Hoc) Action Item |
| Priority | P2 - High |
| Related Use Case | UC-BK-23 |
Preconditions: - A booking exists in CONFIRMED status.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/actionitem/create with bookingId, description="Call supplier for special meal", assignee="operations", dueDate="2026-05-10", requiredForVoucher=false |
Action item created |
| 2 | Verify actionItemId assigned | Positive integer |
| 3 | Verify status = "PENDING" | Default status |
| 4 | Verify templateId is null | No template reference |
| 5 | Verify requiredForVoucher = false | As specified |
| 6 | Check activity log | CUSTOM_ACTION_ADDED entry exists |
Automated: Yes
TC-BK-229: Voucher Ready Check (All Required Completed)¶
| Attribute | Value |
|---|---|
| ID | TC-BK-229 |
| Title | Voucher Ready When All Required Actions Completed |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-21, UC-BK-22 |
Preconditions: - A booking has 3 action items: 2 with requiredForVoucher=true (both COMPLETED), 1 with requiredForVoucher=false (still PENDING).
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/actionitem/voucherReady with bookingId |
Check result returned |
| 2 | Verify voucherReady = true | All required actions are completed |
| 3 | Verify pendingCount reflects only non-required items | pendingCount = 1 (the non-required one) |
Automated: Yes
TC-BK-230: Voucher Not Ready (Pending Required Actions)¶
| Attribute | Value |
|---|---|
| ID | TC-BK-230 |
| Title | Voucher Not Ready When Required Actions Are Pending |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-21, UC-BK-22 |
Preconditions: - A booking has 2 action items with requiredForVoucher=true: one COMPLETED, one PENDING.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/actionitem/voucherReady with bookingId |
Check result returned |
| 2 | Verify voucherReady = false | Not all required actions completed |
| 3 | Verify blockers list | Includes the description of the pending required action |
Automated: Yes
13. Future Milestone Test Cases (Placeholders)¶
13.1 M2 -- Cart + Browse-First Flow¶
Test cases will cover: - Cart creation and session management - Adding items to cart from product browse pages - Cart review and modification - Cart-to-booking conversion - Cart persistence across sessions
13.2 M3 -- Checkout + Payment + Financial¶
Test cases will cover: - Payment processing and gateway integration - Invoice generation via ERP - Payment status tracking - Booking export to Excel - Partial payment handling
13.3 M4 -- Cancellation + T&C¶
Test cases will cover: - Cancellation with terms and conditions - Cancellation fee calculation per service line - Refund processing - Supplier cancellation notification
13.4 M5 -- Actions Framework¶
Implemented. See section 12 above for complete M5 test cases (TC-BK-200 through TC-BK-230).
13.5 M6/M6.5 -- Vouchers + Documents + Booking Terms¶
Implemented. See automated tests below. Test classes:
- VoucherDocumentEntityTest.java (15 tests) -- CRUD for VoucherSectionTemplate and BookingDocument entities, seed data verification, search by bookingId/docType/serviceType
- VoucherDocumentFacadeTest.java (22 tests) -- Template CRUD and validation, document upload/download/delete validation, voucher readiness check, voucher generation blocking, action integration
- BookingDocumentApiTest.java (13 tests) -- All 9 API endpoints with valid/invalid inputs, binary download, base64 upload validation, permission checks
TC-BK-231: Voucher Section Template Seed Data¶
| Attribute | Value |
|---|---|
| ID | TC-BK-231 |
| Title | Verify Seed Voucher Section Templates |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-30 |
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/vouchertemplate/list |
Returns 6 templates |
| 2 | Verify service types | HOTEL, FLIGHT, TRANSFER, ACTIVITY, CRUISE, VISA |
| 3 | Verify each template has non-empty fieldsDefinition | Valid JSON array |
| 4 | Verify HOTEL template fieldsDefinition contains HOTEL_CONF_NUMBER | Action code reference present |
TC-BK-232: Voucher Template CRUD¶
| Attribute | Value |
|---|---|
| ID | TC-BK-232 |
| Title | Create, Read, Update Voucher Section Template |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-30 |
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/vouchertemplate/read with serviceType=HOTEL |
Template returned with sectionTitle and fieldsDefinition |
| 2 | Update sectionTitle and POST to blm/vouchertemplate/save |
Template saved, new title returned |
| 3 | Read again to verify persistence | Updated title persisted |
| 4 | Restore original title | Success |
TC-BK-233: Voucher Template Validation¶
| Attribute | Value |
|---|---|
| ID | TC-BK-233 |
| Title | Voucher Template Save Validation |
| Priority | P2 - High |
| Related Use Case | UC-BK-30 |
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/vouchertemplate/save without serviceType |
Error: serviceType is required |
| 2 | POST without sectionTitle | Error: sectionTitle is required |
| 3 | POST without fieldsDefinition | Error: fieldsDefinition is required |
TC-BK-234: Document Upload and List¶
| Attribute | Value |
|---|---|
| ID | TC-BK-234 |
| Title | Upload Document and Verify in List |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-26 |
Preconditions: A booking exists.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/document/list with bookingId |
Empty list |
| 2 | POST to blm/document/upload with bookingId, docType=OTHER, fileName=test.pdf, fileData=[valid base64 PDF] |
CBookingDocument returned with documentId |
| 3 | Verify returned fields | s3Key non-empty, contentType=application/pdf, fileSize > 0 |
| 4 | POST to blm/document/list with bookingId |
List contains 1 document |
| 5 | Verify document fields match upload | fileName, docType, contentType match |
TC-BK-235: Document Upload Validation¶
| Attribute | Value |
|---|---|
| ID | TC-BK-235 |
| Title | Document Upload Validation Errors |
| Priority | P2 - High |
| Related Use Case | UC-BK-26 |
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/document/upload without fileData |
Error: File content is empty |
| 2 | POST with invalid base64 | Error: Invalid base64 file data |
| 3 | POST without bookingId | Error: bookingId is required |
| 4 | POST without docType | Error: docType is required |
TC-BK-236: Document Download¶
| Attribute | Value |
|---|---|
| ID | TC-BK-236 |
| Title | Download Document Returns Binary |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-27 |
Preconditions: A document has been uploaded.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/document/download with documentId |
Binary response (application/octet-stream) |
| 2 | Verify Content-Disposition header | Contains original file name |
| 3 | Verify response bytes match uploaded content | Byte-for-byte match |
| 4 | POST with non-existent documentId | Error response (400 or 404) |
TC-BK-237: Document Delete¶
| Attribute | Value |
|---|---|
| ID | TC-BK-237 |
| Title | Delete Document Removes from S3 and Database |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-29 |
Preconditions: A document has been uploaded.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/document/delete with documentId |
OK |
| 2 | POST to blm/document/list with bookingId |
Document no longer in list |
| 3 | POST to blm/document/download with deleted documentId |
Error: Document not found |
TC-BK-238: Document Email¶
| Attribute | Value |
|---|---|
| ID | TC-BK-238 |
| Title | Email Document as Attachment |
| Priority | P2 - High |
| Related Use Case | UC-BK-28 |
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/document/email without recipientEmail |
Error: recipientEmail is required |
| 2 | POST with valid documentId, recipientEmail, subject, body | OK |
| 3 | Verify activity log | DOCUMENT_EMAILED entry with recipient |
TC-BK-239: Voucher Generation - Readiness Gate¶
| Attribute | Value |
|---|---|
| ID | TC-BK-239 |
| Title | Voucher Generation Blocked by Pending Actions |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-25 |
Preconditions: A confirmed booking with required actions still in PENDING status.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/action/voucherReady with bookingId |
Returns false |
| 2 | POST to blm/booking/generateVoucher with bookingId |
Error: not all required actions are completed |
| 3 | Complete all required actions | Success for each |
| 4 | POST to blm/action/voucherReady |
Returns true |
| 5 | POST to blm/booking/generateVoucher |
CBookingDocument returned with docType=VOUCHER |
TC-BK-240: Voucher Generation - Full Pipeline¶
| Attribute | Value |
|---|---|
| ID | TC-BK-240 |
| Title | Generate Voucher with Action Results and T&C |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-25 |
Preconditions: Confirmed booking with hotel and flight service lines. All required actions completed with result data (e.g., HOTEL_CONF_NUMBER has supplierReference, FLIGHT_PNR has pnr).
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/booking/generateVoucher |
CBookingDocument returned |
| 2 | Verify docType = VOUCHER | Correct |
| 3 | Verify fileName starts with "voucher-" and ends with ".pdf" | Correct format |
| 4 | Download the voucher PDF | Valid PDF file |
| 5 | Verify document list now contains VOUCHER entry | Present |
| 6 | Verify activity log has VOUCHER_GENERATED | Present |
TC-BK-241: Voucher Re-generation and Versioning¶
| Attribute | Value |
|---|---|
| ID | TC-BK-241 |
| Title | Re-generate Voucher Archives Prior Version |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-25 |
Preconditions: A booking already has a generated VOUCHER document.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | Note the existing VOUCHER's documentId and s3Key | Recorded |
| 2 | POST to blm/booking/generateVoucher again |
New CBookingDocument returned |
| 3 | List documents for the booking | Contains one VOUCHER and one VOUCHER_ARCHIVE |
| 4 | Verify the archive document's s3Key ends with "-v1.pdf" | Correct suffix |
| 5 | Verify the new VOUCHER has a fresh s3Key and version=1 | Correct |
M6.5 Booking Terms Test Classes:
- BookingTermsItemEntityTest.java (6 tests) -- CRUD for BookingTermsItem entity, custom items, search by bookingId
- BookingTermsFacadeTest.java (10 tests) -- Initialize, idempotent, toggle include, add/delete custom, template rejection, refresh with new service type, no duplicates
TC-BK-250: Initialize Booking Terms from Templates¶
| Attribute | Value |
|---|---|
| ID | TC-BK-250 |
| Title | Initialize Booking Terms from Templates |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-31 |
Preconditions: Booking with HOTEL service line. T&C seed templates exist.
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/terms/booking/list with bookingId |
Empty list |
| 2 | POST to blm/terms/booking/initialize with bookingId |
List with SERVICE (HOTEL), CANCELLATION (HOTEL), and GLOBAL items |
| 3 | Verify all items have isIncluded=true | All true |
| 4 | Verify all items have isCustom=false | All false |
| 5 | POST to blm/terms/booking/initialize again |
Same items returned (idempotent) |
TC-BK-251: Toggle Terms Inclusion¶
| Attribute | Value |
|---|---|
| ID | TC-BK-251 |
| Title | Toggle Terms Inclusion and Save |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-32 |
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | Initialize terms for a booking | Items returned |
| 2 | Set isIncluded=false on one item, POST to blm/terms/booking/save |
Saved successfully |
| 3 | POST to blm/terms/booking/list |
Excluded item has isIncluded=false |
TC-BK-252: Add Custom Booking Term¶
| Attribute | Value |
|---|---|
| ID | TC-BK-252 |
| Title | Add Custom Free-Text Term |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-33 |
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | POST to blm/terms/booking/addCustom with title and contentHtml |
CBookingTermsItem returned with termsType=CUSTOM, isCustom=true |
| 2 | POST to blm/terms/booking/list |
Custom item appears at end |
| 3 | POST without title | Error: title is required |
TC-BK-253: Refresh Terms from Templates¶
| Attribute | Value |
|---|---|
| ID | TC-BK-253 |
| Title | Refresh Terms After Adding Service Line |
| Priority | P2 - High |
| Related Use Case | UC-BK-34 |
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | Initialize terms for booking with HOTEL service line | HOTEL + GLOBAL items |
| 2 | Add FLIGHT service line to booking | Service line added |
| 3 | POST to blm/terms/booking/refresh |
FLIGHT SERVICE and CANCELLATION items added |
| 4 | Verify existing HOTEL items unchanged | Include flags and sort order preserved |
| 5 | POST to blm/terms/booking/refresh again |
No duplicates added |
TC-BK-254: Delete Custom Term¶
| Attribute | Value |
|---|---|
| ID | TC-BK-254 |
| Title | Delete Custom Term |
| Priority | P2 - High |
| Related Use Case | UC-BK-35 |
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | Add a custom term | Item created |
| 2 | POST to blm/terms/booking/deleteCustom with its ID |
OK |
| 3 | POST to blm/terms/booking/list |
Custom item no longer present |
| 4 | Attempt to delete a template-based item | Error: Only custom terms can be deleted |
TC-BK-255: Voucher Generation Uses Saved Terms¶
| Attribute | Value |
|---|---|
| ID | TC-BK-255 |
| Title | Voucher Uses Only Included Booking Terms |
| Priority | P1 - Critical |
| Related Use Case | UC-BK-32 |
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | Initialize terms, exclude "Travel Insurance Advisory" | Saved |
| 2 | Generate voucher | Voucher PDF created |
| 3 | Verify voucher content | Excluded term does NOT appear in PDF |
| 4 | Verify included terms appear | All checked terms present |
TC-BK-256: Voucher Backwards Compatibility¶
| Attribute | Value |
|---|---|
| ID | TC-BK-256 |
| Title | Voucher Falls Back to Dynamic Resolution |
| Priority | P1 - Critical |
Test Steps:
| Step | Action | Expected Result |
|---|---|---|
| 1 | Create booking with service lines but do NOT open Terms tab | No bookingtermsitem records |
| 2 | Generate voucher | All dynamically resolved terms appear in PDF |
13.6 M7 — TripMaker + Inbound Group Integration¶
TripMaker Conversion Tests¶
| Test ID | Title | Priority | Steps | Expected Result |
|---|---|---|---|---|
| TC-BK-300 | Convert QUOTED project to booking | P1 | Create project with hotel + activity, set QUOTED, call convertToBooking | Booking created in ENQUIRY, service lines match cost breakdown, project set to CLOSED |
| TC-BK-301 | Service lines preserve cost and sell price | P1 | Convert project with margin overrides | Each service line: cost = baseCost, sellPrice = finalPrice (with margin) |
| TC-BK-302 | Lead passenger from first traveler | P1 | Convert project with 2+ travelers | First traveler becomes lead passenger (isLead=true), name split into first/last |
| TC-BK-303 | Source type and ref tracking | P1 | Convert project | booking.sourceType = "TRIPMAKER", booking.sourceRef = projectId |
| TC-BK-304 | Reject non-QUOTED project | P1 | Try converting DRAFT project | Error: "Project must be in QUOTED status" |
| TC-BK-305 | Reject mismatched itinerary | P2 | Convert with itinerary from different project | Error: "Itinerary does not belong to project" |
| TC-BK-306 | Component type mapping | P2 | Convert project with all component types | ACCOMMODATION→HOTEL, FLIGHT→FLIGHT, ACTIVITY→ACTIVITY, OTHER_SERVICE→OTHER |
| TC-BK-307 | Hotel attributes preserved | P2 | Convert with accommodation | Service line attributes contain propertyName, roomType, mealPlan, starRating |
| TC-BK-308 | Flight attributes preserved | P2 | Convert with flight | Service line attributes contain flightNumber, airline, origin, destination |
| TC-BK-309 | Booking currency from local config | P2 | Convert project | Booking currency = ExchangeRateHelper.getLocalCurrency() |
Inbound Group Conversion Tests¶
| Test ID | Title | Priority | Steps | Expected Result |
|---|---|---|---|---|
| TC-BK-310 | Create booking from inbound group | P1 | Create inbound group with hotel, transport, service, 3 pax, call createBookingFromInboundGroup | Booking created in ENQUIRY with all items |
| TC-BK-311 | Partner agency as customer | P1 | Convert group with partnerId/partnerName | booking.customerName = partnerName, booking.customerId = partnerId |
| TC-BK-312 | Hotel lines aggregated per hotel | P1 | Group with hotel A (3 rooms) and hotel B (2 rooms) | 2 HOTEL service lines; A: cost = sum of 3 room costs, quantity = 3 |
| TC-BK-313 | Transport lines mapped | P1 | Group with 2 transports | 2 TRANSFER service lines with cost/price from transport |
| TC-BK-314 | Activity cost aggregation | P1 | Service: adultCost=100, childCost=50, 2 adults, 1 child | cost = 250, sellPrice = corresponding aggregation |
| TC-BK-315 | All passengers imported | P1 | Group with 5 passengers | 5 booking passengers, first marked as lead |
| TC-BK-316 | Source type and ref | P1 | Convert group | sourceType = "GROUP_INBOUND", sourceRef = groupId |
| TC-BK-317 | Reject OUTBOUND group | P1 | Try converting OUTBOUND group | Error: "Only INBOUND groups can be converted" |
| TC-BK-318 | Re-sync ENQUIRY booking | P1 | Convert group, modify group services, convert again | Existing booking updated: old service lines removed, new ones added |
| TC-BK-319 | Re-sync QUOTED booking | P1 | Convert group, change status to QUOTED, modify group, convert again | Booking updated in-place with new data |
| TC-BK-320 | Reject re-sync of CONFIRMED booking | P1 | Convert group, confirm booking, try converting again | Error: "booking already exists... Cancel it first or amend manually" |
| TC-BK-321 | Passenger re-sync | P2 | Convert group, add/remove passengers in group, convert again | Booking passengers match current group passengers |
| TC-BK-322 | Agent ID recorded | P2 | Convert group | booking.assignedAgentId = authenticated user session |
Source Type Display Tests¶
| Test ID | Title | Priority | Steps | Expected Result |
|---|---|---|---|---|
| TC-BK-325 | Source badge in booking list | P2 | Create booking from TripMaker, view booking list | Row shows "TripMaker #projectId" below booking ref |
| TC-BK-326 | Group source badge | P2 | Create booking from group, view booking list | Row shows "Inbound Group #groupId" below booking ref |
| TC-BK-327 | Manual booking no badge | P3 | Create manual booking, view list | No source badge shown |
13.7 M8 -- Outbound Group Sales¶
Test cases will cover: - Group departure creation and management - Inventory allocation - Passenger roster management - Group pricing and discounts - Shared service line management
13.8 M9 -- Admin Maintenance & Data Health¶
Facade Tests¶
| Test ID | Title | Priority | Steps | Expected Result |
|---|---|---|---|---|
| TC-BK-400 | Find stale carts | P1 | Create carts with varying ages and statuses, call findStaleCarts(30, "ACTIVE") |
Only ACTIVE carts older than 30 days returned |
| TC-BK-401 | Bulk expire carts | P1 | Create 3 ACTIVE carts, call bulkExpireCarts with their IDs |
All 3 carts have status EXPIRED, items cleared, return count = 3 |
| TC-BK-402 | Bulk abandon carts | P1 | Create 2 PARKED carts, call bulkAbandonCarts |
Status = ABANDONED, items cleared |
| TC-BK-403 | Cart statistics | P1 | Create carts in various statuses and ages, call getCartStatistics() |
Correct counts by status and age range |
| TC-BK-404 | Find zombie bookings | P1 | Create ENQUIRY booking 70 days ago with no activity, call findZombieBookings("ENQUIRY", 60) |
Booking returned in results |
| TC-BK-405 | Find bookings without service lines | P1 | Create CONFIRMED booking with zero service lines | Booking returned by findBookingsWithoutServiceLines() |
| TC-BK-406 | Booking status distribution | P2 | Create bookings in various statuses | getBookingStatusDistribution() returns correct counts per status |
| TC-BK-407 | Find missed expiries | P1 | Create OPTION_HELD booking with past expiry date | Returned by findMissedExpiries() |
| TC-BK-408 | Manual trigger expiry | P1 | Create OPTION_HELD booking, call manualTriggerExpiry(bookingId) |
Booking transitions to EXPIRED, notification sent |
| TC-BK-409 | ERP audit - missing customer | P1 | Create booking without erpCustomerId, older than 1 day | Returned by findBookingsMissingErpCustomer(1) |
| TC-BK-410 | ERP audit - missing lead | P1 | Create booking without erpLeadId | Returned by findBookingsMissingErpLead(1) |
| TC-BK-411 | Notification statistics | P2 | Insert notification records with varying statuses | getNotificationStatistics() returns correct counts by status and type |
| TC-BK-412 | System health summary | P1 | Create stale carts, zombie bookings, failed notifications | getSystemHealthSummary() returns non-zero counts for all categories |
API Tests¶
| Test ID | Title | Priority | Steps | Expected Result |
|---|---|---|---|---|
| TC-BK-420 | Health summary endpoint | P1 | POST blm/maintenance/health/summary as admin |
Returns summary with stale cart count, zombie count, etc. |
| TC-BK-421 | Cart stale endpoint | P1 | POST blm/maintenance/cart/stale with ageInDays=30 |
Returns list of stale carts |
| TC-BK-422 | Cart statistics endpoint | P2 | POST blm/maintenance/cart/statistics |
Returns count by status and age |
| TC-BK-423 | Cart bulk expire endpoint | P1 | POST blm/maintenance/cart/bulkExpire with cart IDs |
Carts expired, count returned |
| TC-BK-424 | Cart bulk abandon endpoint | P1 | POST blm/maintenance/cart/bulkAbandon |
Carts abandoned |
| TC-BK-425 | Booking zombies endpoint | P1 | POST blm/maintenance/booking/zombies |
Returns zombie bookings |
| TC-BK-426 | Booking no services endpoint | P1 | POST blm/maintenance/booking/noServices |
Returns bookings without service lines |
| TC-BK-427 | Booking status distribution endpoint | P2 | POST blm/maintenance/booking/statusDistribution |
Returns status counts |
| TC-BK-428 | Expiry status endpoint | P2 | POST blm/maintenance/expiry/status |
Returns last job execution info |
| TC-BK-429 | Expiry missed endpoint | P1 | POST blm/maintenance/expiry/missed |
Returns missed expiries |
| TC-BK-430 | Expiry manual trigger endpoint | P1 | POST blm/maintenance/expiry/trigger with bookingId |
Booking expired |
| TC-BK-431 | Orphan detect endpoint | P1 | POST blm/maintenance/orphan/detect with entityType |
Returns orphaned records |
| TC-BK-432 | Orphan delete endpoint | P1 | POST blm/maintenance/orphan/delete with IDs |
Orphans deleted |
| TC-BK-433 | ERP audit endpoint | P1 | POST blm/maintenance/erp/audit |
Returns ERP sync failures |
| TC-BK-434 | ERP retry endpoint | P1 | POST blm/maintenance/erp/retry with bookingId |
ERP sync retried |
| TC-BK-435 | Notification failures endpoint | P1 | POST blm/maintenance/notification/failures |
Returns failed notifications |
| TC-BK-436 | Notification retry endpoint | P1 | POST blm/maintenance/notification/retry |
Notification re-sent |
| TC-BK-437 | Notification statistics endpoint | P2 | POST blm/maintenance/notification/statistics |
Returns notification counts |
| TC-BK-438 | Activity log statistics endpoint | P2 | POST blm/maintenance/activitylog/statistics |
Returns log stats |
| TC-BK-439 | Activity log archive endpoint | P1 | POST blm/maintenance/activitylog/archive with olderThanDays |
Logs archived and deleted |
| TC-BK-440 | Admin-only access validation | P1 | POST any maintenance endpoint as agent (non-admin) role | 403 Forbidden |
Manual / UI Tests¶
| Test ID | Title | Priority | Steps | Expected Result |
|---|---|---|---|---|
| TC-BK-450 | Dashboard cards display | P1 | Navigate to booking-maintenance.html as admin | Dashboard shows cards: Stale Carts, Zombie Bookings, ERP Failures, Failed Notifications with current counts |
| TC-BK-451 | Tab navigation | P1 | Click each tab: Carts, Bookings, ERP Sync, Notifications, Activity Logs | Each tab loads its content and filters correctly |
| TC-BK-452 | Bulk cart expire from UI | P1 | Select multiple stale carts, click Expire Selected | Selected carts expired, table refreshed, dashboard card updated |
| TC-BK-453 | ERP retry from UI | P1 | Click Retry Sync on a booking with missing ERP data | Sync retried, result shown in toast notification |
| TC-BK-454 | Notification retry from UI | P1 | Click Retry on a failed notification | Notification re-sent, status updated in table |