API: Get Specific Coach Configuration

Request

Retrieve a specific coach configuration by ID:

GET /coach-configurations/{id}

Sample Response:


{
  "success": true,
  "message": "Coach configuration retrieved successfully",
  "data": {
    "id": 1,
    "coach_id": 1,
    "schedule_id": 2,
    "bus_id": 3,
    "seat_plan_id": 4,
    "route_id": 5,
    "coach_type": 1,
    "status": 1,
    "created_by": 1,
    "updated_by": null,
    "created_at": "2025-08-10T10:00:00.000000Z",
    "updated_at": "2025-08-10T10:00:00.000000Z",
    "coach": {
      "id": 1,
      "name": "Express Coach 001",
      "code": "EC001"
    },
    "schedule": {
      "id": 2,
      "name": "Morning Schedule",
      "departure_time": "08:00:00"
    },
    "bus": {
      "id": 3,
      "registration_number": "DH-123456",
      "model": "Volvo B11R"
    },
    "seat_plan": {
      "id": 4,
      "name": "2x2 Layout",
      "total_seats": 40
    },
    "route": {
      "id": 5,
      "name": "Dhaka - Chittagong",
      "distance": "264 km"
    },
    "boarding_droppings": [
      {
        "id": 1,
        "coach_configuration_id": 1,
        "counter_id": 1,
        "type": 1,
        "time": "08:00:00",
        "starting_point_status": 1,
        "ending_point_status": 0,
        "status": 1,
        "created_by": 1,
        "updated_by": null,
        "created_at": "2025-08-10T10:00:00.000000Z",
        "updated_at": "2025-08-10T10:00:00.000000Z",
        "counter": {
          "id": 1,
          "name": "Kallyanpur Counter",
          "location": "Kallyanpur, Dhaka"
        }
      }
    ]
  }
}
                

Response Details:

  • Complete Configuration - Includes all related data (coach, schedule, bus, seat plan, route)
  • Boarding/Dropping Points - Array of all associated boarding and dropping points with counter details
  • Timestamps - Creation and update timestamps for audit trail
  • User Tracking - Shows who created and last updated the configuration

Notes:

  • The coach configuration ID is required in the URL to specify which configuration to retrieve.
  • If the coach configuration does not exist or has been deleted, the API will return a 404 error.
  • The response includes complete related data from all associated tables.
  • Boarding/dropping points are ordered by time for easy visualization of the route.