Пример #1
0
        public async Task <Model.ChildBug> GenerateChildBug(IAddBugTo command)
        {
            await authorizationService.CheckUserMembership(callContext.UserId, command.ProjectId);

            var issue = new Model.ChildBug(
                id: Guid.NewGuid(),
                projectId: command.ProjectId,
                title: command.Title,
                description: command.Description,
                status: IssueStatus.Todo,
                reporterId: callContext.UserId,
                assigneeId: null,
                createdAt: DateTime.UtcNow,
                updatedAt: DateTime.UtcNow
                );

            if (command.LabelsIds != null)
            {
                var labels = await labelsSearcher.GetLabels(command.ProjectId);

                issue.AssignLabels(command.LabelsIds, labels);
            }

            if (command.AssigneeId != null)
            {
                var assignee = await userRepository.GetAsync(command.AssigneeId.Value);

                await issue.AssignAssignee(assignee, authorizationService);
            }

            command.CreatedId = issue.Id;
            return(issue);
        }
Пример #2
0
        public async Task HandleAsync(AssignLabelsToTask command)
        {
            var task = await taskRepository.GetAsync(command.IssueId);

            var labels = await labelsSearcher.GetLabels(task.ProjectId, command.LabelsIds);

            task.AssignLabels(command.LabelsIds, labels);
            await taskRepository.Update(task, task.Version);
        }
Пример #3
0
        public async Task HandleAsync(AssignLabelsToNfr command)
        {
            var issue = await nfrRepository.GetAsync(command.IssueId);

            var labels = await labelsSearcher.GetLabels(issue.ProjectId, command.LabelsIds);

            issue.AssignLabels(command.LabelsIds, labels);
            await nfrRepository.Update(issue, issue.Version);
        }
Пример #4
0
        public async Task HandleAsync(AssignLabelsToBug command)
        {
            var Bug = await bugRepository.GetAsync(command.IssueId);

            var labels = await labelsSearcher.GetLabels(Bug.ProjectId, command.LabelsIds);

            Bug.AssignLabels(command.LabelsIds, labels);
            await bugRepository.Update(Bug, Bug.Version);
        }