Class ChargeConditionModel

java.lang.Object
com.highdeal.pnr.hci.ChargeConditionModel
All Implemented Interfaces:
XMLMarshallable

public class ChargeConditionModel extends Object implements XMLMarshallable
A ChargeConditionModel represents the information to build a new charge condition.

Warning

The dependentRole attribute must be valued if the charge condition refers a dependent charge.

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:element name="chargeCondition">
   <xs:complexType>
     <xs:sequence>
       <xs:element ref="counterDescription" minOccurs="0" maxOccurs="unbounded"/>
       <xs:element ref="counter" minOccurs="0" maxOccurs="unbounded"/>
       <xs:element ref="parameterSet" minOccurs="0" maxOccurs="1"/>
       <xs:element name="parameterSetChronology" minOccurs="0" maxOccurs="1">
         <xs:complexType>
           <xs:sequence>
             <xs:element ref="chronology" minOccurs="1" maxOccurs="1"/>
           </xs:sequence>
         </xs:complexType>
       </xs:element>
       <xs:element ref="translationInstanceSet" minOccurs="0" maxOccurs="1"/>
       <xs:element name="translationInstanceSetChronology" minOccurs="0" maxOccurs="1">
         <xs:complexType>
           <xs:sequence>
             <xs:element ref="chronology" minOccurs="1" maxOccurs="1"/>
           </xs:sequence>
         </xs:complexType>
       </xs:element>
       <xs:element ref="tierTableInstanceSet" minOccurs="0" maxOccurs="1"/>
       <xs:element name="tierTableInstanceSetChronology" minOccurs="0" maxOccurs="1">
         <xs:complexType>
           <xs:sequence>
             <xs:element ref="chronology" minOccurs="1" maxOccurs="1"/>
           </xs:sequence>
         </xs:complexType>
       </xs:element>
       <xs:element ref="transactionTemplate" minOccurs="0" maxOccurs="1"/>
       <xs:element ref="chargedItemMapping" minOccurs="0" maxOccurs="1"/>
       <xs:element ref="taxParameterSet" minOccurs="0" maxOccurs="unbounded"/>  <!-- Tax settings for this charge condition -->
     </xs:sequence>
     <xs:attribute name="subCode" type="xs:string" use="required"/>
     <xs:attribute name="reference" type="xs:string"/>
     <xs:attribute name="description" type="xs:string"/>
     <xs:attribute name="currency" type="xs:string" use="optional"/>
     <xs:attribute name="multiCurrencies" type="xs:boolean" default="false"/>
     <xs:attribute name="effectiveDate" type="xs:dateTime"/>
     <xs:attribute name="expirationDate" type="xs:dateTime"/>
     <xs:attribute name="lastActivationDate" type="xs:dateTime"/>
     <xs:attribute name="manualActivable" type="xs:boolean" default="false"/>
     <xs:attribute name="dependentRole" type="DependentRoleType" use="optional"/> <!-- Required if the charge condition refers a dependent charge -->
     <xs:attribute name="dependentOfferLevel" type="xs:boolean" default="false"/>
     <xs:attribute name="parentCode" type="xs:string"/>
     <xs:attribute name="parentRef" type="xs:string"/>
     <xs:attribute name="relationshipType" type="RelationShipTypeType" default="client"/>
     <xs:attribute name="operationType" type="ChargeConditionOperationTypeType" default="debit"/>
     <xs:attribute name="adjustmentMode" type="AdjustmentModeType" default="none"/>
     <xs:attribute name="usePreviousDiscountedAmount" type="xs:boolean" use="optional" default="false"/> <!-- Used only if the  attribute dependentRole corresponds a discount -->
   </xs:complexType>
 </xs:element>
<xs:simpleType name="RelationShipTypeType">
   <xs:restriction base="xs:string">
     <xs:enumeration value="client"/>
     <xs:enumeration value="partner"/>
   </xs:restriction>
 </xs:simpleType>
<xs:simpleType name="ChargeConditionOperationTypeType">
   <xs:restriction base="xs:string">
     <xs:enumeration value="debit"/>
     <xs:enumeration value="credit"/>
   </xs:restriction>
 </xs:simpleType>
<xs:simpleType name="AdjustmentModeType">
   <xs:restriction base="xs:string">
     <xs:enumeration value="none"/>
     <xs:enumeration value="merging"/>
     <xs:enumeration value="splitting"/>
   </xs:restriction>
 </xs:simpleType>
<xs:simpleType name="DependentRoleType">
   <xs:restriction base="xs:string">
     <xs:enumeration value="partnerCommission"/>
     <xs:enumeration value="commission"/>
     <xs:enumeration value="sponsorship"/>
     <xs:enumeration value="discount"/>
     <xs:enumeration value="other"/>
  </xs:restriction>
</xs:simpleType>

  • Field Details

    • CLIENT_RELATIONSHIP

      public static final int CLIENT_RELATIONSHIP
      Constant value for a client type business relationship.
      See Also:
    • PARTNER_RELATIONSHIP

      public static final int PARTNER_RELATIONSHIP
      Constant value for a partner type business relationship.
      See Also:
    • DEBIT_OPERATION

      public static final int DEBIT_OPERATION
      Constant value for a debit operation.
      See Also:
    • CREDIT_OPERATION

      public static final int CREDIT_OPERATION
      Constant value for a credit operation.
      See Also:
    • NONE_ADJUSTMENT

      public static final int NONE_ADJUSTMENT
      Constant value for a none adjustment.
      See Also:
    • MERGING_ADJUSTMENT

      public static final int MERGING_ADJUSTMENT
      Constant value for a merging adjustment.
      See Also:
    • SPLITTING_ADJUSTMENT

      public static final int SPLITTING_ADJUSTMENT
      Constant value for a splitting adjustment.
      See Also:
  • Constructor Details

    • ChargeConditionModel

      public ChargeConditionModel()
      Constructs an empty charge condition model
  • Method Details

    • getSubCode

      public String getSubCode()
      Returns the subcode of this charge condition
      Returns:
      This charge condition subcode
      See Also:
    • setSubCode

      public void setSubCode(String code)
      Sets the code for this charge condition
      Parameters:
      code - The subscription code
      See Also:
    • getReference

      public String getReference()
      Returns the reference of this charge condition
      Returns:
      This charge condition reference
      See Also:
    • setReference

      public void setReference(String reference)
      Sets the reference of this charge condition
      Parameters:
      reference - The reference of this charge condition
      See Also:
    • getDescription

      public String getDescription()
      Returns the description of this charge condition
      Returns:
      This charge condition description
      See Also:
    • setDescription

      public void setDescription(String description)
      Sets the description of this charge condition
      Parameters:
      description - The description of this charge condition
      See Also:
    • getCurrencyCode

      public String getCurrencyCode()
      Returns the currency code of this charge condition
      Returns:
      The currency code of this charge condition, or null if it does not define a currency code
      See Also:
    • setCurrencyCode

      public void setCurrencyCode(String currencyCode)
      Sets the currency code of this charge condition
      Parameters:
      currencyCode - The currency code of this charge condition, or null if it does not define a currency code
      See Also:
    • isMultiCurrencies

      public boolean isMultiCurrencies()
      Returns whether the charge condition is multi-currencies
      Returns:
      true if the charge condition is multi-currencies, false otherwise
    • setMultiCurrencies

      public void setMultiCurrencies(boolean multiCurrencies)
      Sets whether this charge condition is multi-currencies
      Parameters:
      multiCurrencies - true if the charge condition is multi-currencies, false otherwise
    • getEffectiveDate

      public Date getEffectiveDate()
      Returns the effective date of this charge condition
      Returns:
      This charge condition effective date
      See Also:
    • setEffectiveDate

      public void setEffectiveDate(Date effectiveDate)
      Sets the effective date of this charge condition
      Parameters:
      effectiveDate - The effective date of this charge condition
      See Also:
    • getExpirationDate

      public Date getExpirationDate()
      Returns the expiration date of this charge condition
      Returns:
      This charge condition expiration date
      See Also:
    • setExpirationDate

      public void setExpirationDate(Date expirationDate)
      Sets the expiration date of this charge condition
      Parameters:
      expirationDate - The expiration date of this charge condition
      See Also:
    • getLastActivationDate

      public Date getLastActivationDate()
      Returns the last activation date of this charge condition
      Returns:
      This charge condition last activation date
      See Also:
    • setLastActivationDate

      public void setLastActivationDate(Date lastActivationDate)
      Sets the last activation date of this charge condition
      Parameters:
      lastActivationDate - The last activation date of this charge condition
      See Also:
    • getCounterDescriptions

      public Vector<CounterDescriptionModel> getCounterDescriptions()
      Returns the list of counterDescriptions
      Returns:
      The list of the associated counterDescriptions
    • getCounters

      public Vector<CounterModel> getCounters()
      Returns the list of CounterModel
      Returns:
      The list of the associated counters
    • isManualActivable

      public boolean isManualActivable()
      Returns true if the charge activation is manually created for this charge condition, else false; This is an informative attribute. This constraint is not verified by the server at the subscription creation.
      Returns:
      true if the charge activation is manually created for this charge condition.
      See Also:
    • setManualActivable

      public void setManualActivable(boolean manualActivable)
      Sets the activation mode for this charge condition
      Parameters:
      manualActivable - the activation mode of this charge condition
      See Also:
    • getDependentRole

      public String getDependentRole()
      Returns the role of this charge condition if it is a dependent (Note: this attribute must be valued if it is a dependent)
      Returns:
      This charge condition dependent role
      See Also:
    • setDependentRole

      public void setDependentRole(String dependentRole)
      Sets the role for this charge condition if it is a dependent (Note: this attribute must be valued if it is a dependent)
      Parameters:
      dependentRole - The role for this charge condition if it is a dependent
      See Also:
    • isUsePreviousDiscountedAmount

      public boolean isUsePreviousDiscountedAmount()
      Gets the base amount to charge the dependent discount
      Returns:
      true if the discount is applied on the previous discounted amount, false if it is applied on the master amount.
    • setUsePreviousDiscountedAmount

      public void setUsePreviousDiscountedAmount(boolean usePreviousDiscountedAmount)
      Sets the base amount on which the discount will be applied
      Parameters:
      usePreviousDiscountedAmount - The base amount
    • isOfferLevelDependent

      public boolean isOfferLevelDependent()
      Gets the level of the dependent charge
      Returns:
      The level of the dependent charge
    • setOfferLevelDependent

      public void setOfferLevelDependent(boolean offerLevel)
      Sets the level of the dependent charge
      Parameters:
      offerLevel - The level of the dependent charge
    • getParentRef

      public String getParentRef()
      Returns the parent reference of this charge condition
      Returns:
      The parent reference of this charge condition
      See Also:
    • setParentRef

      public void setParentRef(String ref)
      Sets the parent reference of this charge condition
      Parameters:
      ref - The parent reference of this charge condition
    • getParentCode

      public String getParentCode()
      Returns the parent code of this charge condition
      Returns:
      The parent code of this charge condition
    • setParentCode

      public void setParentCode(String c)
      Sets the parent code of this charge condition
      Parameters:
      c - The parent code of this charge condition
    • getOffer

      public OfferModel getOffer()
      Returns the offer of this charge condition
      Returns:
      The offer model of this charge condition
    • setOffer

      public void setOffer(OfferModel offer)
      Sets the offer of this charge condition
      Parameters:
      offer - The offer of this charge condition
    • getOfferCondition

      public OfferConditionModel getOfferCondition()
      Returns the offer condition of this charge condition
      Returns:
      The offer condition of this charge condition
    • setOfferCondition

      public void setOfferCondition(OfferConditionModel offerCondition)
      Sets the offer condition of this charge condition
      Parameters:
      offerCondition - The offer condition of this charge condition
    • getParameterSet

      public ParameterSetModel getParameterSet()
      Returns the parameter set model of the charge condition
      Returns:
      The parameter set model of the charge condition
    • setParameterSet

      public void setParameterSet(ParameterSetModel p)
      Sets the parameter set model of the charge condition
      Parameters:
      p - The parameter set model of the charge condition
    • getTranslationInstanceSet

      public TranslationInstanceSetModel getTranslationInstanceSet()
      Returns the translation instance set model of the charge condition
      Returns:
      The translation instance set model of the charge condition
    • setTranslationInstanceSet

      public void setTranslationInstanceSet(TranslationInstanceSetModel t)
      Sets the translation instance set model of the charge condition
      Parameters:
      t - The translation instance set model of the charge condition
    • getTierTableInstanceSet

      public TierTableInstanceSetModel getTierTableInstanceSet()
      Returns the tier table instance set model of the charge condition
      Returns:
      The tier table instance set model of the charge condition
    • setTierTableInstanceSet

      public void setTierTableInstanceSet(TierTableInstanceSetModel t)
      Sets the tier table instance set model of the charge condition
      Parameters:
      t - The tier table instance set model of the charge condition
    • getParameterSetChronology

      public ChronologyModel getParameterSetChronology()
      Returns the parameter set chronology of this charge condition
      Returns:
      All the charge condition parameter sets
    • getTranslationInstanceSetChronology

      public ChronologyModel getTranslationInstanceSetChronology()
      Returns the translation instance set chronology of this charge condition
      Returns:
      All the charge condition translation instance sets
    • getTierTableInstanceSetChronology

      public ChronologyModel getTierTableInstanceSetChronology()
      Returns the tier table instance set chronology of this charge condition
      Returns:
      All the charge condition tier table instance sets
    • getTransactionTemplate

      public TransactionTemplateModel getTransactionTemplate()
      Returns the transaction template of this charge condition
      Returns:
      The transaction template of this charge condition
    • setTransactionTemplate

      public void setTransactionTemplate(TransactionTemplateModel tt)
      Sets the transaction template model of the charge condition
      Parameters:
      tt - The transaction template model of the charge condition
    • getChargedItemMapping

      public ChargedItemMappingModel getChargedItemMapping()
      Returns the charged item mapping of this charge condition
      Returns:
      The charged item mapping of this charged condition
    • setChargedItemMapping

      public void setChargedItemMapping(ChargedItemMappingModel citmm)
      Sets the charged item mapping of the charge condition
      Parameters:
      citmm - The charged item mapping of the charge condition
    • getRelationshipType

      public int getRelationshipType()
      Gets the relationship type of the charge condition.
      Returns:
      The value of relationship type
      See Also:
    • setRelationshipType

      public void setRelationshipType(int type)
      Sets the relationship type of the charge condition
      Parameters:
      type - The value to assign to relationship type
      See Also:
    • getOperationType

      public int getOperationType()
      Gets the operation type of the charge condition
      Returns:
      Thhe value of the operation type
      See Also:
    • setOperationType

      public void setOperationType(int type)
      Sets the operation type of the charge condition
      Parameters:
      type - The value to assign to the operation type
      See Also:
    • getAdjustmentMode

      public int getAdjustmentMode()
      Gets the adjustment mode of the charge condition
      Returns:
      value of adjustment mode.
      See Also:
    • setAdjustmentMode

      public void setAdjustmentMode(int mode)
      Sets the adjustment mode of the charge condition
      Parameters:
      mode - The value to assign to adjustment mode
      See Also:
    • getOfferContextCounters

      public Vector<CounterDescriptionModel> getOfferContextCounters()
      Gets the list of counters that are shared by the offer in offer condition
      Returns:
      The list of offer counters
    • getOfferContextParameters

      public Vector<ParameterModel> getOfferContextParameters(Date date)
      Gets the list of parameters that are shared by the offer in offer condition It firstly looks in the edition context and if null, looks in the context chronology at the specified date.
      Parameters:
      date - The date to look in the chronology
      Returns:
      the list of offer parameters
    • getOfferContextTranslationInstances

      public Vector<TranslationInstanceModel> getOfferContextTranslationInstances(Date date)
      Gets the list of translation instances that are shared by the offer in offer condition; It firstly looks in the edition context and if null, looks in the context chronology at the specified date.
      Parameters:
      date - The date to look in the chronology
      Returns:
      The list of offer instances
    • getOfferContextTierTableInstances

      public Vector<TierTableInstanceModel> getOfferContextTierTableInstances(Date date)
      Gets the list of tier table instances that are shared by the offer in offer condition; It firstly looks in the edition context and if null, looks in the context chronology at the specified date.
      Parameters:
      date - The date to look in the chronology
      Returns:
      The list of offer instances
    • getTaxParameterSets

      public Map<TaxParameterSet.TaxModule,TaxParameterSetModel> getTaxParameterSets()
    • getTaxParameterSet

      public TaxParameterSetModel getTaxParameterSet(TaxParameterSet.TaxModule module)
    • clearTaxParameterSet

      public void clearTaxParameterSet()
    • setTaxParameterSet

      public void setTaxParameterSet(TaxParameterSetModel taxParameterSet)
    • setAttributes

      public void setAttributes(XMLAttributes atts)
      Description copied from interface: XMLMarshallable
      Sets the attributes of the XML representation of the element being processed.
      Specified by:
      setAttributes in interface XMLMarshallable
      Parameters:
      atts - The XML attributes of the current element
    • addChild

      public void addChild(String name, XMLMarshallable child)
      Description copied from interface: XMLMarshallable
      Adds a child to the object, the child representing the marshallable object which must be added to the element.
      Specified by:
      addChild in interface XMLMarshallable
      Parameters:
      name - The name of tag for the child
      child - The child to be added
    • addCharacterData

      public void addCharacterData(String cData)
      Description copied from interface: XMLMarshallable
      Adds character data to the content element.
      Specified by:
      addCharacterData in interface XMLMarshallable
      Parameters:
      cData - The character data to be added
    • marshal

      public void marshal(XMLOutputter output)
      Description copied from interface: XMLMarshallable
      Gives an XML representation of this object, including its children.
      Specified by:
      marshal in interface XMLMarshallable
      Parameters:
      output - The XML output to marshal the object into