API: Update Seat Plan by ID

Request

Update a specific seat plan by ID:

PUT /seat-plans/{id}

Request Body:


{
  "name": "Bus A",
  "floor": 1,
  "floors_data": [
    {
      "name": "Floor 1",
      "layoutType": "2-2",
      "rows": 4,
      "cols": 4,
      "step": 1,
      "extraSeat": 0,
      "seats": [
        { "seatName": "A1", "rowNumber": 1, "colNumber": 1, "seatType": "regular", "isDisable": 0, "status": 1 },
        { "seatName": "A2", "rowNumber": 1, "colNumber": 2, "seatType": "regular", "isDisable": 0, "status": 1 },
        { "seatName": "A3", "rowNumber": 1, "colNumber": 3, "seatType": "regular", "isDisable": 0, "status": 1 },
        { "seatName": "A4", "rowNumber": 1, "colNumber": 4, "seatType": "regular", "isDisable": 0, "status": 1 },
        { "seatName": "B1", "rowNumber": 2, "colNumber": 1, "seatType": "regular", "isDisable": 0, "status": 1 },
        { "seatName": "B2", "rowNumber": 2, "colNumber": 2, "seatType": "regular", "isDisable": 0, "status": 1 },
        { "seatName": "B3", "rowNumber": 2, "colNumber": 3, "seatType": "regular", "isDisable": 0, "status": 1 },
        { "seatName": "B4", "rowNumber": 2, "colNumber": 4, "seatType": "regular", "isDisable": 0, "status": 1 },
        { "seatName": "C1", "rowNumber": 3, "colNumber": 1, "seatType": "regular", "isDisable": 0, "status": 1 },
        { "seatName": "C2", "rowNumber": 3, "colNumber": 2, "seatType": "regular", "isDisable": 0, "status": 1 },
        { "seatName": "C3", "rowNumber": 3, "colNumber": 3, "seatType": "regular", "isDisable": 0, "status": 1 },
        { "seatName": "C4", "rowNumber": 3, "colNumber": 4, "seatType": "regular", "isDisable": 0, "status": 1 },
        { "seatName": "D1", "rowNumber": 4, "colNumber": 1, "seatType": "regular", "isDisable": 0, "status": 1 },
        { "seatName": "D2", "rowNumber": 4, "colNumber": 2, "seatType": "regular", "isDisable": 0, "status": 1 },
        { "seatName": "D3", "rowNumber": 4, "colNumber": 3, "seatType": "regular", "isDisable": 0, "status": 1 },
        { "seatName": "D4", "rowNumber": 4, "colNumber": 4, "seatType": "regular", "isDisable": 0, "status": 1 }
      ]
    }
  ]
}
                

Sample Response:


{
    "status": "success",
    "code": 200,
    "message": "Seat plan with seats retrieved successfully",
    "data": {
        "id": 1,
        "name": "Bus A",
        "floor": 1,
        "created_by": 1,
        "updated_by": 1,
        "created_at": "2025-08-23 11:18:25",
        "updated_at": "2025-08-23 11:35:07",
        "floors": [
            {
                "id": 9,
                "seat_plan_id": 1,
                "name": "Floor 1",
                "layout_type": "2-2",
                "rows": 4,
                "cols": 4,
                "step": 1,
                "is_extra_seat": 0,
                "created_by": 1,
                "updated_by": null,
                "created_at": "2025-08-23 11:35:07",
                "updated_at": "2025-08-23 11:35:07",
                "seats": [
                    {
                        "id": 130,
                        "seat_plan_floor_id": 9,
                        "seat_plan_id": 1,
                        "seat_number": "A1",
                        "row_position": 1,
                        "col_position": 1,
                        "seat_type": "regular",
                        "is_disable": 0,
                        "status": "1",
                        "created_by": 1,
                        "updated_by": null,
                        "created_at": "2025-08-23 11:35:07",
                        "updated_at": "2025-08-23 11:35:07"
                    },
                    {
                        "id": 131,
                        "seat_plan_floor_id": 9,
                        "seat_plan_id": 1,
                        "seat_number": "A2",
                        "row_position": 1,
                        "col_position": 2,
                        "seat_type": "regular",
                        "is_disable": 0,
                        "status": "1",
                        "created_by": 1,
                        "updated_by": null,
                        "created_at": "2025-08-23 11:35:07",
                        "updated_at": "2025-08-23 11:35:07"
                    },
                    {
                        "id": 132,
                        "seat_plan_floor_id": 9,
                        "seat_plan_id": 1,
                        "seat_number": "A3",
                        "row_position": 1,
                        "col_position": 3,
                        "seat_type": "regular",
                        "is_disable": 0,
                        "status": "1",
                        "created_by": 1,
                        "updated_by": null,
                        "created_at": "2025-08-23 11:35:07",
                        "updated_at": "2025-08-23 11:35:07"
                    },
                    {
                        "id": 133,
                        "seat_plan_floor_id": 9,
                        "seat_plan_id": 1,
                        "seat_number": "A4",
                        "row_position": 1,
                        "col_position": 4,
                        "seat_type": "regular",
                        "is_disable": 0,
                        "status": "1",
                        "created_by": 1,
                        "updated_by": null,
                        "created_at": "2025-08-23 11:35:07",
                        "updated_at": "2025-08-23 11:35:07"
                    },
                    {
                        "id": 134,
                        "seat_plan_floor_id": 9,
                        "seat_plan_id": 1,
                        "seat_number": "B1",
                        "row_position": 2,
                        "col_position": 1,
                        "seat_type": "regular",
                        "is_disable": 0,
                        "status": "1",
                        "created_by": 1,
                        "updated_by": null,
                        "created_at": "2025-08-23 11:35:07",
                        "updated_at": "2025-08-23 11:35:07"
                    },
                    {
                        "id": 135,
                        "seat_plan_floor_id": 9,
                        "seat_plan_id": 1,
                        "seat_number": "B2",
                        "row_position": 2,
                        "col_position": 2,
                        "seat_type": "regular",
                        "is_disable": 0,
                        "status": "1",
                        "created_by": 1,
                        "updated_by": null,
                        "created_at": "2025-08-23 11:35:07",
                        "updated_at": "2025-08-23 11:35:07"
                    },
                    {
                        "id": 136,
                        "seat_plan_floor_id": 9,
                        "seat_plan_id": 1,
                        "seat_number": "B3",
                        "row_position": 2,
                        "col_position": 3,
                        "seat_type": "regular",
                        "is_disable": 0,
                        "status": "1",
                        "created_by": 1,
                        "updated_by": null,
                        "created_at": "2025-08-23 11:35:07",
                        "updated_at": "2025-08-23 11:35:07"
                    },
                    {
                        "id": 137,
                        "seat_plan_floor_id": 9,
                        "seat_plan_id": 1,
                        "seat_number": "B4",
                        "row_position": 2,
                        "col_position": 4,
                        "seat_type": "regular",
                        "is_disable": 0,
                        "status": "1",
                        "created_by": 1,
                        "updated_by": null,
                        "created_at": "2025-08-23 11:35:07",
                        "updated_at": "2025-08-23 11:35:07"
                    },
                    {
                        "id": 138,
                        "seat_plan_floor_id": 9,
                        "seat_plan_id": 1,
                        "seat_number": "C1",
                        "row_position": 3,
                        "col_position": 1,
                        "seat_type": "regular",
                        "is_disable": 0,
                        "status": "1",
                        "created_by": 1,
                        "updated_by": null,
                        "created_at": "2025-08-23 11:35:07",
                        "updated_at": "2025-08-23 11:35:07"
                    },
                    {
                        "id": 139,
                        "seat_plan_floor_id": 9,
                        "seat_plan_id": 1,
                        "seat_number": "C2",
                        "row_position": 3,
                        "col_position": 2,
                        "seat_type": "regular",
                        "is_disable": 0,
                        "status": "1",
                        "created_by": 1,
                        "updated_by": null,
                        "created_at": "2025-08-23 11:35:07",
                        "updated_at": "2025-08-23 11:35:07"
                    },
                    {
                        "id": 140,
                        "seat_plan_floor_id": 9,
                        "seat_plan_id": 1,
                        "seat_number": "C3",
                        "row_position": 3,
                        "col_position": 3,
                        "seat_type": "regular",
                        "is_disable": 0,
                        "status": "1",
                        "created_by": 1,
                        "updated_by": null,
                        "created_at": "2025-08-23 11:35:07",
                        "updated_at": "2025-08-23 11:35:07"
                    },
                    {
                        "id": 141,
                        "seat_plan_floor_id": 9,
                        "seat_plan_id": 1,
                        "seat_number": "C4",
                        "row_position": 3,
                        "col_position": 4,
                        "seat_type": "regular",
                        "is_disable": 0,
                        "status": "1",
                        "created_by": 1,
                        "updated_by": null,
                        "created_at": "2025-08-23 11:35:07",
                        "updated_at": "2025-08-23 11:35:07"
                    },
                    {
                        "id": 142,
                        "seat_plan_floor_id": 9,
                        "seat_plan_id": 1,
                        "seat_number": "D1",
                        "row_position": 4,
                        "col_position": 1,
                        "seat_type": "regular",
                        "is_disable": 0,
                        "status": "1",
                        "created_by": 1,
                        "updated_by": null,
                        "created_at": "2025-08-23 11:35:07",
                        "updated_at": "2025-08-23 11:35:07"
                    },
                    {
                        "id": 143,
                        "seat_plan_floor_id": 9,
                        "seat_plan_id": 1,
                        "seat_number": "D2",
                        "row_position": 4,
                        "col_position": 2,
                        "seat_type": "regular",
                        "is_disable": 0,
                        "status": "1",
                        "created_by": 1,
                        "updated_by": null,
                        "created_at": "2025-08-23 11:35:07",
                        "updated_at": "2025-08-23 11:35:07"
                    },
                    {
                        "id": 144,
                        "seat_plan_floor_id": 9,
                        "seat_plan_id": 1,
                        "seat_number": "D3",
                        "row_position": 4,
                        "col_position": 3,
                        "seat_type": "regular",
                        "is_disable": 0,
                        "status": "1",
                        "created_by": 1,
                        "updated_by": null,
                        "created_at": "2025-08-23 11:35:07",
                        "updated_at": "2025-08-23 11:35:07"
                    },
                    {
                        "id": 145,
                        "seat_plan_floor_id": 9,
                        "seat_plan_id": 1,
                        "seat_number": "D4",
                        "row_position": 4,
                        "col_position": 4,
                        "seat_type": "regular",
                        "is_disable": 0,
                        "status": "1",
                        "created_by": 1,
                        "updated_by": null,
                        "created_at": "2025-08-23 11:35:07",
                        "updated_at": "2025-08-23 11:35:07"
                    }
                ]
            }
        ]
    }
}