public async Task <OrganisationVerificationStatus> GetOrganisationVerificationStatus(Guid applicationId) { var verifiedCompaniesHouse = await _qnaApiClient.GetAnswer(applicationId, RoatpWorkflowSequenceIds.Preamble, RoatpWorkflowSectionIds.Preamble, RoatpWorkflowPageIds.Preamble, RoatpPreambleQuestionIdConstants.UkrlpVerificationCompany); var companiesHouseManualEntry = await _qnaApiClient.GetAnswer(applicationId, RoatpWorkflowSequenceIds.Preamble, RoatpWorkflowSectionIds.Preamble, RoatpWorkflowPageIds.Preamble, RoatpPreambleQuestionIdConstants.CompaniesHouseManualEntryRequired); var verifiedCharityCommission = await _qnaApiClient.GetAnswer(applicationId, RoatpWorkflowSequenceIds.Preamble, RoatpWorkflowSectionIds.Preamble, RoatpWorkflowPageIds.Preamble, RoatpPreambleQuestionIdConstants.UkrlpVerificationCharity); var charityCommissionManualEntry = await _qnaApiClient.GetAnswer(applicationId, RoatpWorkflowSequenceIds.Preamble, RoatpWorkflowSectionIds.Preamble, RoatpWorkflowPageIds.Preamble, RoatpPreambleQuestionIdConstants.CharityCommissionTrusteeManualEntry); var companiesHouseDataConfirmed = await _qnaApiClient.GetAnswer(applicationId, RoatpWorkflowSequenceIds.YourOrganisation, RoatpWorkflowSectionIds.YourOrganisation.WhosInControl, RoatpWorkflowPageIds.WhosInControl.CompaniesHouseStartPage, RoatpYourOrganisationQuestionIdConstants.CompaniesHouseDetailsConfirmed); var charityCommissionDataConfirmed = await _qnaApiClient.GetAnswer(applicationId, RoatpWorkflowSequenceIds.YourOrganisation, RoatpWorkflowSectionIds.YourOrganisation.WhosInControl, RoatpWorkflowPageIds.WhosInControl.CharityCommissionStartPage, RoatpYourOrganisationQuestionIdConstants.CharityCommissionDetailsConfirmed); var organisationType = await _qnaApiClient.GetAnswer(applicationId, RoatpWorkflowSequenceIds.YourOrganisation, RoatpWorkflowSectionIds.YourOrganisation.WhosInControl, RoatpWorkflowPageIds.WhosInControl.SoleTraderPartnership, RoatpYourOrganisationQuestionIdConstants.SoleTradeOrPartnership); var whosInControlStarted = organisationType != null && (organisationType.Value == RoatpOrganisationTypes.SoleTrader || organisationType.Value == RoatpOrganisationTypes.Partnership); var whosInControlConfirmed = false; if (organisationType != null && organisationType.Value == RoatpOrganisationTypes.SoleTrader) { var soleTraderDateOfBirthAnswer = await _qnaApiClient.GetAnswer(applicationId, RoatpWorkflowSequenceIds.YourOrganisation, RoatpWorkflowSectionIds.YourOrganisation.WhosInControl, RoatpWorkflowPageIds.WhosInControl.AddSoleTraderDob, RoatpYourOrganisationQuestionIdConstants.AddSoleTradeDob); if (soleTraderDateOfBirthAnswer != null && !String.IsNullOrEmpty(soleTraderDateOfBirthAnswer.Value)) { whosInControlConfirmed = true; } } else if (organisationType != null && organisationType.Value == RoatpOrganisationTypes.Partnership) { var partnersDetailsAnswer = await _qnaApiClient.GetAnswer(applicationId, RoatpWorkflowSequenceIds.YourOrganisation, RoatpWorkflowSectionIds.YourOrganisation.WhosInControl, RoatpWorkflowPageIds.WhosInControl.AddPartners, RoatpYourOrganisationQuestionIdConstants.AddPartners); if (partnersDetailsAnswer != null && !String.IsNullOrEmpty(partnersDetailsAnswer.Value)) { whosInControlConfirmed = true; } } var pscsDetailsAnswer = await _qnaApiClient.GetAnswer(applicationId, RoatpWorkflowSequenceIds.YourOrganisation, RoatpWorkflowSectionIds.YourOrganisation.WhosInControl, RoatpWorkflowPageIds.WhosInControl.AddPeopleInControl, RoatpYourOrganisationQuestionIdConstants.AddPeopleInControl); if (pscsDetailsAnswer != null && !String.IsNullOrEmpty(pscsDetailsAnswer.Value)) { whosInControlConfirmed = true; } var status = new OrganisationVerificationStatus { VerifiedCompaniesHouse = (verifiedCompaniesHouse != null && verifiedCompaniesHouse.Value == "TRUE"), VerifiedCharityCommission = (verifiedCharityCommission != null && verifiedCharityCommission.Value == "TRUE"), CompaniesHouseManualEntry = (companiesHouseManualEntry != null && companiesHouseManualEntry.Value == "TRUE"), CharityCommissionManualEntry = (charityCommissionManualEntry != null && charityCommissionManualEntry.Value == "TRUE"), CompaniesHouseDataConfirmed = (companiesHouseDataConfirmed != null && companiesHouseDataConfirmed.Value == "Y"), CharityCommissionDataConfirmed = (charityCommissionDataConfirmed != null && charityCommissionDataConfirmed.Value == "Y"), WhosInControlConfirmed = whosInControlConfirmed, WhosInControlStarted = whosInControlStarted }; return(status); }