/** * This file is generated by the SwaggerTSGenerator. * Do not edit. */ /* tslint:disable */ import { BaseModel } from './base-model'; import { SubTypeFactory } from './sub-type-factory'; import { IInstalment, Instalment } from './instalment.model'; import { IClause, Clause } from './clause.model'; import { ICustomClause, CustomClause } from './custom-clause.model'; import { IPredefinedClause, PredefinedClause } from './predefined-clause.model'; import { IBureauLeader, BureauLeader } from './bureau-leader.model'; import { ICedent, Cedent } from './cedent.model'; import { ICoAgreementParty, CoAgreementParty } from './co-agreement-party.model'; import { IContractHolder, ContractHolder } from './contract-holder.model'; import { ICoverHolder, CoverHolder } from './cover-holder.model'; import { IFinancialBroker, FinancialBroker } from './financial-broker.model'; import { IInsuranceBroker, InsuranceBroker } from './insurance-broker.model'; import { IInsured, Insured } from './insured.model'; import { IPricingLeader, PricingLeader } from './pricing-leader.model'; import { IPrimaryInsurer, PrimaryInsurer } from './primary-insurer.model'; import { IProducingBroker, ProducingBroker } from './producing-broker.model'; import { IProducingContractHolder, ProducingContractHolder } from './producing-contract-holder.model'; import { IProducingInsurer, ProducingInsurer } from './producing-insurer.model'; import { IReinsurer, Reinsurer } from './reinsurer.model'; import { ISlipLeader, SlipLeader } from './slip-leader.model'; import { IMoney, Money } from './money.model'; import { InstalmentFrequency } from './enums'; export interface IFee { adjustmentInstalments?: Array; clauses?: Array; containedFees?: Array; creditor?: IBureauLeader | ICedent | ICoAgreementParty | IContractHolder | ICoverHolder | IFinancialBroker | IInsuranceBroker | IInsured | IPricingLeader | IPrimaryInsurer | IProducingBroker | IProducingContractHolder | IProducingInsurer | IReinsurer | ISlipLeader; debtor?: IBureauLeader | ICedent | ICoAgreementParty | IContractHolder | ICoverHolder | IFinancialBroker | IInsuranceBroker | IInsured | IPricingLeader | IPrimaryInsurer | IProducingBroker | IProducingContractHolder | IProducingInsurer | IReinsurer | ISlipLeader; finalAmount?: IMoney; finalAnnualisedAmount?: IMoney; instalmentFrequency?: InstalmentFrequency; instalments?: Array; typeSelector?: string; } export class Fee extends BaseModel implements IFee { static TYPE_SELECTOR = 'Fee'; static ADJUSTMENT_INSTALMENTS_FIELD_NAME = 'adjustmentInstalments'; static CLAUSES_FIELD_NAME = 'clauses'; static CONTAINED_FEES_FIELD_NAME = 'containedFees'; static CREDITOR_FIELD_NAME = 'creditor'; static DEBTOR_FIELD_NAME = 'debtor'; static FINAL_AMOUNT_FIELD_NAME = 'finalAmount'; static FINAL_ANNUALISED_AMOUNT_FIELD_NAME = 'finalAnnualisedAmount'; static INSTALMENT_FREQUENCY_FIELD_NAME = 'instalmentFrequency'; static INSTALMENTS_FIELD_NAME = 'instalments'; static TYPE_SELECTOR_FIELD_NAME = 'typeSelector'; adjustmentInstalments: Array; clauses: Array; containedFees: Array; creditor: BureauLeader | Cedent | CoAgreementParty | ContractHolder | CoverHolder | FinancialBroker | InsuranceBroker | Insured | PricingLeader | PrimaryInsurer | ProducingBroker | ProducingContractHolder | ProducingInsurer | Reinsurer | SlipLeader; debtor: BureauLeader | Cedent | CoAgreementParty | ContractHolder | CoverHolder | FinancialBroker | InsuranceBroker | Insured | PricingLeader | PrimaryInsurer | ProducingBroker | ProducingContractHolder | ProducingInsurer | Reinsurer | SlipLeader; finalAmount: Money; finalAnnualisedAmount: Money; instalmentFrequency: InstalmentFrequency; instalments: Array; typeSelector: string; /** * constructor * @param values Can be used to set a webapi response or formValues to this newly constructed model */ constructor(values?: Partial) { super(); this.typeSelector = Fee.TYPE_SELECTOR; this.adjustmentInstalments = new Array(); this.clauses = new Array(); this.containedFees = new Array(); this.creditor = new BureauLeader(); this.debtor = new BureauLeader(); this.finalAmount = new Money(); this.finalAnnualisedAmount = new Money(); this.instalments = new Array(); if (values) { this.setValues(values); } } /** * set the values. * @param values Can be used to set a webapi response to this newly constructed model */ setValues(values: Partial): void { if (values) { const rawValues = values this.fillModelArray(this, Fee.ADJUSTMENT_INSTALMENTS_FIELD_NAME, rawValues.adjustmentInstalments, Instalment, SubTypeFactory.createSubTypeInstance); this.fillModelArray(this, Fee.CLAUSES_FIELD_NAME, rawValues.clauses, Clause, SubTypeFactory.createSubTypeInstance); this.fillModelArray(this, Fee.CONTAINED_FEES_FIELD_NAME, rawValues.containedFees, Fee, SubTypeFactory.createSubTypeInstance); if (rawValues.creditor && rawValues.creditor.typeSelector && this.creditor.typeSelector !== rawValues.creditor.typeSelector) { this.creditor = SubTypeFactory.createSubTypeInstance(rawValues.creditor) as BureauLeader | Cedent | CoAgreementParty | ContractHolder | CoverHolder | FinancialBroker | InsuranceBroker | Insured | PricingLeader | PrimaryInsurer | ProducingBroker | ProducingContractHolder | ProducingInsurer | Reinsurer | SlipLeader; } this.creditor.setValues(rawValues.creditor); if (rawValues.debtor && rawValues.debtor.typeSelector && this.debtor.typeSelector !== rawValues.debtor.typeSelector) { this.debtor = SubTypeFactory.createSubTypeInstance(rawValues.debtor) as BureauLeader | Cedent | CoAgreementParty | ContractHolder | CoverHolder | FinancialBroker | InsuranceBroker | Insured | PricingLeader | PrimaryInsurer | ProducingBroker | ProducingContractHolder | ProducingInsurer | Reinsurer | SlipLeader; } this.debtor.setValues(rawValues.debtor); this.finalAmount.setValues(rawValues.finalAmount); this.finalAnnualisedAmount.setValues(rawValues.finalAnnualisedAmount); this.instalmentFrequency = this.getValue(rawValues, Fee.INSTALMENT_FREQUENCY_FIELD_NAME); this.fillModelArray(this, Fee.INSTALMENTS_FIELD_NAME, rawValues.instalments, Instalment, SubTypeFactory.createSubTypeInstance); this.typeSelector = this.getValue(rawValues, Fee.TYPE_SELECTOR_FIELD_NAME); } } }