Promotion.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. using Newtonsoft.Json;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. namespace Dfs.WayneChina.IPosPlus.ServiceClient
  6. {
  7. public class Promotion
  8. {
  9. [JsonProperty("type")]
  10. public string Type { get; set; }
  11. [JsonProperty("rule")]
  12. public string Rule { get; set; }
  13. [JsonProperty("description")]
  14. public string Description { get; set; }
  15. }
  16. //COPY FROM CloudService
  17. #region copy from cloud service
  18. // request part
  19. public class PromotionRequestItem
  20. {
  21. public Guid Id { get; set; }
  22. public Guid LineItemId { get; set; }
  23. public string Category { get; set; }
  24. public string Name { get; set; }
  25. public string Barcode { get; set; }
  26. public decimal Quantity { get; set; }
  27. public decimal Price { get; set; }
  28. public decimal Amount { get; set; }
  29. }
  30. public class PromotionRequest
  31. {
  32. public string AccountId { get; set; }
  33. public Guid OwnerId { get; set; }
  34. public Guid Id { get; set; }
  35. public decimal Amount { get; set; }
  36. public decimal AmountAfterDiscount { get; set; }
  37. public string AccountIcCardNo { get; set; }
  38. public DateTime Created { get; set; }
  39. public List<PromotionRequestItem> Items { get; set; }
  40. public List<Payment> Payments { get; set; }
  41. /// <summary>
  42. /// Coupon applied in this Trx.
  43. /// </summary>
  44. public List<string> CouponUidList { get; set; }
  45. /// <summary>
  46. /// Discounts applied in this Trx.
  47. /// </summary>
  48. public List<string> DiscountUidList { get; set; }
  49. }
  50. public class Payment
  51. {
  52. public string Name { get; set; }
  53. public decimal Value { get; set; }
  54. }
  55. //response part
  56. public class ProductDiscount
  57. {
  58. public string barCode { get; set; }
  59. public string lineItemId { get; set; }
  60. public double amount { get; set; }
  61. }
  62. public class ProductSubDiscount
  63. {
  64. public string barCode { get; set; }
  65. public string lineItemId { get; set; }
  66. public double amount { get; set; }
  67. }
  68. public class DiscountTypeList
  69. {
  70. public string name { get; set; }
  71. public string uid { get; set; }
  72. public double discountAmount { get; set; }
  73. public string discountCaculationAlgorithm { get; set; }
  74. public IList<string> productBarCodes { get; set; }
  75. public object productCategories { get; set; }
  76. public double saleAmount { get; set; }
  77. public IList<ProductSubDiscount> productSubDiscounts { get; set; }
  78. }
  79. public class Discounts
  80. {
  81. public double amountAfterDiscount { get; set; }
  82. public double discountAmount { get; set; }
  83. public IList<ProductDiscount> productDiscounts { get; set; }
  84. public IList<DiscountTypeList> discountTypeList { get; set; }
  85. }
  86. public class Data
  87. {
  88. public string coupons { get; set; }
  89. public Discounts discounts { get; set; }
  90. }
  91. public class DiscountForTrx
  92. {
  93. public string code { get; set; }
  94. public string message { get; set; }
  95. public Data data { get; set; }
  96. }
  97. #endregion
  98. }