1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-21 02:33:36 +00:00
Files
mobile/src/Core/Models/Domain/Card.cs
2019-04-13 22:53:20 -04:00

47 lines
1.2 KiB
C#

using Bit.Core.Models.Data;
using Bit.Core.Models.View;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Bit.Core.Models.Domain
{
public class Card : Domain
{
private HashSet<string> _map = new HashSet<string>
{
"CardholderName",
"Brand",
"Number",
"ExpMonth",
"ExpYear",
"Code"
};
public Card() { }
public Card(CardData obj, bool alreadyEncrypted = false)
{
BuildDomainModel(this, obj, _map, alreadyEncrypted);
}
public CipherString CardholderName { get; set; }
public CipherString Brand { get; set; }
public CipherString Number { get; set; }
public CipherString ExpMonth { get; set; }
public CipherString ExpYear { get; set; }
public CipherString Code { get; set; }
public Task<CardView> DecryptAsync(string orgId)
{
return DecryptObjAsync(new CardView(this), this, _map, orgId);
}
public CardData ToCardData()
{
var c = new CardData();
BuildDataModel(this, c, _map);
return c;
}
}
}