DRF Project to allocate service areas for providers
Tools used:
Premise:
we have a growing problem that many transportation suppliers we'd like to integrate cannot give us concrete zipcodes, cities, etc that they serve. To combat this, we'd like to be able to define custom polygons as their "service area" and we'd like for the owners of these shuttle companies to be able to define and alter their polygons whenever they want, eliminating the need for employees to do this boring grunt work.
Project should have API endpoints to create, update, delete, and retreive information about providers. Batch operations are not necessary except for get. A provider should contain the following information:
- Name
- Email
- Phone Number
- Language
- Currency
Once a provider is created they should be able to start defining service areas. These service areas will be geojson polygons and should be stored in the database in a way that they can be retreived and queried upon easily. There should be endpoints to create, update, delete, and get a polygon. Batch operations are not necessary except for get. A polygon should contain a name and price as well as the geojson information.
You should create an API endpoint to query this data. It should take a lat/lng pair as arguments and return a list of all polygons that include the given lat/lng. The name of the polygon, provider's name, and price should be returned for each polygon. This operation should be FAST. There are thousand of providers and hundreds of thousands of service areas.
Login Credentials:
- email: [email protected]
- password: admin12345
Admin panel: http://139.59.27.97.nip.io:62492/ Api Docs: http://139.59.27.97.nip.io:62492/docs/
The user registration is the equivalent of the provider registration. The service section hopefully is self explanatory. You can query for polygons and provider details by making a GET request to:
http://139.59.27.97.nip.io:62492/api/v1/service/?lat=1.0&long2.0
where lat and long are the query params to be passed in the request.