1
0
mirror of https://github.com/bitwarden/mobile synced 2026-02-05 11:03:16 +00:00
Files
mobile/src/Core/Models/Export/Card.cs
Matt Gibson 3227daddaf Enable Encrypted json export of vaults (#1174)
* Enable Encrypted json export of vaults

* Match jslib export of non-org ciphers

* Clean up export

* Update src/App/Pages/Settings/ExportVaultPage.xaml.cs

Co-authored-by: Kyle Spearrin <kspearrin@users.noreply.github.com>

Co-authored-by: Matt Gibson <mdgibson@Matts-MBP.lan>
Co-authored-by: Kyle Spearrin <kspearrin@users.noreply.github.com>
2020-12-14 11:56:13 -06:00

53 lines
1.5 KiB
C#

using Bit.Core.Models.View;
namespace Bit.Core.Models.Export
{
public class Card
{
public Card() { }
public Card(CardView obj)
{
CardholderName = obj.CardholderName;
Brand = obj.Brand;
Number = obj.Number;
ExpMonth = obj.ExpMonth;
ExpYear = obj.ExpYear;
Code = obj.Code;
}
public Card(Domain.Card obj)
{
CardholderName = obj.CardholderName?.EncryptedString;
Brand = obj.Brand?.EncryptedString;
Number = obj.Number?.EncryptedString;
ExpMonth = obj.ExpMonth?.EncryptedString;
ExpYear = obj.ExpYear?.EncryptedString;
Code = obj.Code?.EncryptedString;
}
public string CardholderName { get; set; }
public string Brand { get; set; }
public string Number { get; set; }
public string ExpMonth { get; set; }
public string ExpYear { get; set; }
public string Code { get; set; }
public static CardView ToView(Card req, CardView view = null)
{
if (view == null)
{
view = new CardView();
}
view.CardholderName = req.CardholderName;
view.Brand = req.Brand;
view.Number = req.Number;
view.ExpMonth = req.ExpMonth;
view.ExpYear = req.ExpYear;
view.Code = req.Code;
return view;
}
}
}