using Newtonsoft.Json;
using System;
using System.ComponentModel.DataAnnotations;

namespace Dfs.WayneChina.PosModelMini
{
    public class PosMop
    {
        /// <summary>
        /// as a special mop, define its name to `Cash`
        /// </summary>
        public const string CASH_MOP_NAME = "Cash";

        /// <summary>
        /// as a special mop, define its paymentId to 1
        /// </summary>
        public const int CASH_MOP_PAYMENT_ID = 1;

        /// <summary>
        /// Unique id of the POS MOP.
        /// </summary>
        public Guid Id { get; set; }

        /// <summary>
        /// Name of the POS MOP.
        /// </summary>
        [Required]
        [MaxLength(60)]
        public string Name { get; set; }
        
        /// <summary>
        /// Payment ID.
        /// </summary>
        [Required]
        public int PaymentId { get; set; }

        /// <summary>
        /// Gets or sets the datetime when this Mop created and saved into database.
        /// normally this time should be automatically set at the saving time (to db).
        /// </summary>
        public DateTime CreatedDateTime { get; set; }

        /// <summary>
        /// for keep all history item, import this version
        /// </summary>
        public Guid ChangesetId { get; set; }

        /// <summary>
        /// References the change set.
        /// </summary>
        public virtual Changeset Changeset { get; set; }

        /// <summary>
        /// Target business unit id.
        /// </summary>
        public virtual Guid? TargetBusinessUnitId { get; set; }

        /// <summary>
        /// Gets or sets which BusinessUnit this Mop will perform on.
        /// </summary>
        public virtual BusinessUnit TargetBusinessUnit { get; set; }

        /// <summary>
        /// Display name of the POS MOP.
        /// </summary>
        public string DisplayName { get; set; }
    }
}