Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/product-id-upi' into product-id-upi
Browse files Browse the repository at this point in the history
# Conflicts:
#	RELEASE.md
  • Loading branch information
hugohills-regnosys committed Nov 14, 2023
2 parents 259bad2 + fafbc74 commit 3a9b677
Show file tree
Hide file tree
Showing 72 changed files with 5,460 additions and 4,102 deletions.
1 change: 1 addition & 0 deletions docs/event-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -890,6 +890,7 @@ type WorkflowStep:
[metadata key]
[rootType]
businessEvent BusinessEvent (0..1)
counterpartyPositionBusinessEvent CounterpartyPositionBusinessEvent (0..1)
proposedEvent EventInstruction (0..1)
rejected boolean (0..1)
approval WorkflowStepApproval (0..*)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,13 @@ private PathValue<EconomicTermsBuilder> getEcTerms(PathValue<TradeStateBuilder>

private PathValue<AssetPayout.AssetPayoutBuilder> getSecPO(PathValue<TradeStateBuilder> ts) {
PathValue<EconomicTermsBuilder> et = getEcTerms(ts);
return new PathValue<>(et.getModelPath().addElement("payout").addElement("securityFinancePayout", 0),
et.getValue().getOrCreatePayout().getOrCreateAssetPayout(0));
return new PathValue<>(et.getModelPath().addElement("collateral").addElement("collateralPortfolio", 0)
.addElement("collateralPosition", 0).addElement("product")
.addElement("contractualProduct").addElement("economicTerms")
.addElement("payout").addElement("assetPayout", 0),
et.getValue().getOrCreateCollateral().getOrCreateCollateralPortfolio(0).getOrCreateValue()
.getOrCreateCollateralPosition(0).getOrCreateProduct().getOrCreateContractualProduct()
.getOrCreateEconomicTerms().getOrCreatePayout().getOrCreateAssetPayout(0));
}

private PathValue<CollateralProvisions.CollateralProvisionsBuilder> getColPro(PathValue<TradeStateBuilder> ts) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
import cdm.event.common.functions.CalculateTransfer;
import cdm.event.common.functions.Create_BusinessEvent;
import cdm.event.common.functions.Create_Return;
import cdm.event.common.metafields.ReferenceWithMetaCollateralPortfolio;
import cdm.event.workflow.EventInstruction;
import cdm.product.collateral.Collateral;
import cdm.product.template.*;
import com.google.common.collect.Iterables;
import com.rosetta.model.lib.RosettaModelObject;
Expand All @@ -21,9 +23,7 @@

import javax.inject.Inject;
import java.time.LocalDate;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -171,7 +171,17 @@ private Optional<Payout> getPayout(BusinessEvent executionBusinessEvent) {
.map(TradableProduct::getProduct)
.map(Product::getContractualProduct)
.map(ContractualProduct::getEconomicTerms)
.map(EconomicTerms::getPayout);
.map(EconomicTerms::getCollateral)
.map(Collateral::getCollateralPortfolio)
.orElse(Collections.emptyList()).stream()
.map(ReferenceWithMetaCollateralPortfolio::getValue)
.map(CollateralPortfolio::getCollateralPosition)
.flatMap(Collection::stream)
.map(CollateralPosition::getProduct)
.map(Product::getContractualProduct)
.map(ContractualProduct::getEconomicTerms)
.map(EconomicTerms::getPayout)
.findFirst();
}

private Optional<Payout> getSecurityPayout(BusinessEvent executionBusinessEvent) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
[
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/Basis-ex01-LIBOR-vs-SOFR.xml","excludedPaths":0,"externalPaths":313,"outstandingMappings":6,"validationFailures":1,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_Basis","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/FRA-ex01.xml","excludedPaths":0,"externalPaths":77,"outstandingMappings":4,"validationFailures":2,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_Fra","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/FRA-ex02.xml","excludedPaths":0,"externalPaths":131,"outstandingMappings":4,"validationFailures":1,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_Fra","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/IRS-ex01-Fixed-Float.xml","excludedPaths":0,"externalPaths":190,"outstandingMappings":8,"validationFailures":3,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/IRS-ex02-Fixed-Float.xml","excludedPaths":0,"externalPaths":347,"outstandingMappings":6,"validationFailures":1,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/IRS-ex03-Fixed-Float-with-Amortizing-Schedule.xml","excludedPaths":0,"externalPaths":344,"outstandingMappings":6,"validationFailures":1,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/IRS-ex04-Fixed-Float-with-Compounding.xml","excludedPaths":0,"externalPaths":426,"outstandingMappings":7,"validationFailures":1,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/IRS-ex05-Fixed-Float-with-Long-Stub.xml","excludedPaths":0,"externalPaths":316,"outstandingMappings":7,"validationFailures":1,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/IRS-ex06-Fixed-Float-Non-Deliverable.xml","excludedPaths":0,"externalPaths":160,"outstandingMappings":8,"validationFailures":11,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat_OIS","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/IRS-ex07-Fixed-Float-Zero-Coupon-BRL-CDI.xml","excludedPaths":0,"externalPaths":186,"outstandingMappings":8,"validationFailures":4,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat_ZeroCoupon","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/IRS-ex08-Fixed-Float-Zero.xml","excludedPaths":0,"externalPaths":204,"outstandingMappings":6,"validationFailures":1,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat_ZeroCoupon","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/IRS-ex09-OIS.xml","excludedPaths":0,"externalPaths":200,"outstandingMappings":6,"validationFailures":1,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat_OIS","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/IRS-ex10-OIS.xml","excludedPaths":0,"externalPaths":200,"outstandingMappings":6,"validationFailures":1,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/IRS-ex11-OIS.xml","excludedPaths":0,"externalPaths":267,"outstandingMappings":6,"validationFailures":1,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat_OIS","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/SWAPTION_TERMINATED_DUE_TO_EXERCISE.xml","excludedPaths":0,"externalPaths":194,"outstandingMappings":6,"validationFailures":1,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"InterestRate_Option_Swaption","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":2}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/SWAP_CREATED_DUE_TO_EXERCISE.xml","excludedPaths":0,"externalPaths":177,"outstandingMappings":6,"validationFailures":1,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/Swaption-ex01.xml","excludedPaths":0,"externalPaths":369,"outstandingMappings":6,"validationFailures":1,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"InterestRate_Option_Swaption","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":2}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/Swaption-ex02.xml","excludedPaths":0,"externalPaths":278,"outstandingMappings":6,"validationFailures":1,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"InterestRate_Option_Swaption","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":2}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/Swaption-ex03-Straddle-Physical-Exercise.xml","excludedPaths":0,"externalPaths":369,"outstandingMappings":6,"validationFailures":1,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"InterestRate_Option_Swaption","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":2}}]
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/Basis-ex01-LIBOR-vs-SOFR.xml","excludedPaths":0,"externalPaths":313,"outstandingMappings":6,"validationFailures":2,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_Basis","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/FRA-ex01.xml","excludedPaths":0,"externalPaths":77,"outstandingMappings":4,"validationFailures":3,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_Fra","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/FRA-ex02.xml","excludedPaths":0,"externalPaths":131,"outstandingMappings":4,"validationFailures":2,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_Fra","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/IRS-ex01-Fixed-Float.xml","excludedPaths":0,"externalPaths":190,"outstandingMappings":8,"validationFailures":4,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/IRS-ex02-Fixed-Float.xml","excludedPaths":0,"externalPaths":347,"outstandingMappings":6,"validationFailures":2,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/IRS-ex03-Fixed-Float-with-Amortizing-Schedule.xml","excludedPaths":0,"externalPaths":344,"outstandingMappings":6,"validationFailures":2,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/IRS-ex04-Fixed-Float-with-Compounding.xml","excludedPaths":0,"externalPaths":426,"outstandingMappings":7,"validationFailures":2,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/IRS-ex05-Fixed-Float-with-Long-Stub.xml","excludedPaths":0,"externalPaths":316,"outstandingMappings":7,"validationFailures":2,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/IRS-ex06-Fixed-Float-Non-Deliverable.xml","excludedPaths":0,"externalPaths":160,"outstandingMappings":8,"validationFailures":12,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat_OIS","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/IRS-ex07-Fixed-Float-Zero-Coupon-BRL-CDI.xml","excludedPaths":0,"externalPaths":186,"outstandingMappings":8,"validationFailures":5,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat_ZeroCoupon","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/IRS-ex08-Fixed-Float-Zero.xml","excludedPaths":0,"externalPaths":204,"outstandingMappings":6,"validationFailures":2,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat_ZeroCoupon","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/IRS-ex09-OIS.xml","excludedPaths":0,"externalPaths":200,"outstandingMappings":6,"validationFailures":2,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat_OIS","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/IRS-ex10-OIS.xml","excludedPaths":0,"externalPaths":200,"outstandingMappings":6,"validationFailures":2,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/IRS-ex11-OIS.xml","excludedPaths":0,"externalPaths":267,"outstandingMappings":6,"validationFailures":2,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat_OIS","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/SWAPTION_TERMINATED_DUE_TO_EXERCISE.xml","excludedPaths":0,"externalPaths":194,"outstandingMappings":6,"validationFailures":2,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"InterestRate_Option_Swaption","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":2}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/SWAP_CREATED_DUE_TO_EXERCISE.xml","excludedPaths":0,"externalPaths":177,"outstandingMappings":6,"validationFailures":2,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/Swaption-ex01.xml","excludedPaths":0,"externalPaths":369,"outstandingMappings":6,"validationFailures":2,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"InterestRate_Option_Swaption","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":2}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/Swaption-ex02.xml","excludedPaths":0,"externalPaths":278,"outstandingMappings":6,"validationFailures":2,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"InterestRate_Option_Swaption","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":2}},
{"fileName":"cdm-sample-files/cme-cleared-confirm-1-17/Swaption-ex03-Straddle-Physical-Exercise.xml","excludedPaths":0,"externalPaths":369,"outstandingMappings":6,"validationFailures":2,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"InterestRate_IRSwap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"InterestRate_Option_Swaption","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":2}}]
Loading

0 comments on commit 3a9b677

Please sign in to comment.