Ejemplo n.º 1
0
        /// <summary>
        /// Return a numeric representation of the given charge detail record nature.
        /// </summary>
        /// <param name="CDRNature">A charge detail record nature.</param>
        public static Byte AsNumber(this CDRNatures CDRNature)
        {
            switch (CDRNature)
            {
            case CDRNatures.Final:
                return(1);

            case CDRNatures.Intermediate:
                return(2);

            default:
                return(0);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Return a text representation of the given charge detail record nature.
        /// </summary>
        /// <param name="CDRNature">A charge detail record nature.</param>
        public static String AsText(this CDRNatures CDRNature)
        {
            switch (CDRNature)
            {
            case CDRNatures.Final:
                return("1");

            case CDRNatures.Intermediate:
                return("2");

            default:
                return("0");
            }
        }
        /// <summary>
        /// Create a new charge detail record.
        /// </summary>
        /// <param name="CDRNature">State of the charging session.</param>
        /// <param name="ServiceSessionId">GIREVE session id for this charging session.</param>
        /// <param name="RequestedServiceId">The unique identification of the requested service for this charging session.</param>
        /// <param name="EVSEId">The unique identification of the EVSE used for charging.</param>
        /// <param name="UserContractIdAlias">Alias of the contract id between the end-user and the eMSP. This alias may have been anonymised by the eMSP.</param>
        /// <param name="UserId">The unique identification of the user.</param>
        /// <param name="StartTime">Start time of the charging session.</param>
        /// <param name="EndTime">End time of the charging session, or the timestamp of the meter reading for intermediate charge detail records.</param>
        ///
        /// <param name="ExecPartnerSessionId">Charging session identification at the operator.</param>
        /// <param name="ExecPartnerOperatorId">The unique identification of the charging operator.</param>
        /// <param name="SalesPartnerSessionId">Charging session identification at the e-mobility provider.</param>
        /// <param name="SalesPartnerOperatorId">The unique identification of the e-mobility provider.</param>
        /// <param name="PartnerProductId">The unique identification of the charging product.</param>
        /// <param name="MeterReports">An optional enumeration of meter reports.</param>
        ///
        /// <param name="InternalData">An optional dictionary of customer-specific data.</param>
        public ChargeDetailRecord(CDRNatures CDRNature,
                                  ServiceSession_Id ServiceSessionId,
                                  Service_Id RequestedServiceId,
                                  EVSE_Id EVSEId,
                                  User_Id UserId,
                                  DateTime StartTime,
                                  DateTime EndTime,

                                  Contract_Id?UserContractIdAlias         = null,
                                  ServiceSession_Id?ExecPartnerSessionId  = null,
                                  Operator_Id?ExecPartnerOperatorId       = null,
                                  ServiceSession_Id?SalesPartnerSessionId = null,
                                  Provider_Id?SalesPartnerOperatorId      = null,
                                  PartnerProduct_Id?PartnerProductId      = null,
                                  IEnumerable <MeterReport> MeterReports  = null,

                                  IReadOnlyDictionary <String, Object> InternalData = null)

            : base(InternalData)

        {
            this.CDRNature           = CDRNature;
            this.ServiceSessionId    = ServiceSessionId;
            this.RequestedServiceId  = RequestedServiceId;
            this.EVSEId              = EVSEId;
            this.UserContractIdAlias = UserContractIdAlias;
            this.UserId              = UserId;
            this.StartTime           = StartTime;
            this.EndTime             = EndTime;

            this.ExecPartnerSessionId   = ExecPartnerSessionId;
            this.ExecPartnerOperatorId  = ExecPartnerOperatorId;
            this.SalesPartnerSessionId  = SalesPartnerSessionId;
            this.SalesPartnerOperatorId = SalesPartnerOperatorId;
            this.PartnerProductId       = PartnerProductId;
            this.MeterReports           = MeterReports ?? new MeterReport[0];
        }