Merge pull request #263 from visagang/master

Add attributes to user view model
This commit is contained in:
Haiping 2024-01-23 14:05:55 -06:00 committed by GitHub
commit 34442fc350
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16,6 +16,12 @@ public class UserViewModel
public string Role { get; set; } = UserRole.Client;
[JsonPropertyName("full_name")]
public string FullName => $"{FirstName} {LastName}";
[JsonPropertyName("external_id")]
public string? ExternalId { get; set; }
[JsonPropertyName("create_date")]
public DateTime CreateDate { get; set; }
[JsonPropertyName("update_date")]
public DateTime UpdateDate { get; set; }
public static UserViewModel FromUser(User user)
{
@ -36,7 +42,10 @@ public class UserViewModel
FirstName = user.FirstName,
LastName = user.LastName,
Email = user.Email,
Role = user.Role
Role = user.Role,
ExternalId = user.ExternalId,
CreateDate = user.CreatedTime,
UpdateDate = user.UpdatedTime
};
}
}