/* 
 * GK application - OmniPOS Service API
 *
 * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
 *
 * OpenAPI spec version: 5.21.1-b03
 * 
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 */

using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;
using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter;

namespace IO.Swagger.Model
{
    /// <summary>
    /// RetailPriceModifier &lt;emph&gt;undocumented&lt;/emph&gt;
    /// </summary>
    [DataContract]
    public partial class ComGkSoftwareGkrApiTxpoolDtoRetailPriceModifier :  IEquatable<ComGkSoftwareGkrApiTxpoolDtoRetailPriceModifier>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiTxpoolDtoRetailPriceModifier" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected ComGkSoftwareGkrApiTxpoolDtoRetailPriceModifier() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="ComGkSoftwareGkrApiTxpoolDtoRetailPriceModifier" /> class.
        /// </summary>
        /// <param name="key">&lt;p&gt;Getter for inner key class.&lt;/p&gt; (required).</param>
        /// <param name="promotionID">The unique identifier of the promotion..</param>
        /// <param name="priceDerivationRuleID">The unique identifier of the price derivation rule. .</param>
        /// <param name="priceDerivationRuleEligibilityID">The unique identifier of the root eligibility..</param>
        /// <param name="reasonCode">The reason code for manual price overrides..</param>
        /// <param name="previousPrice">The unit price that was valid before manual price override.&lt;br&gt;Fixed decimal precision expected, definition of used precision: double(16, 5). Be aware of this and round value!.</param>
        /// <param name="percent">The percentage value in case of percentage price modifiers. (required).</param>
        /// <param name="amount">The total amount of the retail price modifier. (required).</param>
        /// <param name="calculationMethodCode">A type code used to identity manual price overrides..</param>
        /// <param name="adjustmentMethodCode">A mnemonic code denoting what kind of adjustment is being made to the retail price of the Item (Increase, Decrease)..</param>
        /// <param name="newPrice">The unit price that was the result of the price modification. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(16, 5). Be aware of this and round value!.</param>
        /// <param name="eligibilityTypeCode">The type code of the root eligibility.</param>
        /// <param name="extendedAmountBeforeModification">The retail sale total price of the line item before applying the current price modifier  (required).</param>
        /// <param name="extendedAmountAfterModification">The retail sale total price of the line item after applying the current price modifier  (required).</param>
        /// <param name="appliedQuantity">The quantity the price modifier applies to. Always positive. (required).</param>
        /// <param name="triggerSequenceNumber">The ident of the manual trigger (because one line item can have more than one trigger) .</param>
        /// <param name="reasonDescription">A narrative description describing the reason for manual price overrides..</param>
        /// <param name="extraAmount">A monetary amount which results from applying a price modifier but does not affect the line item total  (required).</param>
        /// <param name="roundingAmount">The monetary amount that the price modifier was adjusted by.  (required).</param>
        /// <param name="externalSystemOriginatorFlag">Determines whether this entry was created by an external system - if yes, it must not be changed, but own price modifications with higher sequence may be applied  (required).</param>
        /// <param name="prorateFrom">The sequence number of the PriceModificationLineItem.Only filled for discount shares of transaction related discounts..</param>
        /// <param name="calculationBaseAmount">The amount which was used as base for calculation of the price modification (required).</param>
        /// <param name="xxcustom05">Customizable information.</param>
        /// <param name="xxcustom03">Customizable information.</param>
        /// <param name="xxcustom02">Customizable information.</param>
        /// <param name="xxcustom04">Customizable information.</param>
        /// <param name="xxcustom01">Customizable information.</param>
        public ComGkSoftwareGkrApiTxpoolDtoRetailPriceModifier(ComGkSoftwareGkrApiTxpoolDtoRetailPriceModifierKey key = default(ComGkSoftwareGkrApiTxpoolDtoRetailPriceModifierKey), string promotionID = default(string), string priceDerivationRuleID = default(string), string priceDerivationRuleEligibilityID = default(string), string reasonCode = default(string), double? previousPrice = default(double?), double? percent = default(double?), double? amount = default(double?), string calculationMethodCode = default(string), string adjustmentMethodCode = default(string), double? newPrice = default(double?), string eligibilityTypeCode = default(string), double? extendedAmountBeforeModification = default(double?), double? extendedAmountAfterModification = default(double?), double? appliedQuantity = default(double?), int? triggerSequenceNumber = default(int?), string reasonDescription = default(string), double? extraAmount = default(double?), double? roundingAmount = default(double?), bool? externalSystemOriginatorFlag = default(bool?), int? prorateFrom = default(int?), double? calculationBaseAmount = default(double?), string xxcustom05 = default(string), string xxcustom03 = default(string), string xxcustom02 = default(string), string xxcustom04 = default(string), string xxcustom01 = default(string))
        {
            // to ensure "key" is required (not null)
            if (key == null)
            {
                throw new InvalidDataException("key is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailPriceModifier and cannot be null");
            }
            else
            {
                this.Key = key;
            }
            // to ensure "percent" is required (not null)
            if (percent == null)
            {
                throw new InvalidDataException("percent is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailPriceModifier and cannot be null");
            }
            else
            {
                this.Percent = percent;
            }
            // to ensure "amount" is required (not null)
            if (amount == null)
            {
                throw new InvalidDataException("amount is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailPriceModifier and cannot be null");
            }
            else
            {
                this.Amount = amount;
            }
            // to ensure "extendedAmountBeforeModification" is required (not null)
            if (extendedAmountBeforeModification == null)
            {
                throw new InvalidDataException("extendedAmountBeforeModification is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailPriceModifier and cannot be null");
            }
            else
            {
                this.ExtendedAmountBeforeModification = extendedAmountBeforeModification;
            }
            // to ensure "extendedAmountAfterModification" is required (not null)
            if (extendedAmountAfterModification == null)
            {
                throw new InvalidDataException("extendedAmountAfterModification is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailPriceModifier and cannot be null");
            }
            else
            {
                this.ExtendedAmountAfterModification = extendedAmountAfterModification;
            }
            // to ensure "appliedQuantity" is required (not null)
            if (appliedQuantity == null)
            {
                throw new InvalidDataException("appliedQuantity is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailPriceModifier and cannot be null");
            }
            else
            {
                this.AppliedQuantity = appliedQuantity;
            }
            // to ensure "extraAmount" is required (not null)
            if (extraAmount == null)
            {
                throw new InvalidDataException("extraAmount is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailPriceModifier and cannot be null");
            }
            else
            {
                this.ExtraAmount = extraAmount;
            }
            // to ensure "roundingAmount" is required (not null)
            if (roundingAmount == null)
            {
                throw new InvalidDataException("roundingAmount is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailPriceModifier and cannot be null");
            }
            else
            {
                this.RoundingAmount = roundingAmount;
            }
            // to ensure "externalSystemOriginatorFlag" is required (not null)
            if (externalSystemOriginatorFlag == null)
            {
                throw new InvalidDataException("externalSystemOriginatorFlag is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailPriceModifier and cannot be null");
            }
            else
            {
                this.ExternalSystemOriginatorFlag = externalSystemOriginatorFlag;
            }
            // to ensure "calculationBaseAmount" is required (not null)
            if (calculationBaseAmount == null)
            {
                throw new InvalidDataException("calculationBaseAmount is a required property for ComGkSoftwareGkrApiTxpoolDtoRetailPriceModifier and cannot be null");
            }
            else
            {
                this.CalculationBaseAmount = calculationBaseAmount;
            }
            this.PromotionID = promotionID;
            this.PriceDerivationRuleID = priceDerivationRuleID;
            this.PriceDerivationRuleEligibilityID = priceDerivationRuleEligibilityID;
            this.ReasonCode = reasonCode;
            this.PreviousPrice = previousPrice;
            this.CalculationMethodCode = calculationMethodCode;
            this.AdjustmentMethodCode = adjustmentMethodCode;
            this.NewPrice = newPrice;
            this.EligibilityTypeCode = eligibilityTypeCode;
            this.TriggerSequenceNumber = triggerSequenceNumber;
            this.ReasonDescription = reasonDescription;
            this.ProrateFrom = prorateFrom;
            this.Xxcustom05 = xxcustom05;
            this.Xxcustom03 = xxcustom03;
            this.Xxcustom02 = xxcustom02;
            this.Xxcustom04 = xxcustom04;
            this.Xxcustom01 = xxcustom01;
        }
        
        /// <summary>
        /// &lt;p&gt;Getter for inner key class.&lt;/p&gt;
        /// </summary>
        /// <value>&lt;p&gt;Getter for inner key class.&lt;/p&gt;</value>
        [DataMember(Name="key", EmitDefaultValue=false)]
        public ComGkSoftwareGkrApiTxpoolDtoRetailPriceModifierKey Key { get; set; }

        /// <summary>
        /// The unique identifier of the promotion.
        /// </summary>
        /// <value>The unique identifier of the promotion.</value>
        [DataMember(Name="promotionID", EmitDefaultValue=false)]
        public string PromotionID { get; set; }

        /// <summary>
        /// The unique identifier of the price derivation rule. 
        /// </summary>
        /// <value>The unique identifier of the price derivation rule. </value>
        [DataMember(Name="priceDerivationRuleID", EmitDefaultValue=false)]
        public string PriceDerivationRuleID { get; set; }

        /// <summary>
        /// The unique identifier of the root eligibility.
        /// </summary>
        /// <value>The unique identifier of the root eligibility.</value>
        [DataMember(Name="priceDerivationRuleEligibilityID", EmitDefaultValue=false)]
        public string PriceDerivationRuleEligibilityID { get; set; }

        /// <summary>
        /// The reason code for manual price overrides.
        /// </summary>
        /// <value>The reason code for manual price overrides.</value>
        [DataMember(Name="reasonCode", EmitDefaultValue=false)]
        public string ReasonCode { get; set; }

        /// <summary>
        /// The unit price that was valid before manual price override.&lt;br&gt;Fixed decimal precision expected, definition of used precision: double(16, 5). Be aware of this and round value!
        /// </summary>
        /// <value>The unit price that was valid before manual price override.&lt;br&gt;Fixed decimal precision expected, definition of used precision: double(16, 5). Be aware of this and round value!</value>
        [DataMember(Name="previousPrice", EmitDefaultValue=false)]
        public double? PreviousPrice { get; set; }

        /// <summary>
        /// The percentage value in case of percentage price modifiers.
        /// </summary>
        /// <value>The percentage value in case of percentage price modifiers.</value>
        [DataMember(Name="percent", EmitDefaultValue=false)]
        public double? Percent { get; set; }

        /// <summary>
        /// The total amount of the retail price modifier.
        /// </summary>
        /// <value>The total amount of the retail price modifier.</value>
        [DataMember(Name="amount", EmitDefaultValue=false)]
        public double? Amount { get; set; }

        /// <summary>
        /// A type code used to identity manual price overrides.
        /// </summary>
        /// <value>A type code used to identity manual price overrides.</value>
        [DataMember(Name="calculationMethodCode", EmitDefaultValue=false)]
        public string CalculationMethodCode { get; set; }

        /// <summary>
        /// A mnemonic code denoting what kind of adjustment is being made to the retail price of the Item (Increase, Decrease).
        /// </summary>
        /// <value>A mnemonic code denoting what kind of adjustment is being made to the retail price of the Item (Increase, Decrease).</value>
        [DataMember(Name="adjustmentMethodCode", EmitDefaultValue=false)]
        public string AdjustmentMethodCode { get; set; }

        /// <summary>
        /// The unit price that was the result of the price modification. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(16, 5). Be aware of this and round value!
        /// </summary>
        /// <value>The unit price that was the result of the price modification. &lt;br&gt;Fixed decimal precision expected, definition of used precision: double(16, 5). Be aware of this and round value!</value>
        [DataMember(Name="newPrice", EmitDefaultValue=false)]
        public double? NewPrice { get; set; }

        /// <summary>
        /// The type code of the root eligibility
        /// </summary>
        /// <value>The type code of the root eligibility</value>
        [DataMember(Name="eligibilityTypeCode", EmitDefaultValue=false)]
        public string EligibilityTypeCode { get; set; }

        /// <summary>
        /// The retail sale total price of the line item before applying the current price modifier 
        /// </summary>
        /// <value>The retail sale total price of the line item before applying the current price modifier </value>
        [DataMember(Name="extendedAmountBeforeModification", EmitDefaultValue=false)]
        public double? ExtendedAmountBeforeModification { get; set; }

        /// <summary>
        /// The retail sale total price of the line item after applying the current price modifier 
        /// </summary>
        /// <value>The retail sale total price of the line item after applying the current price modifier </value>
        [DataMember(Name="extendedAmountAfterModification", EmitDefaultValue=false)]
        public double? ExtendedAmountAfterModification { get; set; }

        /// <summary>
        /// The quantity the price modifier applies to. Always positive.
        /// </summary>
        /// <value>The quantity the price modifier applies to. Always positive.</value>
        [DataMember(Name="appliedQuantity", EmitDefaultValue=false)]
        public double? AppliedQuantity { get; set; }

        /// <summary>
        /// The ident of the manual trigger (because one line item can have more than one trigger) 
        /// </summary>
        /// <value>The ident of the manual trigger (because one line item can have more than one trigger) </value>
        [DataMember(Name="triggerSequenceNumber", EmitDefaultValue=false)]
        public int? TriggerSequenceNumber { get; set; }

        /// <summary>
        /// A narrative description describing the reason for manual price overrides.
        /// </summary>
        /// <value>A narrative description describing the reason for manual price overrides.</value>
        [DataMember(Name="reasonDescription", EmitDefaultValue=false)]
        public string ReasonDescription { get; set; }

        /// <summary>
        /// A monetary amount which results from applying a price modifier but does not affect the line item total 
        /// </summary>
        /// <value>A monetary amount which results from applying a price modifier but does not affect the line item total </value>
        [DataMember(Name="extraAmount", EmitDefaultValue=false)]
        public double? ExtraAmount { get; set; }

        /// <summary>
        /// The monetary amount that the price modifier was adjusted by. 
        /// </summary>
        /// <value>The monetary amount that the price modifier was adjusted by. </value>
        [DataMember(Name="roundingAmount", EmitDefaultValue=false)]
        public double? RoundingAmount { get; set; }

        /// <summary>
        /// Determines whether this entry was created by an external system - if yes, it must not be changed, but own price modifications with higher sequence may be applied 
        /// </summary>
        /// <value>Determines whether this entry was created by an external system - if yes, it must not be changed, but own price modifications with higher sequence may be applied </value>
        [DataMember(Name="externalSystemOriginatorFlag", EmitDefaultValue=false)]
        public bool? ExternalSystemOriginatorFlag { get; set; }

        /// <summary>
        /// The sequence number of the PriceModificationLineItem.Only filled for discount shares of transaction related discounts.
        /// </summary>
        /// <value>The sequence number of the PriceModificationLineItem.Only filled for discount shares of transaction related discounts.</value>
        [DataMember(Name="prorateFrom", EmitDefaultValue=false)]
        public int? ProrateFrom { get; set; }

        /// <summary>
        /// The amount which was used as base for calculation of the price modification
        /// </summary>
        /// <value>The amount which was used as base for calculation of the price modification</value>
        [DataMember(Name="calculationBaseAmount", EmitDefaultValue=false)]
        public double? CalculationBaseAmount { get; set; }

        /// <summary>
        /// Customizable information
        /// </summary>
        /// <value>Customizable information</value>
        [DataMember(Name="xxcustom05", EmitDefaultValue=false)]
        public string Xxcustom05 { get; set; }

        /// <summary>
        /// Customizable information
        /// </summary>
        /// <value>Customizable information</value>
        [DataMember(Name="xxcustom03", EmitDefaultValue=false)]
        public string Xxcustom03 { get; set; }

        /// <summary>
        /// Customizable information
        /// </summary>
        /// <value>Customizable information</value>
        [DataMember(Name="xxcustom02", EmitDefaultValue=false)]
        public string Xxcustom02 { get; set; }

        /// <summary>
        /// Customizable information
        /// </summary>
        /// <value>Customizable information</value>
        [DataMember(Name="xxcustom04", EmitDefaultValue=false)]
        public string Xxcustom04 { get; set; }

        /// <summary>
        /// Customizable information
        /// </summary>
        /// <value>Customizable information</value>
        [DataMember(Name="xxcustom01", EmitDefaultValue=false)]
        public string Xxcustom01 { get; set; }

        /// <summary>
        /// Returns the string presentation of the object
        /// </summary>
        /// <returns>String presentation of the object</returns>
        public override string ToString()
        {
            var sb = new StringBuilder();
            sb.Append("class ComGkSoftwareGkrApiTxpoolDtoRetailPriceModifier {\n");
            sb.Append("  Key: ").Append(Key).Append("\n");
            sb.Append("  PromotionID: ").Append(PromotionID).Append("\n");
            sb.Append("  PriceDerivationRuleID: ").Append(PriceDerivationRuleID).Append("\n");
            sb.Append("  PriceDerivationRuleEligibilityID: ").Append(PriceDerivationRuleEligibilityID).Append("\n");
            sb.Append("  ReasonCode: ").Append(ReasonCode).Append("\n");
            sb.Append("  PreviousPrice: ").Append(PreviousPrice).Append("\n");
            sb.Append("  Percent: ").Append(Percent).Append("\n");
            sb.Append("  Amount: ").Append(Amount).Append("\n");
            sb.Append("  CalculationMethodCode: ").Append(CalculationMethodCode).Append("\n");
            sb.Append("  AdjustmentMethodCode: ").Append(AdjustmentMethodCode).Append("\n");
            sb.Append("  NewPrice: ").Append(NewPrice).Append("\n");
            sb.Append("  EligibilityTypeCode: ").Append(EligibilityTypeCode).Append("\n");
            sb.Append("  ExtendedAmountBeforeModification: ").Append(ExtendedAmountBeforeModification).Append("\n");
            sb.Append("  ExtendedAmountAfterModification: ").Append(ExtendedAmountAfterModification).Append("\n");
            sb.Append("  AppliedQuantity: ").Append(AppliedQuantity).Append("\n");
            sb.Append("  TriggerSequenceNumber: ").Append(TriggerSequenceNumber).Append("\n");
            sb.Append("  ReasonDescription: ").Append(ReasonDescription).Append("\n");
            sb.Append("  ExtraAmount: ").Append(ExtraAmount).Append("\n");
            sb.Append("  RoundingAmount: ").Append(RoundingAmount).Append("\n");
            sb.Append("  ExternalSystemOriginatorFlag: ").Append(ExternalSystemOriginatorFlag).Append("\n");
            sb.Append("  ProrateFrom: ").Append(ProrateFrom).Append("\n");
            sb.Append("  CalculationBaseAmount: ").Append(CalculationBaseAmount).Append("\n");
            sb.Append("  Xxcustom05: ").Append(Xxcustom05).Append("\n");
            sb.Append("  Xxcustom03: ").Append(Xxcustom03).Append("\n");
            sb.Append("  Xxcustom02: ").Append(Xxcustom02).Append("\n");
            sb.Append("  Xxcustom04: ").Append(Xxcustom04).Append("\n");
            sb.Append("  Xxcustom01: ").Append(Xxcustom01).Append("\n");
            sb.Append("}\n");
            return sb.ToString();
        }
  
        /// <summary>
        /// Returns the JSON string presentation of the object
        /// </summary>
        /// <returns>JSON string presentation of the object</returns>
        public virtual string ToJson()
        {
            return JsonConvert.SerializeObject(this, Formatting.Indented);
        }

        /// <summary>
        /// Returns true if objects are equal
        /// </summary>
        /// <param name="input">Object to be compared</param>
        /// <returns>Boolean</returns>
        public override bool Equals(object input)
        {
            return this.Equals(input as ComGkSoftwareGkrApiTxpoolDtoRetailPriceModifier);
        }

        /// <summary>
        /// Returns true if ComGkSoftwareGkrApiTxpoolDtoRetailPriceModifier instances are equal
        /// </summary>
        /// <param name="input">Instance of ComGkSoftwareGkrApiTxpoolDtoRetailPriceModifier to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ComGkSoftwareGkrApiTxpoolDtoRetailPriceModifier input)
        {
            if (input == null)
                return false;

            return 
                (
                    this.Key == input.Key ||
                    (this.Key != null &&
                    this.Key.Equals(input.Key))
                ) && 
                (
                    this.PromotionID == input.PromotionID ||
                    (this.PromotionID != null &&
                    this.PromotionID.Equals(input.PromotionID))
                ) && 
                (
                    this.PriceDerivationRuleID == input.PriceDerivationRuleID ||
                    (this.PriceDerivationRuleID != null &&
                    this.PriceDerivationRuleID.Equals(input.PriceDerivationRuleID))
                ) && 
                (
                    this.PriceDerivationRuleEligibilityID == input.PriceDerivationRuleEligibilityID ||
                    (this.PriceDerivationRuleEligibilityID != null &&
                    this.PriceDerivationRuleEligibilityID.Equals(input.PriceDerivationRuleEligibilityID))
                ) && 
                (
                    this.ReasonCode == input.ReasonCode ||
                    (this.ReasonCode != null &&
                    this.ReasonCode.Equals(input.ReasonCode))
                ) && 
                (
                    this.PreviousPrice == input.PreviousPrice ||
                    (this.PreviousPrice != null &&
                    this.PreviousPrice.Equals(input.PreviousPrice))
                ) && 
                (
                    this.Percent == input.Percent ||
                    (this.Percent != null &&
                    this.Percent.Equals(input.Percent))
                ) && 
                (
                    this.Amount == input.Amount ||
                    (this.Amount != null &&
                    this.Amount.Equals(input.Amount))
                ) && 
                (
                    this.CalculationMethodCode == input.CalculationMethodCode ||
                    (this.CalculationMethodCode != null &&
                    this.CalculationMethodCode.Equals(input.CalculationMethodCode))
                ) && 
                (
                    this.AdjustmentMethodCode == input.AdjustmentMethodCode ||
                    (this.AdjustmentMethodCode != null &&
                    this.AdjustmentMethodCode.Equals(input.AdjustmentMethodCode))
                ) && 
                (
                    this.NewPrice == input.NewPrice ||
                    (this.NewPrice != null &&
                    this.NewPrice.Equals(input.NewPrice))
                ) && 
                (
                    this.EligibilityTypeCode == input.EligibilityTypeCode ||
                    (this.EligibilityTypeCode != null &&
                    this.EligibilityTypeCode.Equals(input.EligibilityTypeCode))
                ) && 
                (
                    this.ExtendedAmountBeforeModification == input.ExtendedAmountBeforeModification ||
                    (this.ExtendedAmountBeforeModification != null &&
                    this.ExtendedAmountBeforeModification.Equals(input.ExtendedAmountBeforeModification))
                ) && 
                (
                    this.ExtendedAmountAfterModification == input.ExtendedAmountAfterModification ||
                    (this.ExtendedAmountAfterModification != null &&
                    this.ExtendedAmountAfterModification.Equals(input.ExtendedAmountAfterModification))
                ) && 
                (
                    this.AppliedQuantity == input.AppliedQuantity ||
                    (this.AppliedQuantity != null &&
                    this.AppliedQuantity.Equals(input.AppliedQuantity))
                ) && 
                (
                    this.TriggerSequenceNumber == input.TriggerSequenceNumber ||
                    (this.TriggerSequenceNumber != null &&
                    this.TriggerSequenceNumber.Equals(input.TriggerSequenceNumber))
                ) && 
                (
                    this.ReasonDescription == input.ReasonDescription ||
                    (this.ReasonDescription != null &&
                    this.ReasonDescription.Equals(input.ReasonDescription))
                ) && 
                (
                    this.ExtraAmount == input.ExtraAmount ||
                    (this.ExtraAmount != null &&
                    this.ExtraAmount.Equals(input.ExtraAmount))
                ) && 
                (
                    this.RoundingAmount == input.RoundingAmount ||
                    (this.RoundingAmount != null &&
                    this.RoundingAmount.Equals(input.RoundingAmount))
                ) && 
                (
                    this.ExternalSystemOriginatorFlag == input.ExternalSystemOriginatorFlag ||
                    (this.ExternalSystemOriginatorFlag != null &&
                    this.ExternalSystemOriginatorFlag.Equals(input.ExternalSystemOriginatorFlag))
                ) && 
                (
                    this.ProrateFrom == input.ProrateFrom ||
                    (this.ProrateFrom != null &&
                    this.ProrateFrom.Equals(input.ProrateFrom))
                ) && 
                (
                    this.CalculationBaseAmount == input.CalculationBaseAmount ||
                    (this.CalculationBaseAmount != null &&
                    this.CalculationBaseAmount.Equals(input.CalculationBaseAmount))
                ) && 
                (
                    this.Xxcustom05 == input.Xxcustom05 ||
                    (this.Xxcustom05 != null &&
                    this.Xxcustom05.Equals(input.Xxcustom05))
                ) && 
                (
                    this.Xxcustom03 == input.Xxcustom03 ||
                    (this.Xxcustom03 != null &&
                    this.Xxcustom03.Equals(input.Xxcustom03))
                ) && 
                (
                    this.Xxcustom02 == input.Xxcustom02 ||
                    (this.Xxcustom02 != null &&
                    this.Xxcustom02.Equals(input.Xxcustom02))
                ) && 
                (
                    this.Xxcustom04 == input.Xxcustom04 ||
                    (this.Xxcustom04 != null &&
                    this.Xxcustom04.Equals(input.Xxcustom04))
                ) && 
                (
                    this.Xxcustom01 == input.Xxcustom01 ||
                    (this.Xxcustom01 != null &&
                    this.Xxcustom01.Equals(input.Xxcustom01))
                );
        }

        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.Key != null)
                    hashCode = hashCode * 59 + this.Key.GetHashCode();
                if (this.PromotionID != null)
                    hashCode = hashCode * 59 + this.PromotionID.GetHashCode();
                if (this.PriceDerivationRuleID != null)
                    hashCode = hashCode * 59 + this.PriceDerivationRuleID.GetHashCode();
                if (this.PriceDerivationRuleEligibilityID != null)
                    hashCode = hashCode * 59 + this.PriceDerivationRuleEligibilityID.GetHashCode();
                if (this.ReasonCode != null)
                    hashCode = hashCode * 59 + this.ReasonCode.GetHashCode();
                if (this.PreviousPrice != null)
                    hashCode = hashCode * 59 + this.PreviousPrice.GetHashCode();
                if (this.Percent != null)
                    hashCode = hashCode * 59 + this.Percent.GetHashCode();
                if (this.Amount != null)
                    hashCode = hashCode * 59 + this.Amount.GetHashCode();
                if (this.CalculationMethodCode != null)
                    hashCode = hashCode * 59 + this.CalculationMethodCode.GetHashCode();
                if (this.AdjustmentMethodCode != null)
                    hashCode = hashCode * 59 + this.AdjustmentMethodCode.GetHashCode();
                if (this.NewPrice != null)
                    hashCode = hashCode * 59 + this.NewPrice.GetHashCode();
                if (this.EligibilityTypeCode != null)
                    hashCode = hashCode * 59 + this.EligibilityTypeCode.GetHashCode();
                if (this.ExtendedAmountBeforeModification != null)
                    hashCode = hashCode * 59 + this.ExtendedAmountBeforeModification.GetHashCode();
                if (this.ExtendedAmountAfterModification != null)
                    hashCode = hashCode * 59 + this.ExtendedAmountAfterModification.GetHashCode();
                if (this.AppliedQuantity != null)
                    hashCode = hashCode * 59 + this.AppliedQuantity.GetHashCode();
                if (this.TriggerSequenceNumber != null)
                    hashCode = hashCode * 59 + this.TriggerSequenceNumber.GetHashCode();
                if (this.ReasonDescription != null)
                    hashCode = hashCode * 59 + this.ReasonDescription.GetHashCode();
                if (this.ExtraAmount != null)
                    hashCode = hashCode * 59 + this.ExtraAmount.GetHashCode();
                if (this.RoundingAmount != null)
                    hashCode = hashCode * 59 + this.RoundingAmount.GetHashCode();
                if (this.ExternalSystemOriginatorFlag != null)
                    hashCode = hashCode * 59 + this.ExternalSystemOriginatorFlag.GetHashCode();
                if (this.ProrateFrom != null)
                    hashCode = hashCode * 59 + this.ProrateFrom.GetHashCode();
                if (this.CalculationBaseAmount != null)
                    hashCode = hashCode * 59 + this.CalculationBaseAmount.GetHashCode();
                if (this.Xxcustom05 != null)
                    hashCode = hashCode * 59 + this.Xxcustom05.GetHashCode();
                if (this.Xxcustom03 != null)
                    hashCode = hashCode * 59 + this.Xxcustom03.GetHashCode();
                if (this.Xxcustom02 != null)
                    hashCode = hashCode * 59 + this.Xxcustom02.GetHashCode();
                if (this.Xxcustom04 != null)
                    hashCode = hashCode * 59 + this.Xxcustom04.GetHashCode();
                if (this.Xxcustom01 != null)
                    hashCode = hashCode * 59 + this.Xxcustom01.GetHashCode();
                return hashCode;
            }
        }

        /// <summary>
        /// To validate all properties of the instance
        /// </summary>
        /// <param name="validationContext">Validation context</param>
        /// <returns>Validation Result</returns>
        IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
        {
            yield break;
        }
    }

}
