123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- using System;
- namespace FspWebApp.Entity.Client
- {
- /// <summary>
- /// Specify how a item mesured, by volumn (galon) or piece.
- /// </summary>
- public enum PosItemUnitId { VOL, PCS }
- /// <summary>
- /// POCO for Pos Item
- /// Same sort of product could use the same itemId with diff barcode.
- /// barcode should always be unique.
- /// </summary>
- public class PosItem
- {
- //[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
- //public Guid Id { get; set; }
- ///// <summary>
- ///// predefined by business.
- ///// could have one itemid correlated to multiple BarCode, one icecream with diff colors??
- ///// </summary>
- ////[Index("IX_ItemIdChangesetBarCode", 1, IsUnique = true)]
- //[Index("IX_ItemId", IsUnique = false)]
- //[Required]
- //[MaxLength(20)]
- public string ItemId { get; set; }
- /// <summary>
- /// predefined by business.
- /// could have one itemid correlated to multiple BarCode, one icecream with diff colors??
- /// </summary>
- public string BarCode { get; set; }
- /// <summary>
- /// for keep all history item, import this version
- /// </summary>
- //[Index("IX_ItemIdChangesetBarCode", 3, IsUnique = true)]
- //[Index("IX_BarCodeChangeset", 2, IsUnique = true)]
- //public Guid? ChangesetId { get; set; }
- //[ForeignKey("ChangesetId")]
- //public virtual Changeset Changeset { get; set; }
- ///// <summary>
- ///// predefined by business
- ///// </summary>
- //[Required]
- //[MaxLength(100)]
- public string ItemName { get; set; }
- //public PosItemUnitId UnitId { get; set; }
- public decimal Price { get; set; }
- //public DateTime DateToActivate { get; set; }
- //public DateTime DateToDeactivate { get; set; }
- ///// <summary>
- ///// Gets or sets the datetime when this PosItem created and saved into database.
- ///// normally this time should be automatically set at the saving time (to db).
- ///// </summary>
- //[Index("IX_CreatedDateTime", IsUnique = false)]
- //public DateTime CreatedDateTime { get; set; }
- public bool IsFuelItem { get; set; }
- ///// <summary>
- ///// Gets or sets if this item had been marked as deleted, and will not allow to sale anymore.
- ///// </summary>
- //public bool IsMarkedAsDeletion { get; set; }
- ///// <summary>
- ///// defined and involved in which Pos Discount definition.
- ///// The PosDiscount typically downloaded and parsed from a table download or BOS download.
- ///// </summary>
- ////public virtual List<PosDiscount> AppliedInPosDiscounts { get; set; }
- ///// <summary>
- ///// A PosItem should only belongs to one Group, but why we not setup a simple Foreign key property
- ///// here? because the Group must be chained with the BU of this PosItem assgined(a BU have ONLY ONE specified BU system at a time).
- ///// think about the case, a PosItem under BU A set with Group B, someday someone changed its BU to C, then the B for this Item
- ///// is not available anymore, we have to anually maintain(update B to something else, otherwise the item is still with the old group which even may not under the new group system)
- ///// this 2 properties' relation otherwise this object is in a wrong state, which is bad.
- ///// the solution is to create a dedicated DB tables to maintain the PosItem and Group relation, rather to do that,
- ///// why not choose a ManyToMany property which EF support originally.
- ///// </summary>
- //public virtual List<PosItemGroup> AppliedInPosItemGroups { get; set; }
- //public virtual Guid TargetBusinessUnitId { get; set; }
- }
- }
|