Exemplo n.º 1
0
        public Team(TenantId tenantId, string name, ProductOwner productOwner)
            : this(tenantId, name)
        {
            AssertionConcern.NotNull(productOwner, "The productOwner must be provided.");
            AssertionConcern.Equals(tenantId, productOwner.TenantId, "The productOwner must be of the same tenant.");

            this.ProductOwner = productOwner;
        }
Exemplo n.º 2
0
        public void ChangeProductOwner(ProductOwner productOwner)
        {
            if(!this.ProductOwnerId.Equals(productOwner.ProductOwnerId)) {
                this.ProductOwnerId = productOwner.ProductOwnerId;

                // TODO: publish event
            }
        }
        public void EnableProductOwner(EnableProductOwnerCommand command)
        {
            TenantId tenantId = new TenantId(command.TenantId);
            ApplicationServiceLifeCycle.Begin();
            try {
                ProductOwner productOwner = this._productOwnerRepository.Get(tenantId, command.UserName);
                if (productOwner != null) {
                    productOwner.Enable(command.OccurredOn);
                }
                else {
                    productOwner = new ProductOwner(tenantId, command.UserName, command.FirstName, command.LastName,
                        command.EmailAdddress, command.OccurredOn);

                    this._productOwnerRepository.Save(productOwner);
                }
                ApplicationServiceLifeCycle.Success();
            }
            catch (Exception ex) {
                ApplicationServiceLifeCycle.Fail(ex);
            }
        }
Exemplo n.º 4
0
 public void AssignProductOwner(ProductOwner productOwner)
 {
     this.ProductOwner = productOwner;
 }