@page "/booking"
@using System
@using System.Collections.Generic
@using System.Linq
@using System.Threading.Tasks
@rendermode InteractiveServer
@* Page Head *@
Online GDS Booking Console
GDS-integrated · Amadeus, Travelport & Sabre · e-ticketing & vouchers
@* Notification Feedback Banner *@
@if (!string.IsNullOrEmpty(AlertFeedback))
{
}
@* Financial & Booking KPI Dashboard *@
@* Search Card *@
@* Tabs *@
@* Form Row *@
@* Simulated GDS Node Loader / Spinner *@
@if (IsSearching)
{
Interrogating GDS Telemetry Nodes...
Fetching pre-negotiated corporate rates from Amadeus, Sabre and Travelport databases
}
else
{
@* Grid 3: Results *@
@foreach (var result in GetActiveSearchResults())
{
@result.HighlightText
}
}
@* Grid 2: Delivery & Unused e-Tickets *@
Unused e-Tickets
Tracked & refund-eligible corporate flight stock
@unusedTickets.Count(t => !t.IsRefunded && !t.IsReused) open
@foreach (var ticket in unusedTickets)
{
@ticket.TicketDetails for @ticket.Passenger
@if (ticket.IsRefunded)
{
Refunded
}
else if (ticket.IsReused)
{
Reused
}
Expires @ticket.ExpiryDate · Face Value: R @ticket.Price.ToString("N0")
@if (!ticket.IsRefunded && !ticket.IsReused)
{
}
}
Refunds are directly re-credited to SAQA's master Lodge Card balance instantly upon approval.
Delivery & Notifications
E-tickets, SMS alerts & hotel vouchers
Active Feed
@foreach (var log in deliveryLogs)
{
@if (log.Icon == "sms")
{
}
else if (log.Icon == "email")
{
}
else
{
}
@log.Title
@log.Content
@log.Timestamp
}
@* Grid 2: Approval & Cancellations *@
@* Approvals Table *@
Travel Approval Queue
Manager sign-off required before GDS auto-ticketing
@tripRequests.Count(t => t.Status == "Pending") awaiting
| Traveller |
Trip |
Cost |
Approver |
Action |
@foreach (var trip in tripRequests)
{
@trip.Initials
@trip.Name
@trip.Role
|
@trip.TripDetails |
@trip.Cost |
@trip.ApproverRole
|
@if (trip.Status == "Pending")
{
}
else if (trip.Status == "Approved")
{
Approved
}
else
{
Declined
}
|
}
@* Manage Bookings *@
Active Corporate Bookings
Amend, cancel & track refunds
Live Feed
@foreach (var booking in GetFilteredBookings())
{
@booking.Title
@if (booking.IsCancelled)
{
Cancelled
}
@booking.Subtitle · R @booking.Price.ToString("N0")
@if (booking.IsCancelled)
{
Refund Queued
}
else
{
}
}
Automated voucher
Vouchers are auto-sent to hotel, traveller and back-office instantly on finalization.
@* ===================== MODAL DIALOGS ===================== *@
@* 1. Booking Confirmation Modal *@
@if (showBookingModal && selectedSearchResult != null)
{
GDS Transaction Gateway
Confirm GDS Lodge Booking
Selected Offering
@selectedSearchResult.Title
@selectedSearchResult.Subtitle
Cost Center Rate:
R @selectedSearchResult.Price.ToString("N0")
Corporate Policy Verification
This travel option fits comfortably within SAQA National Treasury Instruction 03 guidelines and budget thresholds. Lodge card is pre-authorized.
}
@* 2. Refund Confirmation Modal *@
@if (showRefundModal && selectedTicket != null)
{
Confirm e-Ticket Refund
Are you sure you want to request an immediate GDS automated refund for this unused e-ticket?
@selectedTicket.TicketDetails
Traveller: @selectedTicket.Passenger · Expiry: @selectedTicket.ExpiryDate
Refund Amount: R @selectedTicket.Price.ToString("N0")
Note: Airline administrative fees of R150 will be auto-settled via GDS system. The net refund will reflect on the lodge card instantly.
}
@* 3. Reuse Credit Confirmation Modal *@
@if (showReuseModal && selectedTicket != null)
{
Reassign Unused ticket credit
You are reassigning R @selectedTicket.Price.ToString("N0") of unused ticket credit from @selectedTicket.Passenger.
This credit will be applied directly to the booking fee, reducing the new trip's cash settlement requirement. No extra cash outflows.
}
@* 4. Modify Active Booking Modal *@
@if (showModifyModal && selectedBooking != null)
{
Amend Corporate Booking
@selectedBooking.Title
Current: @selectedBooking.Subtitle
Note: Modifications are verified against the original GDS fare category rules. No-fee changes are guaranteed for executive tiers.
}
@* 5. Cancel Booking Confirmation Modal *@
@if (showCancelConfirmModal && selectedBooking != null)
{
Cancel GDS Booking
Are you sure you want to cancel this booking and trigger the refund sequence?
@selectedBooking.Title
@selectedBooking.Subtitle
Value: R @selectedBooking.Price.ToString("N0")
}
@* 6. Custom New Trip Booking Modal *@
@if (showNewTripModal)
{
Create Manual Corporate Booking
}
@* 7. Travel Approval Queue Detail Modal *@
@if (showApprovalModal && selectedApproval != null)
{
Review Travel Authorization
@selectedApproval.Initials
@selectedApproval.Name
@selectedApproval.Role · @selectedApproval.ApproverRole Check
Trip Route:
@selectedApproval.TripDetails
Cost Quote:
@selectedApproval.Cost
Policy Match:
✓ National Treasury compliant
}
@code {
// --- Tabs State ---
private string activeTab = "flights";
private void SetTab(string tab)
{
activeTab = tab;
// Automatically ping GDS when tab changes for liveness
IsSearching = true;
_ = Task.Delay(400).ContinueWith(_ => { IsSearching = false; InvokeAsync(StateHasChanged); });
}
// --- Master Card & Financials State ---
private decimal LodgeCardBalance { get; set; } = 312440M;
// --- Telemetry Alerts / Success logs ---
private string AlertFeedback { get; set; } = string.Empty;
// --- My Bookings view filter ---
private bool ShowMyBookingsOnly { get; set; } = false;
private void ToggleMyBookingsFilter()
{
ShowMyBookingsOnly = !ShowMyBookingsOnly;
if (ShowMyBookingsOnly)
{
AlertFeedback = "Filtered queue for your corporate profile.";
}
else
{
AlertFeedback = "Displaying all corporate passenger GDS itineraries.";
}
}
// --- Form Bindings ---
private string FlightFrom { get; set; } = "Johannesburg (JNB)";
private string FlightTo { get; set; } = "Cape Town (CPT)";
private DateTime FlightDate { get; set; } = new DateTime(2026, 6, 2);
private string FlightCabin { get; set; } = "Economy (Policy)";
private string HotelLocation { get; set; } = "Sandton, Johannesburg";
private DateTime HotelCheckIn { get; set; } = new DateTime(2026, 6, 2);
private DateTime HotelCheckOut { get; set; } = new DateTime(2026, 6, 5);
private string HotelGuests { get; set; } = "1 Guest";
private string CarLocation { get; set; } = "O.R. Tambo International Airport (JNB)";
private DateTime CarPickUp { get; set; } = new DateTime(2026, 6, 2);
private DateTime CarReturn { get; set; } = new DateTime(2026, 6, 5);
private string CarClass { get; set; } = "Compact / Hatchback";
private bool IsSearching { get; set; } = false;
// --- Search Logic ---
private void TriggerSearch()
{
IsSearching = true;
// Mimic instant GDS query
_ = Task.Delay(800).ContinueWith(_ =>
{
IsSearching = false;
AlertFeedback = $"Refreshed corporate GDS query for your choice of {activeTab.ToUpper()} with 3 preferred supplier nodes.";
InvokeAsync(StateHasChanged);
});
}
// --- Models ---
public class SearchResultItem
{
public string Id { get; set; } = string.Empty;
public string Title { get; set; } = string.Empty;
public string Subtitle { get; set; } = string.Empty;
public decimal Price { get; set; }
public string BadgeText { get; set; } = string.Empty;
public string BadgeClass { get; set; } = string.Empty;
public string HighlightText { get; set; } = string.Empty;
public string TabType { get; set; } = string.Empty; // "flights", "hotels", "cars"
}
public class TripRequest
{
public string Id { get; set; } = Guid.NewGuid().ToString();
public string Initials { get; set; } = "";
public string Name { get; set; } = "";
public string Role { get; set; } = "";
public string TripDetails { get; set; } = "";
public string Cost { get; set; } = "";
public string ApproverRole { get; set; } = "";
public string Status { get; set; } = "Pending";
}
public class BookingItem
{
public string Id { get; set; } = Guid.NewGuid().ToString();
public string Title { get; set; } = "";
public string Subtitle { get; set; } = "";
public decimal Price { get; set; }
public string Passenger { get; set; } = "";
public bool IsCancelled { get; set; }
}
public class UnusedTicketItem
{
public string Id { get; set; } = Guid.NewGuid().ToString();
public string TicketDetails { get; set; } = "";
public string ExpiryDate { get; set; } = "";
public string Passenger { get; set; } = "";
public decimal Price { get; set; }
public bool IsRefunded { get; set; }
public bool IsReused { get; set; }
}
public class DeliveryNotification
{
public string Title { get; set; } = "";
public string Content { get; set; } = "";
public string Icon { get; set; } = ""; // "sms", "email", "warning"
public string TypeClass { get; set; } = "";
public string BgClass { get; set; } = "";
public string Timestamp { get; set; } = "";
}
// --- Database Collections ---
private List