TransactionEventRequest.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. using EVCB_OCPP.Packet20.DataTypes;
  2. using EVCB_OCPP.Packet20.DataTypes.EnumTypes;
  3. using EVCB_OCPP.Packet20.Utilites;
  4. using Newtonsoft.Json;
  5. using Newtonsoft.Json.Converters;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.ComponentModel.DataAnnotations;
  9. using System.Linq;
  10. using System.Text;
  11. using System.Threading.Tasks;
  12. namespace EVCB_OCPP.Packet20.Messages
  13. {
  14. public class TransactionEventRequest
  15. {
  16. /// <summary>
  17. /// This contains the type of this event. The first
  18. /// TransactionEvent of a transaction SHALL contain:
  19. ///"Started" The last TransactionEvent of a transaction
  20. ///SHALL contain: "Ended" All others SHALL contain:
  21. ///"Updated"
  22. /// </summary>
  23. [Required]
  24. [JsonConverter(typeof(StringEnumConverter))]
  25. public TransactionEventEnumType EventType { set; get; }
  26. /// <summary>
  27. /// The date and time at which this transaction
  28. ///event occurred.
  29. /// </summary>
  30. [Required]
  31. [JsonConverter(typeof(UTCDateTimeConverter))]
  32. public DateTime Timestamp { set; get; }
  33. /// <summary>
  34. /// Reason the Charging Station sends this
  35. ///message to the CSMS
  36. /// </summary>
  37. [Required]
  38. [JsonConverter(typeof(StringEnumConverter))]
  39. public TriggerReasonEnumType TriggerReason { set; get; }
  40. /// <summary>
  41. /// Incremental sequence number, helps with
  42. ///determining if all messages of a transaction have been
  43. /// received
  44. /// </summary>
  45. [Required]
  46. public int SeqNo { set; get; }
  47. /// <summary>
  48. /// Indication that this transaction event happened
  49. /// when the Charging Station was offline.Default = false,
  50. /// meaning: the event occurred when the Charging Station
  51. /// was online.
  52. /// </summary>
  53. public bool? Offline { set; get; }
  54. /// <summary>
  55. /// If the Charging Station is able to report the
  56. /// number of phases used, then it SHALL provide it.When
  57. /// omitted the CSMS may be able to determine the number
  58. /// of phases used via device management
  59. /// </summary>
  60. public int? NumberOfPhasesUsed { set; get; }
  61. /// <summary>
  62. /// The maximum current of the connected cable in
  63. ///Ampere(A).
  64. /// </summary>
  65. public decimal? CableMaxCurrent { set; get; }
  66. /// <summary>
  67. /// his contains the Id of the reservation that
  68. /// terminates as a result of this transaction.
  69. /// </summary>
  70. public int? ReservationId { set; get; }
  71. /// <summary>
  72. /// Contains transaction specific information
  73. /// </summary>
  74. [Required]
  75. public TransactionType TransactionInfo { set; get; }
  76. /// <summary>
  77. /// This contains the identifier for which a
  78. ///transaction has to be/was started.Is required when the
  79. /// EV Driver becomes authorized for this transaction.The
  80. /// IdToken should only be send once in a
  81. /// TransactionEventRequest for every authorization done
  82. /// for this transaction.
  83. /// </summary>
  84. public IdTokenType IdToken { set; get; }
  85. /// <summary>
  86. /// This identifies which evse (and connector) of
  87. ///the Charging Station is used.
  88. /// </summary>
  89. public EVSEType Evse { set; get; }
  90. /// <summary>
  91. /// This contains the relevant meter values.
  92. /// Depending on the EventType of this TransactionEvent the
  93. /// following Configuration Variable is used to configure the
  94. ///content:
  95. ///Started: SampledDataTxStartedMeasurands
  96. /// Updated: SampledDataTxUpdatedMeasurands
  97. /// Ended: SampledDataTxEndedMeasurands &
  98. ///AlignedDataTxEndedMeasurands
  99. /// </summary>
  100. public List<MeterValueType> MeterValue { set; get; }
  101. }
  102. }