LandRegistry/update-register

Name: update-register

Owner: HM Land Registry

Description: null

Created: 2015-05-28 08:15:17.0

Updated: 2015-05-28 10:34:11.0

Pushed: 2015-10-26 11:08:20.0

Homepage: null

Size: 283

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Update register

At the moment this is a spike to see how entries on the system of record can be created updated and deleted.

how to run.

For now, python run.py.

This will work in the devenv-casework environment is the following is added to the yaml.

update-register:
repo: https://github.com/LandRegistry/update-register.git
branch: master
port: 5004
entrypoint: application:app
vars:
Migrate tables

From with the virtual machine you need to Export the environment variable to connect to the database.

rt SQLALCHEMY_DATABASE_URI="postgresql://workingregister:workingregister@localhost/workingregister"

Then run the command to upgrade the tables

on manage.py db upgrade

Ideally this would be scripted as part of the vagrant up (find a way to add to lr-setup-apps)

Curls
Amend an entry
 -X POST -d '{"entry_id": "998","full_text": "dog"}' -H "Content-Type: application/json" http://localhost:5003/titles/dn100/groups/1/entries/1
Insert an entry
 -X PUT -d '{"entry_id": "998","full_text": "dog"}' -H "Content-Type: application/json" http://localhost:5004/titles/dn100/groups/1/entries
Delete an entry
 -X DELETE http://localhost:5004/titles/dn100/groups/1/entries/0
Insert a group
 -X PUT -d '{"group_id":"76","category":"ZVCF","entries":[{"entry_id":"498","full_text":"fly"},{"entry_id":"233","full_text":"bug"}]}' -H "Content-Type: application/json" http://localhost:5004/titles/dn100/groups
Delete a group
 -X DELETE http://localhost:5004/titles/dn100/groups/0
Amend a group
 -X POST -d '{"group_id":"76","category":"ZVCF","entries":[{"entry_id":"498","full_text":"fly"},{"entry_id":"233","full_text":"bug"}]}' -H "Content-Type: application/json" http://localhost:5004/titles/dn100/groups/1
Start a new version of a title (work in progress). Creates test data at the moment.
 -X POST -d '{"application_reference": "testabr", "title_number": "tt12345"}' -H "Content-Type: application/json" http://localhost:5004/start
Tests

install requirements_test.txt and run

ce test.sh
Todo

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.