Skip to content

Latest commit

 

History

History
45 lines (35 loc) · 1.18 KB

README.md

File metadata and controls

45 lines (35 loc) · 1.18 KB

Checks API

action status action status

Here is the project with using only APIView

The service receives information about a new order, creates checks for all the printers of the specified location in the database, and initiates asynchronous tasks for generating PDF files for these checks. If the location does not have any printers, an error is returned. If checks for this order have already been created, an error is returned along with the order number.

Endpoints

GET /api/check/ - List of all  checks.
GET /api/check/<int:id>/ - Detail of current check.
GET /api/check/?point_id=<int:id>/ - List of checks for current point id.
PUT /api/check/<int:id>/update/ - check downloading and marking as printed.
POST /api/create/ - Check create.

Request example.

{
  "point_id": 1,
  "order": {
    "order_id": 2,
    "item": "Milk",
    "quantity": 2,
    "price": 10.99
  }
}

Testing

Tested using pytest and pytest-django.