namespace MyOffice.Web.Models.User
{
	using Core.Extensions;
	using MyOffice.Data.Models.Users;

	public class UserViewModel
	{
		public string Id { get; set; } = null!;
		public string UserName { get; set; } = null!;
		public string Email { get; set; } = null!;
	}

	public static class UserViewModelExtensions
	{
		public static UserViewModel ToModel(this User user)
		{
			return new UserViewModel
			{
				Id = user.Id.ToShort(),
				UserName = user.UserName,
				Email = user.Email,
			};
		}
	}
}
