User references (tiosUser) are MongoDB user IDs (24-character hex strings), not usernames.
Returns all train claims as an array ([] if none).
[ { "_id": "665f...", "trainNumber": "301", "tiosUser": "665f1a0c9b1e8a0012a4b7a1", "__v": 0 } ]
Returns the claim for a specific train as a single object, or 404 with { "error": "Train claim not found" }.
{ "_id": "665f...", "trainNumber": "301", "tiosUser": "665f1a0c9b1e8a0012a4b7a1", "__v": 0 }
Returns an array of all claims held by a specific user, where :tiosUser is the user's MongoDB ID (same shape as GET /fido/trainClaims), or 404 with { "error": "No train claims found for this user" } if there are none.
{ "trainNumber": "301", "tiosUser": "665f1a0c9b1e8a0012a4b7a1" }
Returns an array of every train document (same shape as GET /trains) with an extra tiosUser field, set to the claiming user's MongoDB ID or null when unclaimed.
{ "tiosUser": "665f1a0c9b1e8a0012a4b7a1" }
Creates a claim for the train. Returns 409 if a claim already exists; use DELETE /fido/trainClaims/:trainNumber before creating a different claim.
Returns the train, its claim, active announcements relevant to its current route, and station staffing information added to each current-route stop when a staffing record exists.
Response
{
"trainInfo": {
"trainNumber": "301",
"currentRoute": [
{ "code": "SK", "staffingType": "dispatcher" }
]
},
"claim": { "trainNumber": "301", "tiosUser": "665f1a0c9b1e8a0012a4b7a1" },
"announcements": []
}
claim is null when the train has no claim. Stations with a staffing record return its staffing type, or "unstaffed" when the station is not staffed.
Releases the claim on a train.