Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/finos/common-domain-model
Browse files Browse the repository at this point in the history
…into type-coercions
  • Loading branch information
SimonCockx committed Nov 17, 2023
2 parents 43b8218 + 1724975 commit d4c9267
Show file tree
Hide file tree
Showing 56 changed files with 11,136 additions and 3,546 deletions.
634 changes: 583 additions & 51 deletions RELEASE.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import cdm.base.staticdata.asset.common.ProductIdTypeEnum;
import cdm.base.staticdata.asset.common.ProductIdentifier;
import cdm.base.staticdata.asset.common.ProductTaxonomy;
import cdm.base.staticdata.asset.common.TaxonomySourceEnum;
import com.regnosys.rosetta.common.translation.MappingContext;
import com.regnosys.rosetta.common.translation.MappingProcessor;
import com.regnosys.rosetta.common.translation.MappingProcessorUtils;
Expand All @@ -26,7 +24,6 @@ public void map(Path synonymPath, RosettaModelObjectBuilder builder, RosettaMode
MappingProcessorUtils.getNonNullMappingForModelPath(getMappings(), PathUtils.toPath(getModelPath().newSubPath("value")))
.map(m -> m.getXmlPath())
.ifPresent(xmlPath -> {
//
ProductIdentifier.ProductIdentifierBuilder productIdentifierBuilder = (ProductIdentifier.ProductIdentifierBuilder) parent;
FieldWithMetaString.FieldWithMetaStringBuilder productIdentifierValueBuilder = (FieldWithMetaString.FieldWithMetaStringBuilder) builder;

Expand Down Expand Up @@ -68,8 +65,10 @@ protected ProductIdTypeEnum getSourceEnum(String scheme) {
return ProductIdTypeEnum.RIC;
} else if (scheme.contains("Bloomberg")){
return ProductIdTypeEnum.BBGID;
}else if (scheme.contains("commodity-reference-price")){
} else if (scheme.contains("commodity-reference-price")){
return ProductIdTypeEnum.ISDACRP;
} else if (scheme.contains("iso4914")) {
return ProductIdTypeEnum.UPI;
} else {
return ProductIdTypeEnum.OTHER;
}
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,2 +1,2 @@
[
{"fileName":"cdm-sample-files/fis/isla1.xml","excludedPaths":0,"externalPaths":120,"outstandingMappings":10,"validationFailures":37,"qualificationExpectation":{"success":false,"qualifyResults":[{"qualifiedName":"SecurityLendingAgreement","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"SecurityLendingAgreement","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"SecurityLendingAgreement","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"SecurityLendingAgreement","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"SecurityLendingAgreement","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"SecurityLendingAgreement","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":7}}]
{"fileName":"cdm-sample-files/fis/isla1.xml","excludedPaths":0,"externalPaths":120,"outstandingMappings":10,"validationFailures":37,"qualificationExpectation":{"success":false,"qualifyResults":[{"qualifiedName":"SecuritiesFinance","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"SecuritiesFinance","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"SecuritiesFinance","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"SecuritiesFinance","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"SecuritiesFinance","qualifiedObjectClass":"cdm.product.template.EconomicTerms"},{"qualifiedName":"SecuritiesFinance","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":13}}]
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,45 @@
"markDownFile": "cdm-sample-files/functions/repo-and-bond/shaping.md",
"executableFunctionClass": "cdm.event.common.functions.Create_BusinessEvent",
"nativeFunction": true
},
{
"group": "repo-and-bond",
"name": "Partial Delivery",
"description": "Partial Delivery",
"inputFile": "cdm-sample-files/functions/repo-and-bond/partial-delivery-input.json",
"expectedOutputFile": "cdm-sample-files/functions/repo-and-bond/partial-delivery-output.json",
"markDownFile": "cdm-sample-files/functions/repo-and-bond/partial-delivery.md",
"executableFunctionClass": "cdm.event.common.functions.Create_BusinessEvent",
"nativeFunction": true
},
{
"group": "repo-and-bond",
"name": "Reprice",
"description": "Reprice",
"inputFile": "cdm-sample-files/functions/repo-and-bond/repo-reprice-input.json",
"expectedOutputFile": "cdm-sample-files/functions/repo-and-bond/repo-reprice-output.json",
"markDownFile": "cdm-sample-files/functions/repo-and-bond/repo-reprice.md",
"executableFunctionClass": "cdm.event.common.functions.Create_BusinessEvent",
"nativeFunction": true
},
{
"group": "repo-and-bond",
"name": "Adjustment",
"description": "Adjustment",
"inputFile": "cdm-sample-files/functions/repo-and-bond/repo-adjustment-input.json",
"expectedOutputFile": "cdm-sample-files/functions/repo-and-bond/repo-adjustment-output.json",
"markDownFile": "cdm-sample-files/functions/repo-and-bond/repo-adjustment.md",
"executableFunctionClass": "cdm.event.common.functions.Create_BusinessEvent",
"nativeFunction": true
},
{
"group": "repo-and-bond",
"name": "Substitution",
"description": "Substitution",
"inputFile": "cdm-sample-files/functions/repo-and-bond/repo-substitution-input.json",
"expectedOutputFile": "cdm-sample-files/functions/repo-and-bond/repo-substitution-output.json",
"markDownFile": "cdm-sample-files/functions/repo-and-bond/repo-substitution.md",
"executableFunctionClass": "cdm.event.common.functions.Create_BusinessEvent",
"nativeFunction": true
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -398,7 +398,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -827,7 +827,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -1255,7 +1255,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -572,7 +572,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -996,7 +996,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -1420,7 +1420,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -465,7 +465,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -909,7 +909,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -1358,7 +1358,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -317,7 +317,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -746,7 +746,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -1174,7 +1174,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -503,7 +503,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -908,7 +908,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -1396,7 +1396,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -1825,7 +1825,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down Expand Up @@ -2301,7 +2301,7 @@
}
}, {
"source" : "ISDA",
"productQualifier" : "RepurchaseAgreement"
"productQualifier" : "SecuritiesFinance"
} ],
"economicTerms" : {
"effectiveDate" : {
Expand Down
Loading

0 comments on commit d4c9267

Please sign in to comment.