Beispiel #1
0
        // Confirm  Distributor User Email
        public void ConfirmDistributorUserEmail(string distributorUserId)
        {
            var distributorUserToConfirmEmail = DistributorUsers.FirstOrDefault(x => x.Id.ToString() == distributorUserId);

            if (distributorUserToConfirmEmail == null)
            {
                throw new DistributorUserNotFoundException(distributorUserId);
            }


            distributorUserToConfirmEmail.ConfirmEmail();

            // rais product updated event
            AddDomainEvent(new DistributorUserEmailConfirmed(distributorUserToConfirmEmail));
        }
Beispiel #2
0
        // Remove Distributor User from distributor
        public void DeleteDistributorUser(string distributorUserId)
        {
            var distributorUser = DistributorUsers.FirstOrDefault(x => x.Id.ToString() == distributorUserId);

            if (distributorUser == null)
            {
                throw new DistributorUserNotFoundException(distributorUserId);
            }


            DistributorUsers.Remove(distributorUser);

            // rais Distributor updated event
            AddDomainEvent(new DistributorUserDeleted(distributorUser));
        }
Beispiel #3
0
        // update  Distributor User
        public void UpdateDistributorUser(string distributorUserId, string fullName)
        {
            var distributorUserToUpdate = DistributorUsers.FirstOrDefault(x => x.Id.ToString() == distributorUserId);

            if (distributorUserToUpdate == null)
            {
                throw new DistributorUserNotFoundException(distributorUserId);
            }


            distributorUserToUpdate.Update(fullName);

            // rais product updated event
            AddDomainEvent(new DistributorUserUpdated(distributorUserToUpdate));
        }