Files
server/util/Seeder/Factories/BankAccountCipherSeeder.cs
SmithThe4th bc1818041b [PM-34060] Add bank account item type (#7112)
* Added new bank account type, added minimum version logic and sync filters

* Formatted changes

* changed condition for filtering bank account types

* Fixed tests

* Updated feature flag

* Added comment

* updated feature flag and updated dto

* update ticket for minimum bank account version

* add event types for bank account

* fix client version being null bug

---------

Co-authored-by: Nick Krantz <nick@livefront.com>
2026-04-16 12:32:51 -05:00

30 lines
862 B
C#

using Bit.Core.Vault.Entities;
using Bit.Core.Vault.Enums;
using Bit.Seeder.Models;
namespace Bit.Seeder.Factories;
internal static class BankAccountCipherSeeder
{
internal static Cipher Create(
string encryptionKey,
string name,
BankAccountViewDto bankAccount,
Guid? organizationId = null,
Guid? userId = null,
string? notes = null)
{
var cipherView = new CipherViewDto
{
OrganizationId = organizationId,
Name = name,
Notes = notes,
Type = CipherTypes.BankAccount,
BankAccount = bankAccount
};
var encrypted = CipherEncryption.Encrypt(cipherView, encryptionKey);
return CipherEncryption.CreateEntity(encrypted, encrypted.ToBankAccountData(), CipherType.BankAccount, organizationId, userId);
}
}