Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a model for Ambulance and expose API #63

Closed
3 tasks
bodhish opened this issue Mar 22, 2020 · 10 comments
Closed
3 tasks

Create a model for Ambulance and expose API #63

bodhish opened this issue Mar 22, 2020 · 10 comments

Comments

@bodhish
Copy link
Member

bodhish commented Mar 22, 2020

Vehicle Details

  • Vehicle Registration Number: string (validation: A-Z and 0-9 (Alpha numeric only))
  • Insurance Valid till: date (validation- year should one of 2020 / 2021 / 2022)
  • Name of Owner: string
  • Cell Number of Owner: number (10 digit mobile number)
  • Smart Phone: bool
  • Primary District Served: District.id
  • Secondary District Served: District.id
  • Third District Served: District.id
  • Oxygen Yes / No
  • Ventilator Yes / No
  • Suction Machine Yes / No
  • Defibrillator Yes / No

Driver Details

Name of Driver 1
Cell Number of Driver 1
Smart Phone Yes / No

Driver Details

Name of Driver 2
Cell Number of Driver 2
Smart Phone Yes / No

Checklist

  • Create the table and organize the data
  • Add a CRUD API for front-end
  • Add an API to get ambulance details given an array of registration number
@anroopak
Copy link
Contributor

I can take this

@rejuls
Copy link
Contributor

rejuls commented Mar 22, 2020

@anroopak you on it?

@anroopak
Copy link
Contributor

@rejuls Yes

@bodhish
Copy link
Member Author

bodhish commented Mar 22, 2020

A minor update.

Given an array of registration numbers return an array with details.

@anroopak
Copy link
Contributor

APIs -
POST /ambulance/

{
            "facility": 1, // facility ID
             "drivers": [
                {
                    "name": "Roopak A N",
                    "phone_number": "+91",
                    "is_smart_phone": true
                }
            ],
            "vehicle_number": "KL13A1234", // without spaces
            "owner_name": "Name",
            "owner_phone_number": "+91",
            "owner_is_smart_phone": true,
            "primary_district": 13,
            "secondary_district": 11,
            "third_district": null,
            "has_oxygen": true,
            "has_ventilator": true,
            "has_suction_machine": false,
            "has_defibrillator": true,
            "insurance_valid_till_year": 2020,
           
        }

GET ambulance/?vehicle_numbers=KL13A1234,KL13B1234 // comma seperated

    "count": 2,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": 1,
            "drivers": [
                {
                    "id": 1,
                    "name": "Roopak A N",
                    "phone_number": "+91",
                    "is_smart_phone": true
                }
            ],
            "vehicle_number": "KL13B1234",
            "owner_name": "Name",
            "owner_phone_number": "+91",
            "owner_is_smart_phone": true,
            "primary_district": 13,
            "secondary_district": 11,
            "third_district": null,
            "has_oxygen": true,
            "has_ventilator": true,
            "has_suction_machine": false,
            "has_defibrillator": true,
            "insurance_valid_till_year": 2020,
            "facility": 1
        },
        {
            "id": 2,
            "drivers": [],
            "vehicle_number": "KL13A1234",
            "owner_name": "Name",
            "owner_phone_number": "+91",
            "owner_is_smart_phone": true,
            "primary_district": 13,
            "secondary_district": 2,
            "third_district": null,
            "has_oxygen": true,
            "has_ventilator": true,
            "has_suction_machine": false,
            "has_defibrillator": false,
            "insurance_valid_till_year": 2022,
            "facility": 1
        }
    ]
}```

@vigneshhari
Copy link
Member

@anroopak the ambulance network is not connected to the facility network so you would not need a facility id in the table.

@anroopak
Copy link
Contributor

Adding and Removing a Driver (if required)

POST ambulance/1/add_driver/
{
    "name": "Roopak A N",
    "phone_number": "+918891261489",
    "is_smart_phone": true
}


DELETE /ambulance/1/remove_driver/
{
    "driver_id": 1
}

@vigneshhari
Copy link
Member

Reviewing PR

@shanavas786
Copy link
Contributor

having #67 and #68 are merged. can we close this ?

@vigneshhari
Copy link
Member

Closing Issue As Feature is added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants