Beispiel #1
0
            public async Task <Response> Handle(Reuqest request, CancellationToken cancellationToken)
            {
                var leads = await _leadService.GetAsync(request.Status);

                return(new Response()
                {
                    leads = leads
                });
            }
Beispiel #2
0
            public async Task <Unit> Handle(Reuqest request, CancellationToken cancellationToken)
            {
                var lead = await _leadService.GetAsync(request.Id);

                if (lead == null)
                {
                    throw new Exception($"Lead ({request.Id}) is not found");
                }

                lead = lead.SwitchStatus(LeadStatus.Accepted);
                await _leadService.UpdateAsync(lead);

                return(new Unit());
            }