'use client'; import React, { useState } from 'react'; import Link from 'next/link'; import { ChevronDown, ChevronRight, FileText, Home } from 'lucide-react'; const DocPage = () => { const [expandedSections, setExpandedSections] = useState<{ [key: string]: boolean }>({ overview: true, operations: true, masterdata: false, financial: false, services: false, security: false, analytics: false, system: false, enhanced: false, }); const toggleSection = (section: string) => { setExpandedSections(prev => (({ ...prev, [section]: !prev[section] }))); }; const scrollToSection = (id: string) => { setTimeout(() => { const element = document.getElementById(id); if (element) { const headerOffset = 120; const elementPosition = element.getBoundingClientRect().top + window.pageYOffset; const offsetPosition = elementPosition - headerOffset; window.scrollTo({ top: offsetPosition, behavior: 'smooth' }); } }, 0); }; const sections = [ { id: 'overview', title: '📋 Overview & Getting Started', items: [ { id: 'about', label: 'Application Overview' }, { id: 'features', label: 'Key Features' }, ] }, { id: 'operations', title: '📊 Operations', items: [ { id: 'bookings', label: 'Bookings' }, { id: 'bookings-how', label: '→ How-To' }, { id: 'passengers', label: 'Passengers' }, { id: 'passengers-how', label: '→ How-To' }, { id: 'tickets', label: 'Tickets' }, { id: 'tickets-how', label: '→ How-To' }, ] }, { id: 'masterdata', title: '🏢 Master Data', items: [ { id: 'stations', label: 'Stations' }, { id: 'stations-how', label: '→ How-To' }, { id: 'trains', label: 'Trains' }, { id: 'trains-how', label: '→ How-To' }, { id: 'coaches', label: 'Coaches' }, { id: 'coaches-how', label: '→ How-To' }, { id: 'seats', label: 'Seats' }, { id: 'seats-how', label: '→ How-To' }, { id: 'classes', label: 'Seat Classes' }, { id: 'classes-how', label: '→ How-To' }, { id: 'routes', label: 'Routes' }, { id: 'routes-how', label: '→ How-To' }, { id: 'schedules', label: 'Schedules' }, { id: 'schedules-how', label: '→ How-To' }, ] }, { id: 'financial', title: '💰 Financial', items: [ { id: 'pricing', label: 'Pricing & Fares' }, { id: 'pricing-how', label: '→ How-To' }, { id: 'currencies', label: 'Currencies' }, { id: 'currencies-how', label: '→ How-To' }, { id: 'payments', label: 'Payments' }, { id: 'payments-how', label: '→ How-To' }, { id: 'promos', label: 'Promo Codes' }, { id: 'promos-how', label: '→ How-To' }, ] }, { id: 'services', title: '🎁 Customer Services', items: [ { id: 'loyalty', label: 'Loyalty' }, { id: 'loyalty-how', label: '→ How-To' }, { id: 'support', label: 'Support' }, { id: 'support-how', label: '→ How-To' }, { id: 'notifications', label: 'Notifications' }, { id: 'notifications-how', label: '→ How-To' }, ] }, { id: 'security', title: '🔒 Security', items: [ { id: 'audit', label: 'Audit Logs' }, { id: 'audit-how', label: '→ How-To' }, { id: 'fraud', label: 'Fraud Detection' }, { id: 'fraud-how', label: '→ How-To' }, { id: 'verifayda', label: 'Verifayda' }, { id: 'verifayda-how', label: '→ How-To' }, ] }, { id: 'analytics', title: '📈 Analytics', items: [ { id: 'reports', label: 'Reports' }, { id: 'reports-how', label: '→ How-To' }, ] }, { id: 'system', title: '⚙️ System', items: [ { id: 'agents', label: 'Agents' }, { id: 'agents-how', label: '→ How-To' }, { id: 'users', label: 'Users' }, { id: 'users-how', label: '→ How-To' }, { id: 'system-config', label: 'System Config' }, { id: 'system-config-how', label: '→ How-To' }, { id: 'settings', label: 'Settings' }, { id: 'settings-how', label: '→ How-To' }, ] }, { id: 'enhanced', title: '✨ Enhanced Features', items: [ { id: 'excess-baggage', label: 'Excess Baggage' }, { id: 'excess-baggage-how', label: '→ How-To' }, { id: 'packages', label: 'Travel Packages' }, { id: 'packages-how', label: '→ How-To' }, { id: 'package-inquiries', label: 'Package Inquiries' }, { id: 'package-inquiries-how', label: '→ How-To' }, { id: 'health', label: 'Health Monitoring' }, { id: 'health-how', label: '→ How-To' }, { id: 'boarding', label: 'Boarding Management' }, { id: 'boarding-how', label: '→ How-To' }, { id: 'fare-config', label: 'Advanced Fare Config' }, { id: 'fare-config-how', label: '→ How-To' }, { id: 'payment-methods', label: 'Payment Methods' }, { id: 'payment-methods-how', label: '→ How-To' }, ] }, ]; const HowToStep = ({ number, title, children }: { number: number; title: string; children: React.ReactNode }) => (
{number}

{title}

{children}
); return (

Documentation

View API Docs Dashboard

Welcome to EDR Passenger Backoffice

Comprehensive management system for the Ethio-Djibouti Railway passenger platform. This documentation provides complete guidance on all features, operations, and best practices.

🎆 Version 1.0.0 - Complete Platform Release

  • Excess Baggage: Complete baggage handling with agent tools and passenger self-pay
  • Travel Packages: Bundled offerings with tiered pricing and inquiry management
  • Health Monitoring: Comprehensive system status and performance tracking
  • Boarding Management: Gate operations and passenger processing workflows
  • Advanced Fare Config: Dynamic pricing with segment-based rules
  • Payment Methods: Multi-provider payment configuration and management

🌟 Key Features

Complete booking, passenger, fleet, and financial management.

{/* BOOKINGS */}

📋 Bookings

Manage passenger bookings with search, view, modify, and refund capabilities.

📋 How-To: Manage Bookings

  1. Click "Bookings" in Operations section
  2. View all bookings in table format
  1. Use search box for reference, email, or phone
  2. Use Status dropdown to filter
  1. Click "View Details" for full information
  2. Click "Cancel Booking" to process refunds

⚙️ System Config

Centralized system configuration management with feature flags and operational controls.

⚙️ How-To: Manage System Configuration

  1. Click "System Config" in System section
  2. View all configuration categories
  1. Adjust auth endpoints limit (default: 5 req/min)
  2. Set strict endpoints limit (default: 20 req/min)
  3. Configure default endpoints limit (default: 100 req/min)
  1. Set seat hold duration (default: 5 minutes)
  2. Configure hold cutoff before departure (default: 2 hours)
  3. Click "Save Changes" to apply
{/* EXCESS BAGGAGE */}

📦 Excess Baggage

Manage excess baggage charges at boarding with agent tools and passenger self-pay options.

📦 How-To: Handle Excess Baggage

  1. Click "Excess Baggage" in Enhanced Features
  2. View all baggage charges and their status
  1. Search by booking reference
  2. Filter by status: PENDING, PAID, CASH_COLLECTED, EXPIRED, WAIVED
  3. Use date filters for specific periods
  1. "Resend Link" for pending charges to passenger
  2. "Waive" charges with reason (supervisor authority)
  3. "Delete" expired or waived charges
{/* TRAVEL PACKAGES */}

🎒 Travel Packages

Manage pilgrimage and group travel packages with tiered pricing and capacity management.

🎒 How-To: Manage Travel Packages

  1. Click "New Package" button
  2. Fill package details: code, name, stations, schedules
  3. Set capacity, validity period, and included services
  4. Save package (starts in DRAFT status)
  1. Click "Tiers" on package to manage pricing
  2. Add tiers: seat type, label, price, capacity
  3. Edit existing tiers (limited if bookings exist)
  4. Delete unused tiers
  1. "Activate" draft packages to make bookable
  2. "Deactivate" active packages to stop new bookings
  3. "Delete" packages with no bookings if needed
{/* PACKAGE INQUIRIES */}

📝 Package Inquiries

Manage incoming package booking inquiries and track lead conversion.

📝 How-To: Handle Package Inquiries

  1. Click "Package Inquiries" in Enhanced Features
  2. Filter by package or inquiry status
  3. View contact details, package interest, traveler count
  1. Use status dropdown: NEW → CONTACTED → CONVERTED/CLOSED
  2. Mark as CONTACTED after first customer contact
  3. Mark as CONVERTED when inquiry becomes booking
  4. Mark as CLOSED if customer not interested
  1. Respond to NEW inquiries within 24 hours
  2. Follow up on CONTACTED inquiries regularly
  3. Delete spam or duplicate inquiries as needed
{/* HEALTH MONITORING */}

🏥 Health Monitoring

Monitor EDR Passenger API health with real-time system status and performance metrics.

🏥 How-To: Monitor System Health

  1. Click "Health Monitoring" in Enhanced Features
  2. View overall system status banner
  3. Check individual probe cards (auto-refreshing)
  1. Liveness: API process alive (30s refresh)
  2. Readiness: Database connectivity + latency (30s refresh)
  3. App Info: Version, uptime, environment (60s refresh)
  1. Red status: Check error details and system logs
  2. High DB latency: Monitor database performance
  3. Failed checks: Verify API server and connections
  4. Use "Refresh" button for manual status update
{/* BOARDING MANAGEMENT */}

🚆 Boarding Management

Manage gate operations and passenger boarding processes with real-time tracking.

🚆 How-To: Manage Boarding Operations

  1. Click "Boarding" in Enhanced Features
  2. Select active trip/schedule for boarding
  3. View real-time boarding dashboard
  1. Track total passengers expected vs boarded
  2. Monitor boarding progress percentage
  3. View gate status and any alerts
  1. Validate passenger tickets and documents
  2. Resolve seat conflicts or issues
  3. Process last-minute passengers and no-shows
{/* ADVANCED FARE CONFIG */}

📊 Advanced Fare Config

Configure complex fare rules and dynamic pricing strategies with segment-based pricing.

📊 How-To: Configure Advanced Fares

  1. Click "Advanced Fare Config" in Enhanced Features
  2. Choose between Schedule Fares or Segment Fares
  3. View existing fare rules and calculations
  1. Set fare amounts for specific schedules or segments
  2. Define passenger categories (ADULT/CHILD) and nationalities
  3. Configure validity periods and seasonal adjustments
  1. Apply route segment-specific pricing
  2. Set nationality-based rate variations
  3. Monitor fare engine integration and real-time calculations
{/* PAYMENT METHODS */}

💳 Payment Methods

Configure and manage payment provider integrations with multi-provider support.

💳 How-To: Configure Payment Methods

  1. Click "Payment Methods" in Enhanced Features
  2. View all configured payment providers
  3. Check provider status and connectivity
  1. Set up API credentials (URLs, keys, merchant IDs)
  2. Configure transaction fees and limits
  3. Enable/disable specific payment methods
  1. Run test transactions for each provider
  2. Validate webhook endpoints and security
  3. Monitor API connectivity and error logs

© 2026 Ethio-Djibouti Railway | Passenger Backoffice Documentation v1.0.0

); }; export default DocPage;