Beispiel #1
0
        public async Task <GetShowcaseQueryResult> Handle(GetShowcaseQuery request, CancellationToken cancellationToken)
        {
            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }
            RetrospectiveStatus retrospective =
                await this._mediator.Send(new GetRetrospectiveStatusQuery(request.RetroId), cancellationToken);

            RetrospectiveVoteStatus voteStatus = (await this._mediator.Send(new GetVotesQuery(request.RetroId), cancellationToken)).VoteStatus;

            var showcaseData = new ShowcaseData();

            foreach (RetrospectiveLane retrospectiveLane in retrospective.Lanes)
            {
                RetrospectiveLaneContent laneContents =
                    await this._mediator.Send(
                        new GetRetrospectiveLaneContentQuery(request.RetroId, retrospectiveLane.Id), cancellationToken);

                foreach (RetrospectiveNote note in laneContents.Notes)
                {
                    showcaseData.Items.Add(new ShowcaseItem(note, retrospectiveLane, voteStatus));
                }

                foreach (RetrospectiveNoteGroup noteGroup in laneContents.Groups)
                {
                    showcaseData.Items.Add(new ShowcaseItem(noteGroup, retrospectiveLane, voteStatus));
                }
            }

            showcaseData.Sort();

            return(new GetShowcaseQueryResult(showcaseData));
        }
        public async Task DispatchUpdate(Retrospective retrospective, CancellationToken cancellationToken)
        {
            RetrospectiveStatus retrospectiveStatus = await this._retrospectiveStatusMapper.GetRetrospectiveStatus(retrospective, cancellationToken);

            await this._mediator.Publish(new RetrospectiveStatusUpdatedNotification(retrospectiveStatus), cancellationToken);
        }
 public RetrospectiveStatusUpdatedNotification(RetrospectiveStatus retrospectiveStatus)
 {
     this.RetrospectiveStatus = retrospectiveStatus;
 }