Skip to content

Commit

Permalink
[6 Dev] STORY-3174: Enhanced commodity classification mapping (finos#…
Browse files Browse the repository at this point in the history
…2804)

* 5.x.x oil physical leg fwd (#63)

* Add FpML 5.13 test pack

* Separate incomplete processes

# Conflicts:
#	rosetta-source/src/main/resources/cdm-sample-files/fpml-5-13/processes/execution-advice/expectations.json

* Separate incomplete products

* Update expectations

* Update expectations

* Update release note

* Update ingestions.json

* Fix release note

* Remove unused imports

* Add commodity classification mappings

* Remove unused files related to the CDM Portal

* Add release note

* Re-add unreleased release note

* Fix licence scanning

* Update expectations

* Update expectations

* Add samples

* Formatting

* Update expectations
# Conflicts:
#	rosetta-source/src/main/resources/cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/expectations.json
#	rosetta-source/src/main/resources/cdm-sample-files/fpml-5-13/incomplete-products/commodity-derivatives/expectations.json
#	rosetta-source/src/main/resources/mapping-analytics/fpml-5-10-incomplete-products-commodity-derivatives-aggregated-mapping-failure-report.csv
#	rosetta-source/src/main/resources/result-json-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex22-physical-gas-option-multiple-expiration.json
#	rosetta-source/src/main/resources/result-json-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex23-physical-power-option-daily-expiration-efet.json
#	rosetta-source/src/main/resources/result-json-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex29-physical-eu-emissions-option.json
#	rosetta-source/src/main/resources/result-json-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex31-physical-us-emissions-option.json
#	rosetta-source/src/main/resources/result-json-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex47-physical-eu-emissions-option-pred-clearing.json
#	rosetta-source/src/main/resources/result-json-files/fpml-5-13/incomplete-products/commodity-derivatives/com-ex22-physical-gas-option-multiple-expiration.json
#	rosetta-source/src/main/resources/result-json-files/fpml-5-13/incomplete-products/commodity-derivatives/com-ex23-physical-power-option-daily-expiration-efet.json
#	rosetta-source/src/main/resources/result-json-files/fpml-5-13/incomplete-products/commodity-derivatives/com-ex29-physical-eu-emissions-option.json
#	rosetta-source/src/main/resources/result-json-files/fpml-5-13/incomplete-products/commodity-derivatives/com-ex31-physical-us-emissions-option.json
#	rosetta-source/src/main/resources/result-json-files/fpml-5-13/incomplete-products/commodity-derivatives/com-ex47-physical-eu-emissions-option-pred-clearing.json

* Add release note

* Update expectations

* Update PR in release note

* Re-add schema file

* Update RELEASE.md

* Update RELEASE.md

* Update RELEASE.md
  • Loading branch information
hugohills-regnosys authored Mar 21, 2024
1 parent 26ae072 commit dea3313
Show file tree
Hide file tree
Showing 59 changed files with 3,185 additions and 418 deletions.
22 changes: 22 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# _Product Model - FpML Mapping - Commodity Forwards_

_What is being released?_

This release extends the FpML mapping coverage for Commodity Forwards.

- FpML `commoditySwap` legs `coalPhysicalLeg`, `electricityPhysicalLeg`, `environmentalPhysicalLeg`, `gasPhysicalLeg`, `oilPhysicalLeg` have been mapped into the model as a `ForwardPayout` leg
- The `payerPartyReference` and `receiverPartyReference` have been mapped to `ForwardPayout->payerReceiver`
- The `commodity->commodityClassification` reference has been mapped to `ForwardPayout->underlier->commodity->productTaxonomy`

_Review directions_

In Rosetta, open the Translate tab and review the `FpML 5.13 > processes` test pack samples:

- msg-ex69-execution-advice-commodity-swap-classification-new-trade-esma-emir-refit.xml
- msg-ex69-commodity-swap-coal-physical-leg.xml
- msg-ex69-commodity-swap-electricity-physical-leg.xml
- msg-ex69-commodity-swap-environmental-physical-leg.xml
- msg-ex69-commodity-swap-gas-physical-leg.xml

The changes can be reviewed in PR: [#2804](https://github.com/finos/common-domain-model/pull/2804)

# _Infrastructure - FpML 5.13 Ingestion Test Pack_

_What is being released?_
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@

<repoServerHost>oss.sonatype.org</repoServerHost>

<rosetta.bundle.version>10.15.0</rosetta.bundle.version>
<rosetta.bundle.version>10.15.3</rosetta.bundle.version>
<rosetta.code-gen.version>${rosetta.bundle.version}</rosetta.code-gen.version>
<rosetta.dsl.version>9.7.0</rosetta.dsl.version>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package cdm.product.template.processor;

import cdm.product.template.ForwardPayout;
import com.regnosys.rosetta.common.translation.Mapping;
import com.regnosys.rosetta.common.translation.MappingContext;
import com.regnosys.rosetta.common.translation.MappingProcessor;
import com.regnosys.rosetta.common.translation.Path;
import com.regnosys.rosetta.common.util.PathUtils;
import com.rosetta.model.lib.RosettaModelObjectBuilder;
import com.rosetta.model.lib.meta.Reference;
import com.rosetta.model.lib.path.RosettaPath;

import java.util.List;

@SuppressWarnings("unused")
public class CommodityClassificationMetaMappingProcessor extends MappingProcessor {

public CommodityClassificationMetaMappingProcessor(RosettaPath modelPath, List<Path> synonymPaths, MappingContext context) {
super(modelPath, synonymPaths, context);
}

@Override
public void map(Path synonymPath, List<? extends RosettaModelObjectBuilder> builders, RosettaModelObjectBuilder parent) {
List<ForwardPayout.ForwardPayoutBuilder> forwardPayoutBuilders = (List<ForwardPayout.ForwardPayoutBuilder>) builders;
if (!forwardPayoutBuilders.isEmpty()) {
ForwardPayout.ForwardPayoutBuilder forwardPayoutBuilder = forwardPayoutBuilders.get(0);
// create reference
Reference.ReferenceBuilder referenceBuilder =
forwardPayoutBuilder.getOrCreateUnderlier().getOrCreateCommodity().getOrCreateReference();
// create new mapping to make the reference work
Path commodityClassificationSynonymPath =
synonymPath.addElement("commodityClassification", 0).addElement("code", 0);
getMappings().add(createSuccessMapping(commodityClassificationSynonymPath, getModelPath(), referenceBuilder));
}
}

private Mapping createSuccessMapping(Path xmlPath, RosettaPath modelPath, Reference.ReferenceBuilder reference) {
return new Mapping(xmlPath, null, PathUtils.toPath(modelPath), reference, null, true, true, false);
}
}
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
[
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex10-physical-oil-pipeline-crude-wti-floating-price.xml","excludedPaths":0,"externalPaths":49,"outstandingMappings":22,"validationFailures":7,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex11-physical-oil-pipeline-heating-oil-fixed-price.xml","excludedPaths":0,"externalPaths":47,"outstandingMappings":22,"validationFailures":11,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex12-physical-gas-europe-zbt-fixed-price.xml","excludedPaths":0,"externalPaths":46,"outstandingMappings":21,"validationFailures":11,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex13-physical-gas-us-tw-west-texas-pool-floating-price-4-days.xml","excludedPaths":0,"externalPaths":47,"outstandingMappings":19,"validationFailures":10,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex14-physical-gas-europe-ttf-fixed-price.xml","excludedPaths":0,"externalPaths":50,"outstandingMappings":26,"validationFailures":10,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex15-physical-oil-pipeline-crude-wcs-fixed-price.xml","excludedPaths":0,"externalPaths":49,"outstandingMappings":21,"validationFailures":7,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex16-physical-power-us-eei-floating-price.xml","excludedPaths":0,"externalPaths":63,"outstandingMappings":31,"validationFailures":5,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex17-physical-power-uk-gtma-fixed-price.xml","excludedPaths":0,"externalPaths":56,"outstandingMappings":36,"validationFailures":10,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex18-physical-power-us-eei-fixed-price-shaped-volume.xml","excludedPaths":0,"externalPaths":100,"outstandingMappings":80,"validationFailures":10,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex10-physical-oil-pipeline-crude-wti-floating-price.xml","excludedPaths":0,"externalPaths":49,"outstandingMappings":20,"validationFailures":8,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex11-physical-oil-pipeline-heating-oil-fixed-price.xml","excludedPaths":0,"externalPaths":47,"outstandingMappings":20,"validationFailures":12,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex12-physical-gas-europe-zbt-fixed-price.xml","excludedPaths":0,"externalPaths":46,"outstandingMappings":19,"validationFailures":12,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex13-physical-gas-us-tw-west-texas-pool-floating-price-4-days.xml","excludedPaths":0,"externalPaths":47,"outstandingMappings":17,"validationFailures":11,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex14-physical-gas-europe-ttf-fixed-price.xml","excludedPaths":0,"externalPaths":50,"outstandingMappings":24,"validationFailures":11,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex15-physical-oil-pipeline-crude-wcs-fixed-price.xml","excludedPaths":0,"externalPaths":49,"outstandingMappings":19,"validationFailures":8,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex16-physical-power-us-eei-floating-price.xml","excludedPaths":0,"externalPaths":63,"outstandingMappings":29,"validationFailures":6,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex17-physical-power-uk-gtma-fixed-price.xml","excludedPaths":0,"externalPaths":56,"outstandingMappings":34,"validationFailures":11,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex18-physical-power-us-eei-fixed-price-shaped-volume.xml","excludedPaths":0,"externalPaths":100,"outstandingMappings":78,"validationFailures":11,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex19-physical-bullion-forward.xml","excludedPaths":0,"externalPaths":46,"outstandingMappings":30,"validationFailures":4,"qualificationExpectation":{"success":true,"qualifyResults":[],"qualifiableObjectCount":0}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex20-physical-coal-us-fixed-price.xml","excludedPaths":0,"externalPaths":46,"outstandingMappings":23,"validationFailures":8,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex21-physical-power-us-eei-fixed-price-shaped-volume-and-price.xml","excludedPaths":0,"externalPaths":116,"outstandingMappings":96,"validationFailures":10,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex22-physical-gas-option-multiple-expiration.xml","excludedPaths":0,"externalPaths":77,"outstandingMappings":40,"validationFailures":12,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":2}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex23-physical-power-option-daily-expiration-efet.xml","excludedPaths":0,"externalPaths":96,"outstandingMappings":60,"validationFailures":14,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":2}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex20-physical-coal-us-fixed-price.xml","excludedPaths":0,"externalPaths":46,"outstandingMappings":21,"validationFailures":9,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex21-physical-power-us-eei-fixed-price-shaped-volume-and-price.xml","excludedPaths":0,"externalPaths":116,"outstandingMappings":94,"validationFailures":11,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex22-physical-gas-option-multiple-expiration.xml","excludedPaths":0,"externalPaths":77,"outstandingMappings":38,"validationFailures":13,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":2}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex23-physical-power-option-daily-expiration-efet.xml","excludedPaths":0,"externalPaths":96,"outstandingMappings":57,"validationFailures":15,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":2}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex24-weather-index-swap.xml","excludedPaths":0,"externalPaths":80,"outstandingMappings":60,"validationFailures":11,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex25-physical-bullion-forward-average-price.xml","excludedPaths":0,"externalPaths":58,"outstandingMappings":42,"validationFailures":4,"qualificationExpectation":{"success":true,"qualifyResults":[],"qualifiableObjectCount":0}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex26-physical-metal-forward.xml","excludedPaths":0,"externalPaths":55,"outstandingMappings":36,"validationFailures":4,"qualificationExpectation":{"success":true,"qualifyResults":[],"qualifiableObjectCount":0}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex29-physical-eu-emissions-option.xml","excludedPaths":0,"externalPaths":69,"outstandingMappings":31,"validationFailures":13,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":2}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex30-physical-eu-emissions-forward.xml","excludedPaths":0,"externalPaths":53,"outstandingMappings":31,"validationFailures":10,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex31-physical-us-emissions-option.xml","excludedPaths":0,"externalPaths":64,"outstandingMappings":26,"validationFailures":13,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":2}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex29-physical-eu-emissions-option.xml","excludedPaths":0,"externalPaths":69,"outstandingMappings":29,"validationFailures":14,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":2}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex30-physical-eu-emissions-forward.xml","excludedPaths":0,"externalPaths":53,"outstandingMappings":29,"validationFailures":11,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex31-physical-us-emissions-option.xml","excludedPaths":0,"externalPaths":64,"outstandingMappings":24,"validationFailures":14,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":2}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex32-CPD-weather-index-option.xml","excludedPaths":0,"externalPaths":69,"outstandingMappings":34,"validationFailures":7,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex33-physical-bullion-forward-average-price.xml","excludedPaths":0,"externalPaths":58,"outstandingMappings":42,"validationFailures":3,"qualificationExpectation":{"success":true,"qualifyResults":[],"qualifiableObjectCount":0}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex34-gas-put-option-european-floating-strike.xml","excludedPaths":0,"externalPaths":86,"outstandingMappings":31,"validationFailures":9,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Option","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}},
Expand All @@ -30,4 +30,4 @@
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex43-WTI-variance-swap.xml","excludedPaths":0,"externalPaths":59,"outstandingMappings":44,"validationFailures":7,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":1}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex44-index-return-swap-fixed-notional.xml","excludedPaths":0,"externalPaths":63,"outstandingMappings":49,"validationFailures":5,"qualificationExpectation":{"success":true,"qualifyResults":[],"qualifiableObjectCount":0}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex45-ag-variance-swap.xml","excludedPaths":0,"externalPaths":50,"outstandingMappings":35,"validationFailures":5,"qualificationExpectation":{"success":true,"qualifyResults":[],"qualifiableObjectCount":0}},
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex47-physical-eu-emissions-option-pred-clearing.xml","excludedPaths":0,"externalPaths":75,"outstandingMappings":34,"validationFailures":13,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":2}}]
{"fileName":"cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/com-ex47-physical-eu-emissions-option-pred-clearing.xml","excludedPaths":0,"externalPaths":75,"outstandingMappings":32,"validationFailures":14,"qualificationExpectation":{"success":false,"qualifyResults":[],"qualifiableObjectCount":2}}]
Loading

0 comments on commit dea3313

Please sign in to comment.