コード例 #1
0
 public TaskVolunteerAssigned(Tenants.TenantId tenantId, BacklogItemId backlogItemId, TaskId taskId, string volunteerMemberId)
 {
     this.TenantId = tenantId;
     this.BacklogItemId = backlogItemId;
     this.TaskId = taskId;
     this.VolunteerMemberId = volunteerMemberId;
 }
コード例 #2
0
 public TaskDescribed(Tenants.TenantId tenantId, BacklogItemId backlogItemId, TaskId taskId, string description)
 {
     this.TenantId = tenantId;
     this.BacklogItemId = backlogItemId;
     this.TaskId = taskId;
     this.Description = description;
 }
コード例 #3
0
 public TaskStatusChanged(Tenants.TenantId tenantId, BacklogItemId backlogItemId, TaskId taskId, TaskStatus status)
 {
     this.TenantId = tenantId;
     this.BacklogItemId = backlogItemId;
     this.TaskId = taskId;
     this.Status = status;
 }
コード例 #4
0
 public TaskHoursRemainingEstimated(Tenants.TenantId tenantId, BacklogItemId backlogItemId, TaskId taskId, int hoursRemaining)
 {
     this.TenantId = tenantId;
     this.BacklogItemId = backlogItemId;
     this.TaskId = taskId;
     this.HoursRemaining = hoursRemaining;
 }
コード例 #5
0
 public TaskRenamed(Tenants.TenantId tenantId, BacklogItemId backlogItemId, TaskId taskId, string name)
 {
     this.TenantId = tenantId;
     this.BacklogItemId = backlogItemId;
     this.TaskId = taskId;
     this.Name = name;
 }
コード例 #6
0
        public EstimationLogEntry(Tenants.TenantId tenantId, TaskId taskId, DateTime date, int hoursRemaining)
        {
            AssertionConcern.AssertArgumentNotNull(tenantId, "The tenant id must be provided.");
            AssertionConcern.AssertArgumentNotNull(taskId, "The task id must be provided.");

            this.TenantId = tenantId;
            this.TaskId = taskId;
            this.Date = date.Date;
            this.HoursRemaining = hoursRemaining;
        }
コード例 #7
0
        public TaskDefined(Tenants.TenantId tenantId, BacklogItemId backlogItemId, TaskId taskId, string volunteerMemberId, string name, string description)
        {
            this.TenantId = tenantId;
            this.EventVersion = 1;
            this.OccurredOn = DateTime.UtcNow;
            this.BacklogItemId = backlogItemId;

            this.TaskId = taskId;
            this.VolunteerMemberId = volunteerMemberId;
            this.Name = name;
            this.Description = description;
        }
コード例 #8
0
ファイル: Task.cs プロジェクト: asr0/IDDD_Samples_NET
 public Task(
     TenantId tenantId, 
     BacklogItemId backlogItemId, 
     TaskId taskId, 
     TeamMember teamMember, 
     string name, 
     string description, 
     int hoursRemaining, 
     TaskStatus status)
 {
     this.TenantId = tenantId;
     this.BacklogItemId = backlogItemId;
     this.TaskId = taskId;
     this.Volunteer = teamMember.TeamMemberId;
     this.Name = name;
     this.Description = description;
     this.HoursRemaining = hoursRemaining;
     this.Status = status;
     this.estimationLog = new List<EstimationLogEntry>();
 }
コード例 #9
0
        public void RemoveTask(TaskId taskId)
        {
            var task = LoadTask(taskId);

            if (!this.tasks.Remove(task))
                throw new InvalidOperationException("Task was not removed.");

            DomainEventPublisher.Instance.Publish(
                new TaskRemoved(this.TenantId, this.BacklogItemId));
        }
コード例 #10
0
 public Task GetTask(TaskId taskId)
 {
     return this.tasks.FirstOrDefault(x => x.TaskId.Equals(taskId));
 }
コード例 #11
0
        public void EstimateTaskHoursRemaining(TaskId taskId, int hoursRemaining)
        {
            var task = LoadTask(taskId);
            task.EstimateHoursRemaining(hoursRemaining);

            var changedStatus = default(BacklogItemStatus?);

            if (hoursRemaining == 0)
            {
                if (!this.AnyTaskHoursRemaining)
                {
                    changedStatus = BacklogItemStatus.Done;
                }
            }
            else if (this.IsDone)
            {
                if (this.IsCommittedToSprint)
                {
                    changedStatus = BacklogItemStatus.Committed;
                }
                else if (this.IsScheduledForRelease)
                {
                    changedStatus = BacklogItemStatus.Scheduled;
                }
                else
                {
                    changedStatus = BacklogItemStatus.Planned;
                }
            }

            if (changedStatus != null)
            {
                this.Status = changedStatus.Value;
                DomainEventPublisher.Instance.Publish(
                    new BacklogItemStatusChanged(this.TenantId, this.BacklogItemId, changedStatus.Value));
            }
        }
コード例 #12
0
 public void DescribeTask(TaskId taskId, string description)
 {
     var task = LoadTask(taskId);
     task.DescribeAs(description);
 }
コード例 #13
0
 public void ChangeTaskStatus(TaskId taskId, TaskStatus status)
 {
     var task = LoadTask(taskId);
     task.ChangeStatus(status);
 }
コード例 #14
0
 public void AssignTaskVolunteer(TaskId taskId, TeamMember volunteer)
 {
     var task = LoadTask(taskId);
     task.AssignVolunteer(volunteer);
 }
コード例 #15
0
 public Task GetTask(TaskId taskId)
 {
     return(this.tasks.FirstOrDefault(x => x.TaskId.Equals(taskId)));
 }
コード例 #16
0
        public void AssignTaskVolunteer(TaskId taskId, TeamMember volunteer)
        {
            var task = LoadTask(taskId);

            task.AssignVolunteer(volunteer);
        }
コード例 #17
0
        public void ChangeTaskStatus(TaskId taskId, TaskStatus status)
        {
            var task = LoadTask(taskId);

            task.ChangeStatus(status);
        }
コード例 #18
0
 public TaskVolunteerAssigned(Tenants.TenantId tenantId, BacklogItemId backlogItemId, TaskId taskId, string volunteerMemberId)
 {
     this.TenantId = tenantId;
     this.BacklogItemId = backlogItemId;
     this.TaskId = taskId;
     this.VolunteerMemberId = volunteerMemberId;
 }
コード例 #19
0
 public void RenameTask(TaskId taskId, string name)
 {
     var task = LoadTask(taskId);
     task.Rename(name);
 }
コード例 #20
0
        public void DescribeTask(TaskId taskId, string description)
        {
            var task = LoadTask(taskId);

            task.DescribeAs(description);
        }
コード例 #21
0
        public void RenameTask(TaskId taskId, string name)
        {
            var task = LoadTask(taskId);

            task.Rename(name);
        }
コード例 #22
0
 public TaskStatusChanged(Tenants.TenantId tenantId, BacklogItemId backlogItemId, TaskId taskId, TaskStatus status)
 {
     this.TenantId      = tenantId;
     this.BacklogItemId = backlogItemId;
     this.TaskId        = taskId;
     this.Status        = status;
 }
コード例 #23
0
 Task LoadTask(TaskId taskId)
 {
     var task = GetTask(taskId);
     if (task == null)
         throw new InvalidOperationException("Task does not exist.");
     return task;
 }
コード例 #24
0
 public TaskHoursRemainingEstimated(Tenants.TenantId tenantId, BacklogItemId backlogItemId, TaskId taskId, int hoursRemaining)
 {
     this.TenantId       = tenantId;
     this.BacklogItemId  = backlogItemId;
     this.TaskId         = taskId;
     this.HoursRemaining = hoursRemaining;
 }