public async Task <ReferralsListResponseModel> GetAllReferralsAsync([FromQuery] ReferralPaginationRequestModel model)
        {
            var statuses = new List <MAVN.Service.Referral.Client.Enums.CommonReferralStatus>();

            switch (model.Status)
            {
            case CommonReferralStatus.Ongoing:
                statuses.Add(MAVN.Service.Referral.Client.Enums.CommonReferralStatus.Pending);
                statuses.Add(MAVN.Service.Referral.Client.Enums.CommonReferralStatus.Confirmed);
                break;

            case CommonReferralStatus.Accepted:
                statuses.Add(MAVN.Service.Referral.Client.Enums.CommonReferralStatus.Accepted);
                break;

            case CommonReferralStatus.Expired:
                statuses.Add(MAVN.Service.Referral.Client.Enums.CommonReferralStatus.Expired);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            var result = await _referralClient.CommonReferralApi.GetReferralsByCustomerIdAsync(
                new CommonReferralByCustomerIdRequest()
            {
                CustomerId = Guid.Parse(_requestContext.UserId),
                Statuses   = statuses,
                CampaignId = model.EarnRuleId
            });

            switch (result.ErrorCode)
            {
            case ReferralErrorCodes.None:
                var paged = result.Referrals
                            .Skip((model.CurrentPage - 1) * model.PageSize)
                            .Take(model.PageSize);

                var mapped = _mapper.Map <IEnumerable <Core.Domain.CommonReferral.CommonReferralModel> >(paged);

                var pagedResult = await _referralService
                                  .PrepareReferralCommonData(mapped, _requestContext.UserId, model.EarnRuleId);

                return(new ReferralsListResponseModel()
                {
                    TotalCount = result.Referrals.Count,
                    CurrentPage = model.CurrentPage,
                    PageSize = model.PageSize,
                    Referrals = _mapper.Map <List <CustomerCommonReferralResponseModel> >(pagedResult)
                });

            case ReferralErrorCodes.ReferralNotFound:
                throw LykkeApiErrorException.BadRequest(ApiErrorCodes.Service.ReferralNotFound);

            case ReferralErrorCodes.GuidCanNotBeParsed:
                throw LykkeApiErrorException.BadRequest(ApiErrorCodes.Service.InvalidCustomerId);

            default:
                throw new InvalidOperationException("An unexpected error has occured");
            }
        }