alphagov/govuk_content_api — pull request #21 by JordanHatch (2012-09-19 16:43:32+00:00)
Title: Include licence details from Licensify in API responses for LicenceEditions

Where a LicenceEdition has a licence identifier, query the Licensify API for the licence information and available actions. If a snac code is provided, lookup the appropriate actions for the user's local authority.

The default action for when Licensify is unavailable, or times out, is to return no license at all and rescue the error, so we can at least show the licence content we have from publisher.

Note that I've mapped the api response from Licensify to new key names in the response from content api. This is for two reasons: changing from camelCase to snake_case, to bring in line with the rest of the response; and to make the keys more meaningful in the context of who and what will be consuming this api - ie "actions" is a lot simpler than "authorityInteractions" to users who may be accessing this when we expose it. I'd appreciate any feedback on this.