Example #1
0
 /// <summary>
 /// A charging period consists of a start timestamp and a
 /// list of possible values that influence this period.
 /// </summary>
 /// <param name="UID">The unique identification by which this token can be identified.</param>
 /// <param name="TokenType">The type of the token.</param>
 /// <param name="ContractId">Uniquely identifies the EV driver contract token within the eMSP’s platform (and suboperator platforms).</param>
 public CDRToken(Token_Id UID,
                 TokenTypes TokenType,
                 Contract_Id ContractId)
 {
     this.UID        = UID;
     this.TokenType  = TokenType;
     this.ContractId = ContractId;
 }
Example #2
0
        /// <summary>
        /// Create a new token describing the charging session and its costs,
        /// how these costs are composed, etc.
        /// </summary>
        public Token(CountryCode CountryCode,
                     Party_Id PartyId,
                     Token_Id Id,
                     TokenTypes Type,
                     Contract_Id ContractId,
                     String Issuer,
                     Boolean IsValid,
                     WhitelistTypes WhitelistType,

                     String VisualNumber           = null,
                     Group_Id?GroupId              = null,
                     Languages?UILanguage          = null,
                     ProfileTypes?DefaultProfile   = null,
                     EnergyContract?EnergyContract = null,

                     DateTime?LastUpdated = null)

        {
            if (Issuer.IsNullOrEmpty())
            {
                throw new ArgumentNullException(nameof(Issuer), "The given issuer must not be null or empty!");
            }

            this.CountryCode   = CountryCode;
            this.PartyId       = PartyId;
            this.Id            = Id;
            this.Type          = Type;
            this.ContractId    = ContractId;
            this.Issuer        = Issuer;
            this.IsValid       = IsValid;
            this.WhitelistType = WhitelistType;

            this.VisualNumber   = VisualNumber;
            this.GroupId        = GroupId;
            this.UILanguage     = UILanguage;
            this.DefaultProfile = DefaultProfile;
            this.EnergyContract = EnergyContract;

            this.LastUpdated = LastUpdated ?? DateTime.Now;

            CalcSHA256Hash();
        }