Skip to content

adebard/mozio-test-coding-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mozio test coding project.

API documentation:

Providers:

Service Areas:

Note: The polygon area accept WKT and GeoJSON as input

  • Service areas list:
    [
        {
            "id": 1,
            "provider_name": "Test",
            "name": "Area for test",
            "price": "200.00",
            "area": {
             "type": "Polygon",
             "coordinates": [
                 [
                     [
                         30.0,
                         10.0
                     ],
                     [
                         40.0,
                         40.0
                     ],
                     [
                         20.0,
                         40.0
                     ],
                     [
                         10.0,
                         20.0
                     ],
                     [
                         30.0,
                         10.0
                     ]
                 ]
             ]
         },
         "provider": 1
        }
    ]
    
  • Service area detail:
     {
          "id": 1,
          "provider_name": "Test",
          "name": "Area for test",
          "price": "200.00",
          "area": {
           "type": "Polygon",
           "coordinates": [
               [
                   [
                       30.0,
                       10.0
                   ],
                   [
                         40.0,
                         40.0
                   ],
                   [
                       20.0,
                       40.0
                   ],
                   [
                       10.0,
                       20.0
                   ],
                   [
                       30.0,
                       10.0
                   ]
               ]
           ]
       }
    
  • Service area delete:
  • Service area create:
  • Service area update:
    • Endpoint: /service-areas/<ID>/
    • Example URL: http://ec2-54-210-228-174.compute-1.amazonaws.com/service-areas/1/
    • Method: PUT
    • Success 200
    • Example payload:
       {
           "provider_name": "Test",
           "name": "Area for test",
           "price": "200.00",
           "area": {
           "type": "Polygon",
           "coordinates": [
               [
                   [
                       30.0,
                       10.0
                   ],
                   [
                         40.0,
                         40.0
                   ],
                   [
                       20.0,
                       40.0
                   ],
                   [
                       10.0,
                       20.0
                   ],
                   [
                       30.0,
                       10.0
                   ]
               ]
           ]
       }
      
  • Search service area given lat/long pair:
    [
        {
            "id": 1,
            "provider_name": "Test",
            "name": "Area for test",
            "price": "200.00",
            "area": {
             "type": "Polygon",
             "coordinates": [
                 [
                     [
                         30.0,
                         10.0
                     ],
                     [
                         40.0,
                         40.0
                     ],
                     [
                         20.0,
                         40.0
                     ],
                     [
                         10.0,
                         20.0
                     ],
                     [
                         30.0,
                         10.0
                     ]
                 ]
             ]
         },
         "provider": 1
        }
    ]
    
    
    

Infrastructure and details:

  • AWS EC2
  • PostgreSQL (PostGIS)
  • Nginx
  • Gunicorn

Tests:

python manage.py test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages