A simple client to integrate with the GLiMR case management system in use in various UK tribunals.
The gem expects a
GLIMR_API_URL environment variable, providing the
endpoint at which the API can be found. This will be something like;
This URL must be accessible from wherever your code is running.
If you need to set the api timeout, use the
environment variable. This defaults to 5 seconds.
The call to register new cases can take a long time. It has its own
timeout as a result: 32 seconds. Use the
GLIMR_REGISTER_NEW_CASE_TIMEOUT_SECONDS environment variable to
Check if the GLiMR API is available. Raises
GlimrApiClient::Unavailable if anything other than a positive response
is received; this includes network errors and timeouts.
Register a New Case
Accepts the following parameters:
jurisdictionId: 8, onlineMappingCode: 'something', contactPhone: '1234', contactFax: '5678', contactEmail: 'foo_at_bar.com', contactPreference: 'Email', contactFirstName: 'Alice', contactLastName: 'Caroll', contactStreet1: '5_Wonderstreet', contactStreet2: 'contact_street_2', contactStreet3: 'contact_street_3', contactStreet4: 'contact_street_4', contactCity: 'London', documentsURL: 'http...google.com', repPhone: '7890', repFax: '6789', repEmail: 'bar_at_baz.com', repPreference: 'Fax', repReference: 'MYREF', repIsAuthorised: 'Yes', repOrganisationName: 'Acme._Ltd.', repFAO: 'Bob_Hope', repStreet1: '5_Repstreet', repStreet2: 'Repton', repStreet3: 'Repshire', repStreet4: 'Rep_st._4', repCity: 'City_of_reps'
onlineMappingCode are mandatory.
Pending a Ministerial review of fees in tribunals, the four method related to managing payment were deprecated in late April, 2017.
In the event that these methods are required at a later date, the code can be re-vivfied in the repo. See the following commit for details of files removed:
The specs may require some adaption.
See the dummy Rails app in
/spec/dummy for examples of how the gem might
be used in a production environment.
Add this line to your application’s Gemfile:
And then execute:
Or install it yourself as:
$ gem install glimr-api-client
bundle rake in the gem source directory for a full set of specs,
mutation tests and rubocop checks.
In an application
Examples of how this gem might be used can be found in the specs. There
is also a set of RSpec shared examples that can be copied and modified.
These can be found in
Fork, then clone the repo:
git clone email@example.com:your-username/glimr-api-client.git
Make sure the tests pass:
bundle bundle db:setup bundle exec rake
Make your change. Add specs for your change. Make the specs pass:
bundle exec rake
Push to your fork and submit a pull request.
Some things that will increase the chance that your pull request is accepted:
- Write specs.
- Make sure you don’t have any mutants (part of total test suite).
- Write a good commit message.
Released under the MIT License. Copyright (c) 2015-2016 Ministry of Justice.