LandRegistry/dm-deed-api

Name: dm-deed-api

Owner: HM Land Registry

Description: null

Created: 2015-11-03 11:59:52.0

Updated: 2016-01-12 11:48:47.0

Pushed: 2016-06-21 14:05:27.0

Homepage: null

Size: 505

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

dm-deed-api

The Deed API is a JSON API which stores deed objects.

This API holds the functionality for creating the migrating tables, getting data from the database and putting a new JSON deed onto a database that returns an endpoint to that deed.

The API also holds the functionality to capture personal information provided and save it in a separate table to be used at a later date for matching.

Contents
Usage
    /health                          # test endpoint for the application
    /deed/<id_>                      # get a deed with an id in the URL
    /deed/                           # Create a deed by posting a json object reflecting the schema
te  /borrowers/delete/<borrower_id>  # delete a borrower from the borrower table

schema for post

Getting Started
  1. Clone the repo
  2. In the directory enter the command
    install -r requirements.txt
    
  3. To run the application run the command
    ce run.sh
    
Migration

Run the Migration

on manage.py db upgrade

Add a migration

on manage.py db revision --autogenerate

For some helpful documentation on using alembic go here

Unit tests

Run the unit tests

ce test.sh
Acceptance tests

See, the following link for information on how to run the acceptance tests:-

Acceptance Tests

Current Schema

The Deed requires a title number and at least 1 borrower

Deed

The schema can be found below

s://github.com/LandRegistry/dm-deed-api/blob/develop/application/deed/schema.json

Example payload:


"title_number": "DT100",
"md_ref": "e-MD12344",
"borrowers": [
  {
       "forename": "Paul",
       "middle_name": "James",
       "surname": "Smythe",
       "gender": "Male",
       "address": "2 The Street, Plymouth, PL1 2PP",
       "dob": "01/10/1976",
       "phone_number": "07502159062"
   },
   {
        "forename": "Jane",
        "surname": "Smythe",
        "gender": "Female",
        "address": "2 The Street, Plymouth, PL1 2PP",
        "dob": "01/12/1982",
        "phone_number": "07502154999"
    }
],
"identity_checked": "Y",
"property_address": "5 The Drive, This Town, This County, PL4 4TH"


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.