nautoguide / map_tracker

Framework for Adventure Syndicate project pitting schools against live tracker
0 stars 2 forks source link

Input Form #4

Closed citizenfish closed 5 years ago

citizenfish commented 5 years ago

Create a mileage input form where an organisation can add their mileage records. This is done using the "add" method of the feature_api as shown below:-

{
 "feature_type" : "distance_record",
 "distance" : "<distance in METRES so divide miles by 0.000621>"
 "org_id" : "A unique that the organisation will be given, test with ORG1/ORG2/ORG3/ORG4",
"org_rider": "Name of rider or the whole organisation"
}

Then display the mileages in a leaderboard using the report "leaderboard". This is done using the reporting_api and method run_report:-

{
 "report_name" : "leaderboard"
}

It will return an array of leaderboard attributes.

[{
    "position": "1",
    "org_name": "Adventure Syndicate",
    "distance_miles": "204.40",
    "distance_km": "328.95",
    "date": "11/03/2019 21:03"
},{
    "position": "2",
    "org_name": "Organisation 1",
    "distance_miles": "1.24",
    "distance_km": "2.00",
    "date": "11/03/2019 21:03"
}]