Skip to content

Commit

Permalink
add attribute docs to resources
Browse files Browse the repository at this point in the history
  • Loading branch information
bfauble committed Dec 14, 2023
1 parent 0a2571f commit 329b429
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
11 changes: 11 additions & 0 deletions apps/api_web/lib/api_web/controllers/prediction_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,17 @@ defmodule ApiWeb.PredictionController do
)

status(:string, "Status of the schedule", example: "Approaching")

revenue_status(
:string,
"""
| Value | Description |
|-----------------|-------------|
| `"REVENUE"` | Indicates that the associated trip is accepting passengers. |
| `"NON_REVENUE"` | Indicates that the associated trip is not accepting passengers. |
""",
example: "REVENUE"
)
end

direction_id_attribute()
Expand Down
11 changes: 11 additions & 0 deletions apps/api_web/lib/api_web/controllers/trip_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,17 @@ defmodule ApiWeb.TripController do
""",
example: 1
)

revenue_status(
:string,
"""
| Value | Description |
|-----------------|-------------|
| `"REVENUE"` | Indicates that the associated trip is accepting passengers. |
| `"NON_REVENUE"` | Indicates that the associated trip is not accepting passengers. |
""",
example: "REVENUE"
)
end

direction_id_attribute()
Expand Down
11 changes: 11 additions & 0 deletions apps/api_web/lib/api_web/controllers/vehicle_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,17 @@ defmodule ApiWeb.VehicleController do
}
]
)

revenue_status(
:string,
"""
| Value | Description |
|-----------------|-------------|
| `"REVENUE"` | Indicates that the associated trip is accepting passengers. |
| `"NON_REVENUE"` | Indicates that the associated trip is not accepting passengers. |
""",
example: "REVENUE"
)
end

direction_id_attribute()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,8 @@ defmodule ApiWeb.VehicleControllerTest do
"current_stop_sequence" => nil,
"updated_at" => nil,
"occupancy_status" => nil,
"carriages" => []
"carriages" => [],
"revenue" => "REVENUE"
}
}
end
Expand Down

0 comments on commit 329b429

Please sign in to comment.