PosItem.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. using System;
  2. namespace FspWebApp.Entity.Client
  3. {
  4. /// <summary>
  5. /// Specify how a item mesured, by volumn (galon) or piece.
  6. /// </summary>
  7. public enum PosItemUnitId { VOL, PCS }
  8. /// <summary>
  9. /// POCO for Pos Item
  10. /// Same sort of product could use the same itemId with diff barcode.
  11. /// barcode should always be unique.
  12. /// </summary>
  13. public class PosItem
  14. {
  15. //[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
  16. //public Guid Id { get; set; }
  17. ///// <summary>
  18. ///// predefined by business.
  19. ///// could have one itemid correlated to multiple BarCode, one icecream with diff colors??
  20. ///// </summary>
  21. ////[Index("IX_ItemIdChangesetBarCode", 1, IsUnique = true)]
  22. //[Index("IX_ItemId", IsUnique = false)]
  23. //[Required]
  24. //[MaxLength(20)]
  25. public string ItemId { get; set; }
  26. /// <summary>
  27. /// predefined by business.
  28. /// could have one itemid correlated to multiple BarCode, one icecream with diff colors??
  29. /// </summary>
  30. public string BarCode { get; set; }
  31. /// <summary>
  32. /// for keep all history item, import this version
  33. /// </summary>
  34. //[Index("IX_ItemIdChangesetBarCode", 3, IsUnique = true)]
  35. //[Index("IX_BarCodeChangeset", 2, IsUnique = true)]
  36. //public Guid? ChangesetId { get; set; }
  37. //[ForeignKey("ChangesetId")]
  38. //public virtual Changeset Changeset { get; set; }
  39. ///// <summary>
  40. ///// predefined by business
  41. ///// </summary>
  42. //[Required]
  43. //[MaxLength(100)]
  44. public string ItemName { get; set; }
  45. //public PosItemUnitId UnitId { get; set; }
  46. public decimal Price { get; set; }
  47. //public DateTime DateToActivate { get; set; }
  48. //public DateTime DateToDeactivate { get; set; }
  49. ///// <summary>
  50. ///// Gets or sets the datetime when this PosItem created and saved into database.
  51. ///// normally this time should be automatically set at the saving time (to db).
  52. ///// </summary>
  53. //[Index("IX_CreatedDateTime", IsUnique = false)]
  54. //public DateTime CreatedDateTime { get; set; }
  55. public bool IsFuelItem { get; set; }
  56. ///// <summary>
  57. ///// Gets or sets if this item had been marked as deleted, and will not allow to sale anymore.
  58. ///// </summary>
  59. //public bool IsMarkedAsDeletion { get; set; }
  60. ///// <summary>
  61. ///// defined and involved in which Pos Discount definition.
  62. ///// The PosDiscount typically downloaded and parsed from a table download or BOS download.
  63. ///// </summary>
  64. ////public virtual List<PosDiscount> AppliedInPosDiscounts { get; set; }
  65. ///// <summary>
  66. ///// A PosItem should only belongs to one Group, but why we not setup a simple Foreign key property
  67. ///// 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).
  68. ///// 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
  69. ///// 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)
  70. ///// this 2 properties' relation otherwise this object is in a wrong state, which is bad.
  71. ///// the solution is to create a dedicated DB tables to maintain the PosItem and Group relation, rather to do that,
  72. ///// why not choose a ManyToMany property which EF support originally.
  73. ///// </summary>
  74. //public virtual List<PosItemGroup> AppliedInPosItemGroups { get; set; }
  75. //public virtual Guid TargetBusinessUnitId { get; set; }
  76. }
  77. }