All Downloads are FREE. Search and download functionalities are using the official Maven repository.

.cdm-java.5.0.1.source-code.product-common-settlement-func.rosetta Maven / Gradle / Ivy

There is a newer version: 6.0.0-dev.92
Show newest version
namespace cdm.product.common.settlement : <"Common product settlement concepts: cash vs physical, non-deliverable, money and cashflow, delivery vs payment.">
version "${project.version}"

import cdm.base.math.*

import cdm.observable.asset.*

func UpdateAmountForEachQuantity: <"Updates all quantities on each price quantity with the new amount.">
	inputs:
		priceQuantity PriceQuantity (0..*) <"List of price quantities to update.">
		amount number (1..1) <"The new amount.">
	output:
		updatedPriceQuantity PriceQuantity (0..*) <"List of price quantities with all quantity amounts updated.">

func UpdateAmountForEachMatchingQuantity: <"Updates any quantity from the list of new quantities if the unit of amount matches.">
	inputs:
		priceQuantity PriceQuantity (1..*) <"List of price quantities to update.">
		change PriceQuantity (1..*)
		direction QuantityChangeDirectionEnum (1..1)
	output:
		updatedPriceQuantity PriceQuantity (1..*) <"List of price quantities with quantity amounts updated.">

	condition DirectionNotIncrease: direction <> QuantityChangeDirectionEnum -> Increase

func RateOptionObservableCondition: <"Implementation for PriceQuantity.RateOptionObservable condition.">
    inputs:
        pq PriceQuantity (1..1)
    output:
        valid boolean (0..1)

    set valid:
        if pq -> observable -> rateOption exists and pq -> price exists
        then
            pq -> price
            extract [ priceType = PriceTypeEnum -> InterestRate and arithmeticOperator exists ]
            all = True




© 2015 - 2025 Weber Informatics LLC | Privacy Policy