{"action":"created","comment":{"url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/pulls/comments/210286284","pull_request_review_id":146467529,"id":210286284,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMDI4NjI4NA==","diff_hunk":"@@ -0,0 +1,387 @@\n+package uk.gov.companieshouse.api.accounts.service.impl;\n+\n+import com.fasterxml.jackson.core.JsonProcessingException;\n+import com.fasterxml.jackson.databind.ObjectMapper;\n+import java.io.IOException;\n+import java.time.LocalDate;\n+import java.util.Arrays;\n+import java.util.HashMap;\n+import java.util.List;\n+import java.util.Map;\n+import org.json.JSONObject;\n+import org.springframework.beans.factory.annotation.Autowired;\n+import org.springframework.http.MediaType;\n+import org.springframework.stereotype.Service;\n+import uk.gov.companieshouse.api.accounts.AccountsType;\n+import uk.gov.companieshouse.api.accounts.LinkType;\n+import uk.gov.companieshouse.api.accounts.model.entity.CompanyAccountEntity;\n+import uk.gov.companieshouse.api.accounts.model.filing.Data;\n+import uk.gov.companieshouse.api.accounts.model.filing.Filing;\n+import uk.gov.companieshouse.api.accounts.model.filing.Link;\n+import uk.gov.companieshouse.api.accounts.model.ixbrl.Account;\n+import uk.gov.companieshouse.api.accounts.service.FilingService;\n+import uk.gov.companieshouse.api.accounts.transaction.Transaction;\n+import uk.gov.companieshouse.api.accounts.util.ixbrl.accountsbuilder.AccountsBuilder;\n+import uk.gov.companieshouse.api.accounts.util.ixbrl.ixbrlgenerator.DocumentGeneratorConnection;\n+import uk.gov.companieshouse.api.accounts.util.ixbrl.ixbrlgenerator.IxbrlGenerator;\n+import uk.gov.companieshouse.document.data.DocumentDescriptionHelper;\n+import uk.gov.companieshouse.environment.EnvironmentReader;\n+\n+@Service\n+public class FilingServiceImpl implements FilingService {\n+\n+    private static final String API_KEY_ENV_VAR = \"CHS_API_KEY\";\n+    private static final String DISABLE_IXBRL_VALIDATION_ENV_VAR = \"DISABLE_IXBRL_VALIDATION\";\n+    private static final String DOCUMENT_BUCKET_NAME_ENV_VAR = \"DOCUMENT_BUCKET_NAME\";\n+    private static final String DOCUMENT_RENDER_SERVICE_END_POINT = \"/document-render/store\";\n+    private static final String DOCUMENT_RENDER_SERVICE_HOST_ENV_VAR = \"DOCUMENT_RENDER_SERVICE_HOST\";\n+    private static final String IXBRL_LOCATION = \"s3://%s/%s/%s\";\n+    private static final String LINK_RELATIONSHIP = \"accounts\";\n+    private static final String PERIOD_END_ON = \"period_end_on\";\n+\n+    private final EnvironmentReader environmentReader;\n+    private final ObjectMapper objectMapper;\n+    private final IxbrlGenerator ixbrlGenerator;\n+    private final AccountsBuilder accountsBuilder;\n+\n+    @Autowired\n+    public FilingServiceImpl(\n+        EnvironmentReader environmentReader,\n+        ObjectMapper objectMapper,\n+        IxbrlGenerator ixbrlGenerator,\n+        AccountsBuilder accountsBuilder) {\n+\n+        this.objectMapper = objectMapper;\n+        this.environmentReader = environmentReader;\n+        this.ixbrlGenerator = ixbrlGenerator;\n+        this.accountsBuilder = accountsBuilder;\n+    }\n+\n+    /**\n+     * {@inheritDoc}\n+     */\n+    @Override\n+    public Filing generateAccountFiling(Transaction transaction, CompanyAccountEntity accountEntity)\n+        throws IOException {\n+        Filing filing = null;\n+\n+        if (isSmallFullAccount(accountEntity)) {\n+            filing = generateAccountFiling(transaction,\n+                getAccountType(AccountsType.SMALL_FULL_ACCOUNTS.getAccountType()));\n+        }\n+\n+        return filing;\n+    }\n+\n+    /**\n+     * Gets the account type information.\n+     *\n+     * @param accountTypeName - accounts type name. e.g. small-full, abridged, etc.\n+     * @return accounts type information.\n+     */\n+    private AccountsType getAccountType(String accountTypeName) {\n+        return AccountsType.getAccountsType(accountTypeName);\n+    }\n+\n+    /**\n+     * Generate the filing for the account type passed in.\n+     *\n+     * @param transaction - transaction id\n+     * @param accountsType - Account type information: account type, ixbrl's template name, account\n+     * @return {@link Filing} - null or filing with the filing information (e.g. ixbrl location,\n+     * accounts name, etc)\n+     * @throws IOException -\n+     */\n+    private Filing generateAccountFiling(Transaction transaction, AccountsType accountsType)\n+        throws IOException {\n+        Filing filing = null;\n+        Object accountObj = getAccountInformation(accountsType.getAccountType());\n+\n+        if (accountObj != null) {\n+            String ixbrlLocation = callIxbrlGenerator(accountsType,\n+                generateJson(accountsType.getAccountType(), accountObj));\n+\n+            if (ixbrlLocation != null && isValidIXBL()) {\n+                filing = createAccountFiling(transaction, accountsType, ixbrlLocation);\n+            }\n+        }\n+\n+        return filing;\n+    }\n+\n+    /**\n+     * Generate the json for the passed-in account. This is used in the request body when calling\n+     * the service.\n+     *\n+     * @param accountType - Account type information (e.g. small-full, abridged, etc)\n+     * @param accountObj - The account's type object that's being processed (e.g. Account)\n+     * @return null or ixbrl location\n+     * @throws JsonProcessingException\n+     */\n+    private String generateJson(String accountType, Object accountObj)\n+        throws JsonProcessingException {\n+        if (isSmallFullType(accountType)) {\n+            return generateCompanyAccountJSON((Account) accountObj);\n+        }\n+        return null;\n+    }\n+\n+    /**\n+     * Generates the filing based on the Filing model.\n+     *\n+     * @param transaction - transaction information\n+     * @param accountsType - Account type information: account type, ixbrl's template name, account\n+     * @param ixbrlLocation - the location where the ixbrl is stored.\n+     * @return\n+     * @throws IOException\n+     */\n+    private Filing createAccountFiling(Transaction transaction, AccountsType accountsType,\n+        String ixbrlLocation) throws IOException {\n+        Filing filing = new Filing();\n+\n+        //TODO get correct periodEndOn. periodEndOn = Current Period's end date\", mongo DB. Waiting for the API changes.\n+        LocalDate periodEndDate = LocalDate.now();\n+\n+        filing.setCompanyNumber(transaction.getCompanyNumber());\n+        filing.setDescriptionIdentifier(accountsType.getAccountType());\n+        filing.setKind(accountsType.getKind());\n+        filing.setDescription(getFilingDescription(accountsType, periodEndDate));\n+        filing.setDescriptionValues(getDescriptionValues(periodEndDate));\n+        filing.setData(getFilingData(periodEndDate, ixbrlLocation));\n+\n+        return filing;\n+    }\n+\n+    /**\n+     * Get the filing data, it contains period end date and the links (ixbrl location and\n+     * relationship link).\n+     *\n+     * @param periodEndDate - accounts end date\n+     * @param ixbrlLocation - the location where ixbrl is stored\n+     * @return {@link Data}\n+     */\n+    private Data getFilingData(LocalDate periodEndDate, String ixbrlLocation) {\n+        Data data = new Data();\n+        data.setPeriodEndOn(periodEndDate);\n+        data.setLinks(getFilingLinks(ixbrlLocation));\n+\n+        return data;\n+    }\n+\n+    /**\n+     * Get the Link containing the ixbrl location and the relationship link e.g. accounts.\n+     *\n+     * @param ixbrlLocation - the location where ixbrl is stored\n+     * @return {@link List<Link>}\n+     */\n+    private List<Link> getFilingLinks(String ixbrlLocation) {\n+        Link link = new Link();\n+        link.setRelationship(LINK_RELATIONSHIP);\n+        link.setHref(ixbrlLocation);\n+\n+        return Arrays.asList(link);\n+    }\n+\n+    /**\n+     * Get the description values, which currently contains the period end date. This data is\n+     * required for the filing description.\n+     *\n+     * @param periodEndDate - account's period end date\n+     * @return {@link Map<String,String>} containing period end date, to match filing model\n+     */\n+    private Map<String, String> getDescriptionValues(LocalDate periodEndDate) {\n+        Map<String, String> descriptionValues = new HashMap<>();\n+        descriptionValues.put(PERIOD_END_ON, periodEndDate.toString());\n+\n+        return descriptionValues;\n+    }\n+\n+    /**\n+     * Get the description for the filing. The description for the account type is retrieved by\n+     * using DocumentDescriptionHelper class.\n+     *\n+     * @param accountsType - Account type information: account type, ixbrl's template name, account\n+     * @param periodEndDate - account's period end date\n+     * @return accounts description.\n+     * @throws IOException\n+     */\n+    private String getFilingDescription(AccountsType accountsType, LocalDate periodEndDate)\n+        throws IOException {\n+        Map<String, Object> parameters = new HashMap<>();\n+        parameters.put(PERIOD_END_ON, periodEndDate);\n+\n+        return DocumentDescriptionHelper\n+            .getDescription(accountsType.getFilingDescriptionKey(), parameters);\n+    }\n+\n+    /**\n+     * Validates the ixbrl against TNEP. This validation is driven by the env. variable and it can\n+     * be disable.\n+     */\n+    private boolean isValidIXBL() {\n+\n+        boolean isIxbrlValid = true;\n+        if (\"true\".equals(getMandatoryEnvVariable(DISABLE_IXBRL_VALIDATION_ENV_VAR))) {\n+            //TODO TNEP validation needs to be added. Copy logic from abridged. Next PR\n+        }\n+\n+        return isIxbrlValid;\n+    }\n+\n+    /**\n+     * Generates the ixbrl by calling the document render service.\n+     *\n+     * @param accountsType - Account type information: account type, ixbrl's template name, account\n+     * @param requestBody - the http request request (json format)\n+     * @return The location where the service has stored the generated ixbrl.\n+     */\n+    private String callIxbrlGenerator(AccountsType accountsType, String requestBody)\n+        throws IOException {\n+        if (requestBody != null) {\n+            DocumentGeneratorConnection connection = getDocumentGeneratorConnection(accountsType,\n+                requestBody);\n+            return ixbrlGenerator.generateIXBRL(connection);\n+        }\n+\n+        return null;\n+    }\n+\n+    /**\n+     * Create DocumentGeneratorConnectionImpl instance containing the document render's request\n+     * settings. e.g. Method, Service URL, Body, etc.\n+     *\n+     * @param accountsType - Account type information: account type, ixbrl's template name, account\n+     * @param requestBody - the http request request (json format).\n+     * @return {@link DocumentGeneratorConnection} with the document render service settings.\n+     */\n+    private DocumentGeneratorConnection getDocumentGeneratorConnection(\n+        AccountsType accountsType,\n+        String requestBody) {\n+        DocumentGeneratorConnection connection = new DocumentGeneratorConnection();\n+\n+        connection.setRequestMethod(\"POST\");\n+        connection.setServiceURL(getServiceURL());\n+        connection.setRequestBody(requestBody);\n+        connection.setAuthorizationProperty(getAPIAuthorization());\n+        connection.setAssetId(accountsType.getAssetId());\n+        connection.setContentType(MediaType.TEXT_HTML_VALUE);\n+        connection.setAcceptType(MediaType.TEXT_HTML_VALUE);\n+        connection.setLocation(getIXBRLLocation(accountsType));\n+        connection.setTemplateName(accountsType.getTemplateName());\n+        connection.setSetDoOutPut(true);\n+\n+        return connection;\n+    }\n+\n+    /**\n+     * get the location the document render service needs to stored the ixbrl document. e.g.\n+     * \"s3://dev-pdf-bucket/chs-dev/accounts/small_full_accounts\"\n+     *\n+     * @param accountsType - Account type information: account type, ixbrl's template name, account\n+     * @return\n+     */\n+    private String getIXBRLLocation(AccountsType accountsType) {\n+        if (isSmallFullType(accountsType.getAccountType())) {","path":"src/main/java/uk/gov/companieshouse/api/accounts/service/impl/FilingServiceImpl.java","position":284,"original_position":284,"commit_id":"9219983ca9c8c739b1a6bbd164d62fad06d9c216","original_commit_id":"9219983ca9c8c739b1a6bbd164d62fad06d9c216","user":{"login":"ch-mcabrera","id":28534663,"node_id":"MDQ6VXNlcjI4NTM0NjYz","avatar_url":"https://avatars2.githubusercontent.com/u/28534663?v=4","gravatar_id":"","url":"https://api.github.com/users/ch-mcabrera","html_url":"https://github.com/ch-mcabrera","followers_url":"https://api.github.com/users/ch-mcabrera/followers","following_url":"https://api.github.com/users/ch-mcabrera/following{/other_user}","gists_url":"https://api.github.com/users/ch-mcabrera/gists{/gist_id}","starred_url":"https://api.github.com/users/ch-mcabrera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ch-mcabrera/subscriptions","organizations_url":"https://api.github.com/users/ch-mcabrera/orgs","repos_url":"https://api.github.com/users/ch-mcabrera/repos","events_url":"https://api.github.com/users/ch-mcabrera/events{/privacy}","received_events_url":"https://api.github.com/users/ch-mcabrera/received_events","type":"User","site_admin":false},"body":"I added it since as I am thinking to future proof it; depending on the Account Type you passed in the ixbrl could be different. e.g. one for abridged, one for account, etc. \r\n\r\nbut this is something tghta this could be added in the future  once **abridged** is migrated. ","created_at":"2018-08-15T14:27:12Z","updated_at":"2018-08-15T14:27:12Z","html_url":"https://github.com/companieshouse/company-accounts.api.ch.gov.uk/pull/36#discussion_r210286284","pull_request_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/pulls/36","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/pulls/comments/210286284"},"html":{"href":"https://github.com/companieshouse/company-accounts.api.ch.gov.uk/pull/36#discussion_r210286284"},"pull_request":{"href":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/pulls/36"}},"in_reply_to_id":210281440},"pull_request":{"url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/pulls/36","id":207336128,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA3MzM2MTI4","html_url":"https://github.com/companieshouse/company-accounts.api.ch.gov.uk/pull/36","diff_url":"https://github.com/companieshouse/company-accounts.api.ch.gov.uk/pull/36.diff","patch_url":"https://github.com/companieshouse/company-accounts.api.ch.gov.uk/pull/36.patch","issue_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/issues/36","number":36,"state":"open","locked":false,"title":"Feature/add filing generator","user":{"login":"ch-mcabrera","id":28534663,"node_id":"MDQ6VXNlcjI4NTM0NjYz","avatar_url":"https://avatars2.githubusercontent.com/u/28534663?v=4","gravatar_id":"","url":"https://api.github.com/users/ch-mcabrera","html_url":"https://github.com/ch-mcabrera","followers_url":"https://api.github.com/users/ch-mcabrera/followers","following_url":"https://api.github.com/users/ch-mcabrera/following{/other_user}","gists_url":"https://api.github.com/users/ch-mcabrera/gists{/gist_id}","starred_url":"https://api.github.com/users/ch-mcabrera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ch-mcabrera/subscriptions","organizations_url":"https://api.github.com/users/ch-mcabrera/orgs","repos_url":"https://api.github.com/users/ch-mcabrera/repos","events_url":"https://api.github.com/users/ch-mcabrera/events{/privacy}","received_events_url":"https://api.github.com/users/ch-mcabrera/received_events","type":"User","site_admin":false},"body":"Changes to implement the existing **Filing Generator** functionality from _abridged_ to _company-accounts.api_.  Changes: \r\n- Adding the Filing Generator Controller. Junit tests.\r\n- Adding the Filing Generator Implementation. Junit Tests\r\nBear in mind that amongst these changes there is an interface and its implementation contains hardcoded values since I am waiting for the API functionality (_new PR will be created for this work_)\r\n to be there. These files wouldn't need to be reviewed as they HAVE to change. \r\n  - **AccountsBuilder.java**\r\n  - **SmallFullAccountsBuilderImpl.java**\r\n\r\n- Adding the Document Render Service call functionality. \r\nThis Functionality will HAVE to be removed by a SDK call when functionality is there. This has been copied from abridged as it is pointless to reinvent the wheel since it will change. \r\nYou can review them but bear in mind this is existing code and it has to change. Files: \r\n    - **IxbrlGenerator.java**\r\n    - **IxbrlGeneratorImpl.java**\r\n    - **DocumentGeneratorConnection.java**\r\n\r\nJunit tests for the document render service have not been created as it uses static methods and for that reason has been place in a new class so that i could mock it.\r\n\r\nResolves: SFA-559","created_at":"2018-08-09T14:29:07Z","updated_at":"2018-08-15T14:27:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e1f545af33f6f71816cade68c2dc6896e8024434","assignee":null,"assignees":[],"requested_reviewers":[{"login":"jsimons1989","id":13251956,"node_id":"MDQ6VXNlcjEzMjUxOTU2","avatar_url":"https://avatars2.githubusercontent.com/u/13251956?v=4","gravatar_id":"","url":"https://api.github.com/users/jsimons1989","html_url":"https://github.com/jsimons1989","followers_url":"https://api.github.com/users/jsimons1989/followers","following_url":"https://api.github.com/users/jsimons1989/following{/other_user}","gists_url":"https://api.github.com/users/jsimons1989/gists{/gist_id}","starred_url":"https://api.github.com/users/jsimons1989/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsimons1989/subscriptions","organizations_url":"https://api.github.com/users/jsimons1989/orgs","repos_url":"https://api.github.com/users/jsimons1989/repos","events_url":"https://api.github.com/users/jsimons1989/events{/privacy}","received_events_url":"https://api.github.com/users/jsimons1989/received_events","type":"User","site_admin":false},{"login":"Mathsh","id":29728651,"node_id":"MDQ6VXNlcjI5NzI4NjUx","avatar_url":"https://avatars1.githubusercontent.com/u/29728651?v=4","gravatar_id":"","url":"https://api.github.com/users/Mathsh","html_url":"https://github.com/Mathsh","followers_url":"https://api.github.com/users/Mathsh/followers","following_url":"https://api.github.com/users/Mathsh/following{/other_user}","gists_url":"https://api.github.com/users/Mathsh/gists{/gist_id}","starred_url":"https://api.github.com/users/Mathsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mathsh/subscriptions","organizations_url":"https://api.github.com/users/Mathsh/orgs","repos_url":"https://api.github.com/users/Mathsh/repos","events_url":"https://api.github.com/users/Mathsh/events{/privacy}","received_events_url":"https://api.github.com/users/Mathsh/received_events","type":"User","site_admin":false},{"login":"sroberts2","id":33425071,"node_id":"MDQ6VXNlcjMzNDI1MDcx","avatar_url":"https://avatars1.githubusercontent.com/u/33425071?v=4","gravatar_id":"","url":"https://api.github.com/users/sroberts2","html_url":"https://github.com/sroberts2","followers_url":"https://api.github.com/users/sroberts2/followers","following_url":"https://api.github.com/users/sroberts2/following{/other_user}","gists_url":"https://api.github.com/users/sroberts2/gists{/gist_id}","starred_url":"https://api.github.com/users/sroberts2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sroberts2/subscriptions","organizations_url":"https://api.github.com/users/sroberts2/orgs","repos_url":"https://api.github.com/users/sroberts2/repos","events_url":"https://api.github.com/users/sroberts2/events{/privacy}","received_events_url":"https://api.github.com/users/sroberts2/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":977231343,"node_id":"MDU6TGFiZWw5NzcyMzEzNDM=","url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/labels/New","name":"New","color":"FF9900","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/pulls/36/commits","review_comments_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/pulls/36/comments","review_comment_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/issues/36/comments","statuses_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/statuses/9219983ca9c8c739b1a6bbd164d62fad06d9c216","head":{"label":"companieshouse:feature/add-filing-generator","ref":"feature/add-filing-generator","sha":"9219983ca9c8c739b1a6bbd164d62fad06d9c216","user":{"login":"companieshouse","id":4947323,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5NDczMjM=","avatar_url":"https://avatars0.githubusercontent.com/u/4947323?v=4","gravatar_id":"","url":"https://api.github.com/users/companieshouse","html_url":"https://github.com/companieshouse","followers_url":"https://api.github.com/users/companieshouse/followers","following_url":"https://api.github.com/users/companieshouse/following{/other_user}","gists_url":"https://api.github.com/users/companieshouse/gists{/gist_id}","starred_url":"https://api.github.com/users/companieshouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/companieshouse/subscriptions","organizations_url":"https://api.github.com/users/companieshouse/orgs","repos_url":"https://api.github.com/users/companieshouse/repos","events_url":"https://api.github.com/users/companieshouse/events{/privacy}","received_events_url":"https://api.github.com/users/companieshouse/received_events","type":"Organization","site_admin":false},"repo":{"id":137176372,"node_id":"MDEwOlJlcG9zaXRvcnkxMzcxNzYzNzI=","name":"company-accounts.api.ch.gov.uk","full_name":"companieshouse/company-accounts.api.ch.gov.uk","owner":{"login":"companieshouse","id":4947323,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5NDczMjM=","avatar_url":"https://avatars0.githubusercontent.com/u/4947323?v=4","gravatar_id":"","url":"https://api.github.com/users/companieshouse","html_url":"https://github.com/companieshouse","followers_url":"https://api.github.com/users/companieshouse/followers","following_url":"https://api.github.com/users/companieshouse/following{/other_user}","gists_url":"https://api.github.com/users/companieshouse/gists{/gist_id}","starred_url":"https://api.github.com/users/companieshouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/companieshouse/subscriptions","organizations_url":"https://api.github.com/users/companieshouse/orgs","repos_url":"https://api.github.com/users/companieshouse/repos","events_url":"https://api.github.com/users/companieshouse/events{/privacy}","received_events_url":"https://api.github.com/users/companieshouse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/companieshouse/company-accounts.api.ch.gov.uk","description":"The Companies House API for handling company accounts","fork":false,"url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk","forks_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/forks","keys_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/teams","hooks_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/hooks","issue_events_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/issues/events{/number}","events_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/events","assignees_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/assignees{/user}","branches_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/branches{/branch}","tags_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/tags","blobs_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/git/refs{/sha}","trees_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/statuses/{sha}","languages_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/languages","stargazers_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/stargazers","contributors_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/contributors","subscribers_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/subscribers","subscription_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/subscription","commits_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/commits{/sha}","git_commits_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/git/commits{/sha}","comments_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/comments{/number}","issue_comment_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/issues/comments{/number}","contents_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/contents/{+path}","compare_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/merges","archive_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/downloads","issues_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/issues{/number}","pulls_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/pulls{/number}","milestones_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/milestones{/number}","notifications_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/labels{/name}","releases_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/releases{/id}","deployments_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/deployments","created_at":"2018-06-13T07:06:55Z","updated_at":"2018-08-15T10:47:08Z","pushed_at":"2018-08-15T14:26:17Z","git_url":"git://github.com/companieshouse/company-accounts.api.ch.gov.uk.git","ssh_url":"git@github.com:companieshouse/company-accounts.api.ch.gov.uk.git","clone_url":"https://github.com/companieshouse/company-accounts.api.ch.gov.uk.git","svn_url":"https://github.com/companieshouse/company-accounts.api.ch.gov.uk","homepage":null,"size":488,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":6,"watchers":0,"default_branch":"develop"}},"base":{"label":"companieshouse:develop","ref":"develop","sha":"13a3c903645009b7b6e268873e285eba67cb2ab7","user":{"login":"companieshouse","id":4947323,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5NDczMjM=","avatar_url":"https://avatars0.githubusercontent.com/u/4947323?v=4","gravatar_id":"","url":"https://api.github.com/users/companieshouse","html_url":"https://github.com/companieshouse","followers_url":"https://api.github.com/users/companieshouse/followers","following_url":"https://api.github.com/users/companieshouse/following{/other_user}","gists_url":"https://api.github.com/users/companieshouse/gists{/gist_id}","starred_url":"https://api.github.com/users/companieshouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/companieshouse/subscriptions","organizations_url":"https://api.github.com/users/companieshouse/orgs","repos_url":"https://api.github.com/users/companieshouse/repos","events_url":"https://api.github.com/users/companieshouse/events{/privacy}","received_events_url":"https://api.github.com/users/companieshouse/received_events","type":"Organization","site_admin":false},"repo":{"id":137176372,"node_id":"MDEwOlJlcG9zaXRvcnkxMzcxNzYzNzI=","name":"company-accounts.api.ch.gov.uk","full_name":"companieshouse/company-accounts.api.ch.gov.uk","owner":{"login":"companieshouse","id":4947323,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5NDczMjM=","avatar_url":"https://avatars0.githubusercontent.com/u/4947323?v=4","gravatar_id":"","url":"https://api.github.com/users/companieshouse","html_url":"https://github.com/companieshouse","followers_url":"https://api.github.com/users/companieshouse/followers","following_url":"https://api.github.com/users/companieshouse/following{/other_user}","gists_url":"https://api.github.com/users/companieshouse/gists{/gist_id}","starred_url":"https://api.github.com/users/companieshouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/companieshouse/subscriptions","organizations_url":"https://api.github.com/users/companieshouse/orgs","repos_url":"https://api.github.com/users/companieshouse/repos","events_url":"https://api.github.com/users/companieshouse/events{/privacy}","received_events_url":"https://api.github.com/users/companieshouse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/companieshouse/company-accounts.api.ch.gov.uk","description":"The Companies House API for handling company accounts","fork":false,"url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk","forks_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/forks","keys_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/teams","hooks_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/hooks","issue_events_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/issues/events{/number}","events_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/events","assignees_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/assignees{/user}","branches_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/branches{/branch}","tags_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/tags","blobs_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/git/refs{/sha}","trees_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/statuses/{sha}","languages_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/languages","stargazers_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/stargazers","contributors_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/contributors","subscribers_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/subscribers","subscription_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/subscription","commits_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/commits{/sha}","git_commits_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/git/commits{/sha}","comments_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/comments{/number}","issue_comment_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/issues/comments{/number}","contents_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/contents/{+path}","compare_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/merges","archive_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/downloads","issues_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/issues{/number}","pulls_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/pulls{/number}","milestones_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/milestones{/number}","notifications_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/labels{/name}","releases_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/releases{/id}","deployments_url":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/deployments","created_at":"2018-06-13T07:06:55Z","updated_at":"2018-08-15T10:47:08Z","pushed_at":"2018-08-15T14:26:17Z","git_url":"git://github.com/companieshouse/company-accounts.api.ch.gov.uk.git","ssh_url":"git@github.com:companieshouse/company-accounts.api.ch.gov.uk.git","clone_url":"https://github.com/companieshouse/company-accounts.api.ch.gov.uk.git","svn_url":"https://github.com/companieshouse/company-accounts.api.ch.gov.uk","homepage":null,"size":488,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":6,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/pulls/36"},"html":{"href":"https://github.com/companieshouse/company-accounts.api.ch.gov.uk/pull/36"},"issue":{"href":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/issues/36"},"comments":{"href":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/issues/36/comments"},"review_comments":{"href":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/pulls/36/comments"},"review_comment":{"href":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/pulls/36/commits"},"statuses":{"href":"https://api.github.com/repos/companieshouse/company-accounts.api.ch.gov.uk/statuses/9219983ca9c8c739b1a6bbd164d62fad06d9c216"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ch-mcabrera"}}