public Sprint ScheduleSprint(SprintId newSprintId, string name, string goals, DateTime begins, DateTime ends) { Sprint sprint = new Sprint(this.TenantId, this.ProductId, newSprintId, name, goals, begins, ends); DomainEventPublisher.Instance.Publish(new ProductSprintScheduled(sprint.TenantId, sprint.ProductId, sprint.SprintId, sprint.Name, sprint.Goals, sprint.Begins, sprint.Ends)); return sprint; }
public void CommitTo(Sprint sprint) { AssertionConcern.NotNull(sprint, "Sprint must not be null."); AssertionConcern.Equals(sprint.TenantId, this.TenantId, "Sprint must be of same tenant."); AssertionConcern.Equals(sprint.ProductId, this.ProductId, "Sprint must be of same product."); if(!this.IsScheduledForRelease) { throw new InvalidOperationException("Must be scheduled for release to commit to sprint."); } if(this.IsCommittedToSprint) { if(!sprint.SprintId.Equals(this.SprintId)) { UncommittFromSprint(); } } if(this.Status==BacklogItemStatus.Scheduled) { this.Status = BacklogItemStatus.Committed; } this.SprintId = sprint.SprintId; DomainEventPublisher.Instance.Publish(new BacklogItemCommitted(this.TenantId, this.BacklogItemId, sprint.SprintId)); }