No description, website, or topics provided.
Python Shell Makefile Mako
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.idea
fragments
integration_tests
migrations
organisation_api
unit_tests
.gitignore
Dockerfile
Makefile
README.md
configuration.yml
integration_test.sh
manage.py
organisation-api.iml
requirements.txt
requirements_test.txt
run_linting.sh
setup.cfg
unit_test.sh

README.md

Organisation-api

This service is responsible for organisation details and is connected to by deed-api when a Borrower has signed in and is viewing a deed.

See: deed-api at

Contents

Usage

In its current state, you can use the service to retrieve, post or delete an organisation name to a local database. This is used to display an organisation name on a deed in the Borrower Frontend that does not have any unnecessary information within it.

Available routes

get     /organisation-name/<organisation_id>    # Get a friendly organisation name
post    /organisation/                          # Create an organisation by posting a json object reflecting the schema in the organisation_name views module
delete  /organisation/<organisation_id>         # Delete a friendly organisation name

Useful Curl commands

Get

curl localhost:9060/organisation-name/10.1.1

Post

curl -X POST -d '{"organisation_name": "Bananas", "organisation_id": "10.1.1"}' -H "Content-Type: application/json" http://localhost:9060/organisation-name

Delete

curl -X "DELETE" localhost:9060/organisation-name/10.1.1

Quick start

### For Flask CLI
export FLASK_APP=organisation_api/main.py
export FLASK_DEBUG=1
### For Python
export PYTHONUNBUFFERED=yes
### For gunicorn
export PORT=9060
### For app's config.py
export FLASK_LOG_LEVEL=DEBUG
export COMMIT=LOCAL

### Run the app
flask run

or run the shell command:

make run

Unit tests

These bashin instructions apply only for our development environment

bashin organisation-api
make unittest