public async Task HandleAsync_GivenOrganisationId_SchemeShouldBeRetrieved()
        {
            var request = new GetSchemeByOrganisationId(Guid.NewGuid());

            var result = await handler.HandleAsync(request);

            A.CallTo(() => dataAccess.GetSchemeOrDefaultByOrganisationId(request.OrganisationId)).MustHaveHappened(Repeated.Exactly.Once);
        }
        public async Task <SchemeData> HandleAsync(GetSchemeByOrganisationId request)
        {
            authorization.EnsureInternalOrOrganisationAccess(request.OrganisationId);

            var scheme = await dataAccess.GetSchemeOrDefaultByOrganisationId(request.OrganisationId);

            if (scheme == null)
            {
                return(null);
            }

            var schemeData = mapper.Map <Scheme, SchemeData>(scheme);

            return(schemeData);
        }