diff --git a/src/Application/Services/DomainService/AccountService.cs b/src/Application/Services/DomainService/AccountService.cs index 58347f2..c999259 100644 --- a/src/Application/Services/DomainService/AccountService.cs +++ b/src/Application/Services/DomainService/AccountService.cs @@ -35,6 +35,11 @@ public async Task AddAccountsFromCsvAsync(string filePath, long fileId) var existingAccountIds = await _accountRepository.GetAllIdsAsync(); var newAccounts = accounts.Where(a => !existingAccountIds.Contains(a.AccountId)).ToList(); + if(newAccounts.Count == 0) + { + return Result.Fail(ErrorCode.BadRequest, "No new accounts to add"); + } + var fileAlreadyExists = await _fileIdRepository.IdExistsAsync(fileId); if (fileAlreadyExists) {