kevbite / CompaniesHouse.NET

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

Question about Getting The Company Details From SearchOfficerAsync #100

Closed JulianGuppy closed 5 years ago

JulianGuppy commented 5 years ago

I am using the API call SearchOfficerAsync to search for a person (I am then going through the results and using the date of birth I already have in my database to select the right individual Officer)

I get a Link (offier.Links.Self) which if followed takes me to the directorships for that person. Does your API expose the ability for me to in effect say Get me the companies for this person....

Is this possible?

JulianGuppy commented 5 years ago

I just saw this on the pull request "added ability to get all appointments for an officer"..... I really want this feature. please let me know when this is ready/available.

kevbite commented 5 years ago

I think what you want is in the latest version, if you check out this integration test it might be exactly what you require OfficersTestsValid

Does that work for your scenario? I don't think we've documented functionality is documented yet.

JulianGuppy commented 5 years ago

I think I asked for the feature that has just been done, when will that be in the nuget? Id rather use the nuget than have to pull the code and build it... :) is that possible

kevbite commented 5 years ago

It will be in the latest package, master auto builds and publishes to nuget. It's just we don't seem to have that functionality in the read me yet.

JulianGuppy commented 5 years ago

I am on 6.1.5, and I dont have that method in my companieshouseClient.... something screwy with nuget perhaps?

kevbite commented 5 years ago

OK, I'll take a look today and see what's what. Not sure what's wrong.

kevbite commented 5 years ago

Right, I see what it is... your scenario is a little different from the one in the PR. I've altered the code and pushed a new package that will allow you to get an Officer Id from a search.

I've also added a test scenario with an example here - https://github.com/kevbite/CompaniesHouse.NET/blob/master/src/CompaniesHouse.ScenarioTests/SearchForAnOfficerAndFetchCorrespondingCompanyScenarioTests.cs#L22

Try that and see if that works for your case too. 😄

JulianGuppy commented 5 years ago

ok I updated to 6.1.6 However, I do not have the method GetAppointmentsAsync in my client, something is still wrong? my visual studio will not see that method - i cant work out why not, I can open the DLL with ildasm and I can see the method, I check my packages.config and its pointing at 6.1.6, howevr in visual studio it refuses to believe that there is such a method cantseemethod butitsthere

JulianGuppy commented 5 years ago

Is it missing from the Interface ICompaniesHouseClient? I wonder

JulianGuppy commented 5 years ago

Right I am almost certain that its because its not in the Interface (and I an using dependency injection so my code is accepting the interface) hence why my code cant see it :)

"public interface ICompaniesHouseClient : ICompaniesHouseSearchCompanyClient, ICompaniesHouseSearchOfficerClient, ICompaniesHouseSearchDisqualifiedOfficerClient, ICompaniesHouseSearchAllClient, ICompaniesHouseCompanyProfileClient, ICompaniesHouseCompanyFilingHistoryClient, ICompaniesHouseOfficersClient, ICompaniesHouseCompanyInsolvencyInformationClient { }"

kevbite commented 5 years ago

@JulianGuppy you're totally correct.

Just looked and it's not exposed on the ICompaniesHouseClient facade, total oversight on that one, sorry about that. In theory, all our tests should use the interface as that's what we expect people will be using.

I've updated the code in #102 which will enable this now and will be released in 6.1.7.

JulianGuppy commented 5 years ago

Thank you, You have helped me out as I needed to make this work asap,,, I was about to go off and do all the low level stuff (which I wanted to avoid) Much Appreciated

kevbite commented 5 years ago

Well if you need any other help just create another issue 👍