Beispiel #1
0
        public async Task <QueryResult <string> > Handle(CampaignIdByNameQuery request,
                                                         CancellationToken cancellationToken)
        {
            var id = await _campaignAccessor.GetIdByName(request.CampaignName);

            return(string.IsNullOrEmpty(id) ? GetNotFoundResult() : GetSuccessResult(id));
        }
Beispiel #2
0
        public async Task <QueryResult <TotalsPerCampaign> > Handle(TotalSpentAmountPerCampaignQuery request,
                                                                    CancellationToken cancellationToken)
        {
            var campaignId = await _campaignReadAccessor.GetIdByName(request.CampaignName);

            var result = await _receiptReadAccessor.GetTotals(campaignId, request.UserId);

            return(QueryResult <TotalsPerCampaign> .GetSuccessResult(result));
        }
Beispiel #3
0
        public async Task <QueryResult <PageResult <BasicReceipt> > > Handle(
            BasicReceiptsQuery request,
            CancellationToken cancellationToken)
        {
            var campaignId = await _campaignReadAccessor
                             .GetIdByName(request.CampaignName);

            var result = await _receiptReadAccessor
                         .GetBasicReceipts(campaignId, request.Page, request.PageSize, request.UserId);

            return(GetSuccessResult(result));
        }