kevbite / CompaniesHouse.NET

A simple .NET client wrapper for CompaniesHouse API
MIT License
37 stars 44 forks source link

Add companyProfile search links functionality #127

Closed mattu08 closed 4 years ago

mattu08 commented 4 years ago

I have been working with the company profile search and have noticed the below is missing from the project. Would be great to get this added.

https://developer.companieshouse.gov.uk/api/docs/company/company_number/companyProfile-resource.html

The below is from the above API reference:

"links" : { "charges" : "string", "filing_history" : "string", "insolvency" : "string", "officers" : "string", "persons_with_significant_control" : "string", "persons_with_significant_control_statements" : "string", "registers" : "string", "self" : "string" }

I have created a base class below that could be used to add the above links functionality, if this helps.

public class Links
{
    [JsonProperty("charges")]
    public string Charges { get; set; }

    [JsonProperty("filing_history")]
    public string FilingHistory { get; set; }

    [JsonProperty("insolvency")]
    public string Insolvency { get; set; }

    [JsonProperty("officers")]
    public string Officers { get; set; }

    [JsonProperty("persons_with_significant_control")]
    public string PersonsWithSignificantControl { get; set; }

    [JsonProperty("persons_with_significant_control_statements")]
    public string PersonsWithSignificantControlStatements { get; set; }

    [JsonProperty("registers")]
    public string Registers { get; set; }

    [JsonProperty("self")]
    public string Self { get; set; }
}

Thanks πŸ‘

mattu08 commented 4 years ago

Also to add to the above some of the Fields are not exposed from the API e.g. dynamic Fields like "insolvency" : "string", "registers" : "string", "persons_with_significant_control_statements" : "string" etc. Only if certain parameters are met, for example if a company is in insolvency etc.

kevbite commented 4 years ago

Makes total sense, doesn't actually say the rules on the api docs though so I feel like it should just return an object with them all for the time being.

A lot of properties have been added to the API since this project first started so some gaps still need filling in, however, I'll try sort added these in ASAP. πŸ‘

mattu08 commented 4 years ago

I noticed that too, that there seems to be no reference to API rules within the documentation, which is slightly annoying. But I guess pushing a few API requests here and there it can be worked out. Just adds to the Development time… And no problem, I can imagine it’s a bit of a cat and mouse game trying to keep up with the new API references/exposed fields. Thanks for looking into this. πŸ‘

kevbite commented 4 years ago

I've added the links on to CompanyProfile, they're nothing fancy just strings at moment.

These are in the latest version 7.7.0

mattu08 commented 4 years ago

Just tested with 7.7.0. Strings are great thanks, thanks for adding them in. πŸ‘

mattu08 commented 4 years ago

I'll close the issue, thanks for your help πŸ‘