2022-04-26 17:21:17 +02:00
|
|
|
|
using System.Collections.Generic;
|
2019-04-12 22:39:20 +02:00
|
|
|
|
using System.Threading.Tasks;
|
2022-04-26 17:21:17 +02:00
|
|
|
|
using Bit.Core.Models.Data;
|
|
|
|
|
using Bit.Core.Models.View;
|
2019-04-12 22:39:20 +02:00
|
|
|
|
|
|
|
|
|
namespace Bit.Core.Models.Domain
|
|
|
|
|
{
|
|
|
|
|
public class Identity : Domain
|
|
|
|
|
{
|
|
|
|
|
private HashSet<string> _map = new HashSet<string>
|
|
|
|
|
{
|
|
|
|
|
"Title",
|
|
|
|
|
"FirstName",
|
|
|
|
|
"MiddleName",
|
|
|
|
|
"LastName",
|
|
|
|
|
"Address1",
|
|
|
|
|
"Address2",
|
|
|
|
|
"Address3",
|
|
|
|
|
"City",
|
|
|
|
|
"State",
|
|
|
|
|
"PostalCode",
|
|
|
|
|
"Country",
|
|
|
|
|
"Company",
|
|
|
|
|
"Email",
|
|
|
|
|
"Phone",
|
|
|
|
|
"SSN",
|
|
|
|
|
"Username",
|
|
|
|
|
"PassportNumber",
|
|
|
|
|
"LicenseNumber"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public Identity() { }
|
|
|
|
|
|
|
|
|
|
public Identity(IdentityData obj, bool alreadyEncrypted = false)
|
|
|
|
|
{
|
|
|
|
|
BuildDomainModel(this, obj, _map, alreadyEncrypted);
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-21 22:27:14 +02:00
|
|
|
|
public EncString Title { get; set; }
|
|
|
|
|
public EncString FirstName { get; set; }
|
|
|
|
|
public EncString MiddleName { get; set; }
|
|
|
|
|
public EncString LastName { get; set; }
|
|
|
|
|
public EncString Address1 { get; set; }
|
|
|
|
|
public EncString Address2 { get; set; }
|
|
|
|
|
public EncString Address3 { get; set; }
|
|
|
|
|
public EncString City { get; set; }
|
|
|
|
|
public EncString State { get; set; }
|
|
|
|
|
public EncString PostalCode { get; set; }
|
|
|
|
|
public EncString Country { get; set; }
|
|
|
|
|
public EncString Company { get; set; }
|
|
|
|
|
public EncString Email { get; set; }
|
|
|
|
|
public EncString Phone { get; set; }
|
|
|
|
|
public EncString SSN { get; set; }
|
|
|
|
|
public EncString Username { get; set; }
|
|
|
|
|
public EncString PassportNumber { get; set; }
|
|
|
|
|
public EncString LicenseNumber { get; set; }
|
2019-04-12 22:39:20 +02:00
|
|
|
|
|
|
|
|
|
public Task<IdentityView> DecryptAsync(string orgId)
|
|
|
|
|
{
|
|
|
|
|
return DecryptObjAsync(new IdentityView(this), this, _map, orgId);
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-14 04:53:20 +02:00
|
|
|
|
public IdentityData ToIdentityData()
|
2019-04-12 22:39:20 +02:00
|
|
|
|
{
|
|
|
|
|
var i = new IdentityData();
|
|
|
|
|
BuildDataModel(this, i, _map);
|
|
|
|
|
return i;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|