<commit_before>﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using DataAnnotationsExtensions;
using FluentNHibernate.Mapping;
using UCDArch.Core.DomainModel;

namespace Purchasing.Core.Domain
{
    public class User : DomainObjectWithTypedId<string>
    {
        public User()
        {
            Organizations = new List<Organization>();
            Roles = new List<Role>();
            WorkgroupPermissions = new List<WorkgroupPermission>();
        }
        public User(string id) : this()
        {
            Id = id;
            IsActive = true;
        }

        public virtual string FullName { get { return string.Format("{0} {1}", FirstName, LastName); } }
        
        public virtual string FullNameAndId { get { return string.Format("{0} ({1})", FullName, Id); } }
        
        public virtual string FullNameAndIdLastFirst { get { return string.Format("{0}, {1} ({2})", LastName, FirstName, Id); } }

        /// <summary>
        /// User is away if the AwayUntil value is set to sometime in the future
        /// </summary>
        public virtual bool IsAway { get; set; }
        //public virtual bool IsAway { get { return AwayUntil.HasValue && AwayUntil.Value > DateTime.Now; } }
        

        [Required]
        [StringLength(10)]
        [Display(Name = "KerberosID")]<commit_msg>force user id to be lower when creating new user.<commit_after>﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using DataAnnotationsExtensions;
using FluentNHibernate.Mapping;
using UCDArch.Core.DomainModel;

namespace Purchasing.Core.Domain
{
    public class User : DomainObjectWithTypedId<string>
    {
        public User()
        {
            Organizations = new List<Organization>();
            Roles = new List<Role>();
            WorkgroupPermissions = new List<WorkgroupPermission>();
        }
        public User(string id) : this()
        {
            Id = id.ToLower();
            IsActive = true;
        }

        public virtual string FullName { get { return string.Format("{0} {1}", FirstName, LastName); } }
        
        public virtual string FullNameAndId { get { return string.Format("{0} ({1})", FullName, Id); } }
        
        public virtual string FullNameAndIdLastFirst { get { return string.Format("{0}, {1} ({2})", LastName, FirstName, Id); } }

        /// <summary>
        /// User is away if the AwayUntil value is set to sometime in the future
        /// </summary>
        public virtual bool IsAway { get; set; }
        //public virtual bool IsAway { get { return AwayUntil.HasValue && AwayUntil.Value > DateTime.Now; } }
        

        [Required]
        [StringLength(10)]
        [Display(Name = "KerberosID")]
{'fraction_non_alphanumeric': 0.11438848920863309, 'fraction_numerical': 0.006474820143884892, 'mean_word_length': 2.4080882352941178, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1052712', 'n_tokens_mistral': 767, 'n_tokens_neox': 750, 'n_words': 216}