KaneKnight / PythonTechnicalTest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Origin Markets Backend Test

API DOCS

API documentation can be found here: https://documenter.getpostman.com/view/5708033/TVKHUFbK

Description

Code for the API can be found in the bonds folder. views.py contains most of the logic. test.py contains the tests for the api.

Spec:

We would like you to implement an api to: ingest some data representing bonds, query an external api for some additional data, store the result, and make the resulting data queryable via api.

  • Fork this hello world repo leveraging Django & Django Rest Framework. (If you wish to use something else like flask that's fine too.)
  • Please pick and use a form of authentication, so that each user will only see their own data. (DRF Auth Options)
  • We are missing some data! Each bond will have a lei field (Legal Entity Identifier). Please use the GLEIF API to find the corresponding Legal Name of the entity which issued the bond.
  • If you are using a database, SQLite is sufficient.
  • Please test any additional logic you add.

Project Quickstart

Inside a virtual environment running Python 3:

  • pip install -r requirement.txt
  • ./manage.py runserver to run server.
  • ./manage.py test to run tests.

API

We should be able to send a request to:

POST /bonds/

to create a "bond" with data that looks like:

{
    "isin": "FR0000131104",
    "size": 100000000,
    "currency": "EUR",
    "maturity": "2025-02-28",
    "lei": "R0MUWSFPU8MPRO8K5P83"
}

We should be able to send a request to:

GET /bonds/

to see something like:

[
    {
        "isin": "FR0000131104",
        "size": 100000000,
        "currency": "EUR",
        "maturity": "2025-02-28",
        "lei": "R0MUWSFPU8MPRO8K5P83",
        "legal_name": "BNPPARIBAS"
    },
    ...
]

We would also like to be able to add a filter such as: GET /bonds/?legal_name=BNPPARIBAS

to reduce down the results.

About


Languages

Language:Python 100.0%