private void EnsureAccountLegalEntityHasBeenAdded(AccountLegalEntity accountLegalEntity) { if (_accountLegalEntities.All(ale => ale.Id != accountLegalEntity.Id)) { throw new InvalidOperationException("Requires account legal entity has been added"); } }
public virtual Cohort CreateCohort(long providerId, AccountLegalEntity accountLegalEntity, Account transferSender, DraftApprenticeshipDetails draftApprenticeshipDetails, UserInfo userInfo) { return(new Cohort(providerId, accountLegalEntity.AccountId, accountLegalEntity.Id, transferSender?.Id, draftApprenticeshipDetails, Party.Provider, userInfo)); }
public AccountLegalEntity AddAccountLegalEntity(long accountLegalEntityId, long maLegalEntityId, string legalEntityId, string accountLegalEntityPublicHashedId, string name, OrganisationType organisationType, string address, DateTime added) { EnsureAccountLegalEntityHasNotAlreadyBeenAdded(accountLegalEntityId); var accountLegalEntity = new AccountLegalEntity(this, accountLegalEntityId, maLegalEntityId, legalEntityId, accountLegalEntityPublicHashedId, name, organisationType, address, added); _accountLegalEntities.Add(accountLegalEntity); return(accountLegalEntity); }
public Cohort CreateCohort(long providerId, AccountLegalEntity accountLegalEntity, UserInfo userInfo) { throw new NotImplementedException(); }
public virtual Cohort CreateCohortWithOtherParty(long providerId, AccountLegalEntity accountLegalEntity, Account transferSender, string message, UserInfo userInfo) { return(new Cohort(providerId, accountLegalEntity.AccountId, accountLegalEntity.Id, transferSender?.Id, Party.Employer, message, userInfo)); }
public virtual Cohort CreateCohort(long providerId, AccountLegalEntity accountLegalEntity, UserInfo userInfo) { return(new Cohort(providerId, accountLegalEntity.AccountId, accountLegalEntity.Id, Party.Provider, userInfo)); }
public void RemoveAccountLegalEntity(AccountLegalEntity accountLegalEntity, DateTime removed) { EnsureAccountLegalEntityHasBeenAdded(accountLegalEntity); accountLegalEntity.Delete(removed); }