Exemple #1
0
        public async Task DeleteAsync(string legalEntityId)
        {
            var swiftCredentialses = await _swiftCredentialsRepository.GetByLegalEntityIdAsync(legalEntityId);

            if (swiftCredentialses.Count > 0)
            {
                throw new InvalidOperationException("One or more swift credentials associated with legal entity");
            }

            await _legalEntityRepository.DeleteAsync(legalEntityId);

            await _log.WriteInfoAsync(nameof(LegalEntityService), nameof(DeleteAsync), new { legalEntityId }.ToJson(),
                                      "Legal entity deleted");
        }
Exemple #2
0
 public Task <IReadOnlyList <SwiftCredentials> > GetByLegalEntityIdAsync(string legalEntityId)
 {
     return(_swiftCredentialsRepository.GetByLegalEntityIdAsync(legalEntityId));
 }