public InjectionTestCase(bool isEpaoSource, bool isEpaoApproved,
                                     string organisationName, bool isOrganisationNameTaken, string tradingName, string organisationType,
                                     int?ukprn, bool isUkprnTaken, string companyNumber, bool isCompanyNumberTaken, string charityNumber,
                                     bool isCharityNumberTaken, string organisationId, string email, string contactGivenNames, string contactFamilyName,
                                     bool isEmailTaken, string warningMessage1)
            {
                var warningMessages = new List <string>();

                if (!string.IsNullOrEmpty(warningMessage1))
                {
                    warningMessages.Add(warningMessage1);
                }

                IsOrganisationNameTaken = isOrganisationNameTaken;
                IsUkprnTaken            = isUkprnTaken;
                IsCompanyNumberTaken    = isCompanyNumberTaken;
                IsCharityNumberTaken    = isCharityNumberTaken;
                IsEmailTaken            = isEmailTaken;

                var response = new CreateOrganisationAndContactFromApplyResponse
                {
                    IsEpaoApproved  = isEpaoApproved,
                    WarningMessages = warningMessages,
                    OrganisationId  = organisationId,
                    ContactId       = Guid.Empty
                };

                Command = new CreateOrganisationContactCommand
                {
                    EndPointAssessorOrganisationId = organisationId,
                    IsRoEpaoApproved          = isEpaoApproved,
                    OrganisationName          = organisationName,
                    TradingName               = tradingName,
                    UseTradingName            = true,
                    OrganisationUkprn         = ukprn,
                    CompanyUkprn              = "87654321",
                    CompanyNumber             = companyNumber,
                    CharityNumber             = charityNumber,
                    OrganisationType          = organisationType,
                    ContactEmail              = email,
                    ContactGivenNames         = contactGivenNames,
                    ContactFamilyName         = contactFamilyName,
                    ApplyingContactFamilyName = "",
                    ApplyingContactGivenNames = "",
                    ContactPhoneNumber        = "11111111",
                    FinancialDueDate          = DateTime.MaxValue,
                    IsFinancialExempt         = false
                };
                ExpectedResponse = response;
            }
        InjectApplyOrganisationAndContactDetailsIntoRegister(CreateOrganisationContactCommand command)
        {
            var response = new CreateOrganisationAndContactFromApplyResponse {
                IsEpaoApproved = false, WarningMessages = new List <string>()
            };

            if (command.IsRoEpaoApproved is true)
            {
                await UpdateFinancialDetails(command);

                _logger.LogInformation("Source is RoEPAO approved. No need to inject organisation details into register");
                response.IsEpaoApproved = true;
                return(response);
            }

            var warningMessages    = new List <string>();
            var organisationName   = DecideOrganisationName(command.UseTradingName, command.TradingName, command.OrganisationName);
            var ukprn              = GetUkprnFromRequestDetails(command.OrganisationUkprn, command.CompanyUkprn);
            var organisationTypeId = await GetOrganisationTypeIdFromDescriptor(command.OrganisationType);

            // Organisation checks
            RaiseWarningIfNoEpaoId(command.EndPointAssessorOrganisationId, warningMessages);
            RaiseWarningIfEpaoIdIsInvalid(command.EndPointAssessorOrganisationId, warningMessages);
            RaiseWarningIfNoOrganisationName(organisationName, warningMessages);
            RaiseWarningIfOrganisationNameTooShort(organisationName, warningMessages);
            RaiseWarningOrganisationTypeNotIdentified(organisationTypeId, warningMessages);
            RaiseWarningIfUkprnIsInvalid(ukprn, warningMessages);
            RaiseWarningIfCompanyNumberIsInvalid(command.CompanyNumber, warningMessages);
            RaiseWarningIfCharityNumberIsInvalid(command.CharityNumber, warningMessages);

            // Contact checks
            RaiseWarningIfEmailIsMissingOrInvalid(command.ContactEmail, warningMessages);
            RaiseWarningIfContactGivenNameIsMissingOrTooShort(command.ContactGivenNames, warningMessages);
            RaiseWarningIfContactFamilyNameIsMissingOrTooShort(command.ContactFamilyName, warningMessages);

            var request = MapCommandToOrganisationRequest(command, organisationName, ukprn, organisationTypeId);

            // If we passed basic pre-checks; then validate fully
            if (warningMessages.Count == 0)
            {
                var validationResponse = await _assessorValidationService.ValidateUpdateOrganisationRequest(request);

                if (!validationResponse.IsValid)
                {
                    var validationResponseErrors = validationResponse.Errors.Select(err => err.ErrorMessage);
                    warningMessages.AddRange(validationResponseErrors);
                    _logger.LogInformation($"Inject organisation failed on Validation Service. OrganisationId: {command.OrganisationId} - Warnings:  {string.Join(",", validationResponseErrors)}");
                }
            }
            else
            {
                _logger.LogInformation($"Inject organisation failed at pre-check. OrganisationId: {command.OrganisationId} - Warnings:  {string.Join(",", warningMessages)}");
            }

            // If everything has checked out; approve the application
            if (warningMessages.Count == 0)
            {
                _logger.LogInformation($"Approving organisation {request?.Name} onto the register");
                request.Status = OrganisationStatus.New;

                var organisationId = await _apiClient.UpdateEpaOrganisation(request);

                response.OrganisationId = organisationId;

                _logger.LogInformation($"Assigning the primary contact");
                var primaryContact = MapCommandToContactRequest(command.ContactEmail, organisationId, command.ContactPhoneNumber, command.ContactGivenNames, command.ContactFamilyName);
                await AssignPrimaryContactToOrganisation(primaryContact, organisationId);

                _logger.LogInformation($"Assign the applying user default permissions");
                await AssignApplyingContactToOrganisation(command.ApplyingContactEmail, organisationId);

                _logger.LogInformation($"Inviting other applying users");
                await InviteOtherApplyingUsersToOrganisation(command.OtherApplyingUserEmails, organisationId);
            }
            else
            {
                _logger.LogWarning($"Cannot inject organisation details into register at this time. OrganisationId: {command.OrganisationId} - Warnings:  {string.Join(",", warningMessages)}");
            }

            response.WarningMessages = warningMessages;

            return(response);
        }