TransactionRecord.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. namespace EVCB_OCPP.Domain.Models.Database
  2. {
  3. using Microsoft.EntityFrameworkCore;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.ComponentModel;
  7. using System.ComponentModel.DataAnnotations;
  8. using System.ComponentModel.DataAnnotations.Schema;
  9. /// <summary>
  10. /// 交易紀錄
  11. /// </summary>
  12. [Table("TransactionRecord")]
  13. [Index(nameof(ConnectorId), nameof(ChargeBoxId), nameof(StartTime) , IsUnique = true)]
  14. public partial class TransactionRecord
  15. {
  16. public TransactionRecord()
  17. {
  18. StartIdTag = string.Empty;
  19. StopIdTag = string.Empty;
  20. StartTime = new DateTime(1991, 1, 1);
  21. StopTime = new DateTime(1991, 1, 1);
  22. ReservationId = -1;
  23. BillingDone = false;
  24. CreatedOn = new DateTime(1991, 1, 1);
  25. UpdatedOn = new DateTime(1991, 1, 1);
  26. StartTransactionReportedOn = new DateTime(1991, 1, 1);
  27. StopTransactionReportedOn = new DateTime(1991, 1, 1);
  28. ErrorMsg = string.Empty;
  29. }
  30. [Key]
  31. public Int32 Id { get; set; }
  32. /// <summary>
  33. /// 客戶代碼
  34. /// </summary>
  35. [Required]
  36. public Guid CustomerId { get; set; }
  37. /// <summary>
  38. /// 槍號 1 byte string、本來是 string、改為byte
  39. /// </summary>
  40. [Required]
  41. //[Index("IX_1202_Issue_Report", Order = 2, IsUnique = true)]
  42. public byte ConnectorId { get; set; }
  43. /// <summary>
  44. /// chargePointSerialNumber
  45. /// </summary>
  46. //[Index("IX_MachineId")]
  47. //[Index("IX_1202_Issue_Report", Order = 1, IsUnique = true)]
  48. [Required]
  49. [StringLength(50)]
  50. public string ChargeBoxId { get; set; }
  51. /// <summary>
  52. /// StartIdTag
  53. /// </summary>
  54. [StringLength(20)]
  55. public string StartIdTag { get; set; }
  56. /// <summary>
  57. /// StopIdTag
  58. /// </summary>
  59. [StringLength(20)]
  60. public string StopIdTag { get; set; }
  61. /// <summary>
  62. /// 開始充電開始時間
  63. /// </summary>
  64. //[Index("IX_1202_Issue_Report", Order = 3, IsUnique = true)]
  65. public DateTime StartTime { get; set; }
  66. /// <summary>
  67. /// 充電結束時間
  68. /// </summary>
  69. public DateTime StopTime { get; set; }
  70. /// <summary>
  71. /// 預約Id
  72. /// </summary>
  73. public int ReservationId { set; get; }
  74. /// <summary>
  75. /// 停止原因No
  76. /// </summary>
  77. public int StopReasonId { set; get; }
  78. /// <summary>
  79. /// 停止原因
  80. /// </summary>
  81. [StringLength(60)]
  82. public string StopReason { set; get; }
  83. /// <summary>
  84. /// 開始meter
  85. /// </summary>
  86. [DataType("decimal(16 ,2)")]
  87. public decimal MeterStart { get; set; }
  88. /// <summary>
  89. /// 結束meter
  90. /// </summary>
  91. [DataType("decimal(16 ,2)")]
  92. public decimal MeterStop { get; set; }
  93. /// <summary>
  94. /// 產生時間
  95. /// </summary>
  96. public DateTime CreatedOn { get; set; }
  97. /// <summary>
  98. /// 更新時間
  99. /// </summary>
  100. public DateTime UpdatedOn { get; set; }
  101. /// <summary>
  102. /// 開始充電的回報時間
  103. /// </summary>
  104. public DateTime StartTransactionReportedOn { get; set; }
  105. /// <summary>
  106. /// 開始充電回報的次數
  107. /// </summary>
  108. public int RetryStartTransactionTimes { get; set; }
  109. /// <summary>
  110. /// 結束充電的回報時間
  111. /// </summary>
  112. public DateTime StopTransactionReportedOn { get; set; }
  113. /// <summary>
  114. /// 結束充電回報的次數
  115. /// </summary>
  116. public int RetryStopTransactionTimes { get; set; }
  117. /// <summary>
  118. /// 回調客戶API,問題紀錄
  119. /// </summary>
  120. public string ErrorMsg { set; get; }
  121. /// <summary>
  122. /// 計費完成與否
  123. /// </summary>
  124. public bool BillingDone { set; get; }
  125. /// <summary>
  126. /// 是否上傳到TTIA
  127. /// </summary>
  128. public bool UploadedtoTTIA { set; get; }
  129. [DataType("decimal(16 ,2)")]
  130. public decimal Cost { set; get; }
  131. /// <summary>
  132. /// 收費明細
  133. /// </summary>
  134. [StringLength(3000)]
  135. public string Receipt { set; get; }
  136. /// <summary>
  137. /// 收費標準
  138. /// </summary>
  139. [StringLength(1500)]
  140. public string Fee { set; get; }
  141. }
  142. }