forked from finos/common-domain-model
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
077ab77
commit c3e3b51
Showing
45 changed files
with
462 additions
and
363 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...ta-source/src/main/java/cdm/product/common/settlement/processor/SettlementTypeHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package cdm.product.common.settlement.processor; | ||
|
||
import cdm.product.common.settlement.SettlementTerms; | ||
import cdm.product.common.settlement.SettlementTypeEnum; | ||
import com.regnosys.rosetta.common.translation.Path; | ||
import com.rosetta.model.metafields.FieldWithMetaString; | ||
|
||
import java.util.Optional; | ||
|
||
public class SettlementTypeHelper { | ||
|
||
public void setSettlementType(Path settlementCurrencySynonymPath, SettlementTerms.SettlementTermsBuilder settlementTermsBuilder) { | ||
if (settlementCurrencySynonymPath.endsWith("commoditySwap", "settlementCurrency") | ||
|| settlementCurrencySynonymPath.endsWith("exercise", "settlementCurrency")) { | ||
Optional.ofNullable(settlementTermsBuilder) | ||
.filter(this::settlementCurrencyExists) | ||
.ifPresent(builder -> { | ||
if (builder.getSettlementType() == null) { | ||
builder.setSettlementType(SettlementTypeEnum.CASH); | ||
} | ||
}); | ||
} | ||
} | ||
|
||
private boolean settlementCurrencyExists(SettlementTerms.SettlementTermsBuilder builder) { | ||
return Optional.ofNullable(builder.getSettlementCurrency()).map(FieldWithMetaString::getValue).isPresent(); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...src/main/java/cdm/product/common/settlement/processor/SettlementTypeMappingProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package cdm.product.common.settlement.processor; | ||
|
||
import com.regnosys.rosetta.common.translation.MappingContext; | ||
import com.regnosys.rosetta.common.translation.MappingProcessor; | ||
import com.regnosys.rosetta.common.translation.Path; | ||
import com.rosetta.model.lib.RosettaModelObjectBuilder; | ||
import com.rosetta.model.lib.path.RosettaPath; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
import static cdm.product.common.settlement.SettlementTerms.SettlementTermsBuilder; | ||
|
||
/** | ||
* FpML mapping processor. | ||
*/ | ||
@SuppressWarnings("unused") | ||
public class SettlementTypeMappingProcessor extends MappingProcessor { | ||
|
||
private final SettlementTypeHelper settlementTypeHelper; | ||
|
||
public SettlementTypeMappingProcessor(RosettaPath modelPath, List<Path> synonymPaths, MappingContext context) { | ||
super(modelPath, synonymPaths, context); | ||
this.settlementTypeHelper = new SettlementTypeHelper(); | ||
} | ||
|
||
@Override | ||
public <T> void mapBasic(Path synonymPath, Optional<T> instance, RosettaModelObjectBuilder parent) { | ||
settlementTypeHelper.setSettlementType(synonymPath, (SettlementTermsBuilder) parent); | ||
} | ||
} |
44 changes: 22 additions & 22 deletions
44
...es/cdm-sample-files/fpml-5-10/incomplete-products/commodity-derivatives/expectations.json
Large diffs are not rendered by default.
Oops, something went wrong.
26 changes: 13 additions & 13 deletions
26
...source/src/main/resources/cdm-sample-files/fpml-5-10/products/commodity/expectations.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
[ | ||
{"fileName":"cdm-sample-files/fpml-5-10/products/commodity/com-ex01-gas-swap-daily-delivery-prices-last.xml","excludedPaths":0,"externalPaths":62,"outstandingMappings":4,"validationFailures":5,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Swap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}, | ||
{"fileName":"cdm-sample-files/fpml-5-10/products/commodity/com-ex02-gas-swap-prices-first-day.xml","excludedPaths":0,"externalPaths":60,"outstandingMappings":4,"validationFailures":6,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Swap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}, | ||
{"fileName":"cdm-sample-files/fpml-5-10/products/commodity/com-ex03-gas-swap-prices-last-three-days.xml","excludedPaths":0,"externalPaths":64,"outstandingMappings":5,"validationFailures":6,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Swap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}, | ||
{"fileName":"cdm-sample-files/fpml-5-10/products/commodity/com-ex04-electricity-swap-hourly-off-peak.xml","excludedPaths":0,"externalPaths":62,"outstandingMappings":4,"validationFailures":6,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Swap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}, | ||
{"fileName":"cdm-sample-files/fpml-5-10/products/commodity/com-ex05-gas-v-electricity-spark-spread.xml","excludedPaths":0,"externalPaths":67,"outstandingMappings":4,"validationFailures":7,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Swap_Basis","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}, | ||
{"fileName":"cdm-sample-files/fpml-5-10/products/commodity/com-ex06-gas-call-option.xml","excludedPaths":0,"externalPaths":61,"outstandingMappings":9,"validationFailures":9,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Option","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}, | ||
{"fileName":"cdm-sample-files/fpml-5-10/products/commodity/com-ex07-gas-put-option.xml","excludedPaths":0,"externalPaths":59,"outstandingMappings":9,"validationFailures":9,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Option","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}, | ||
{"fileName":"cdm-sample-files/fpml-5-10/products/commodity/com-ex08-oil-call-option-strip.xml","excludedPaths":0,"externalPaths":64,"outstandingMappings":9,"validationFailures":7,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Option","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}, | ||
{"fileName":"cdm-sample-files/fpml-5-10/products/commodity/com-ex09-oil-put-option-american.xml","excludedPaths":0,"externalPaths":66,"outstandingMappings":11,"validationFailures":7,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Option","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}, | ||
{"fileName":"cdm-sample-files/fpml-5-10/products/commodity/com-ex27-wti-put-option-asian-listedoption-date.xml","excludedPaths":0,"externalPaths":63,"outstandingMappings":11,"validationFailures":6,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Option","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}, | ||
{"fileName":"cdm-sample-files/fpml-5-10/products/commodity/com-ex28-gas-swap-daily-delivery-prices-option-last.xml","excludedPaths":0,"externalPaths":66,"outstandingMappings":6,"validationFailures":5,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Swap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}, | ||
{"fileName":"cdm-sample-files/fpml-5-10/products/commodity/com-ex01-gas-swap-daily-delivery-prices-last.xml","excludedPaths":0,"externalPaths":62,"outstandingMappings":4,"validationFailures":4,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Swap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}, | ||
{"fileName":"cdm-sample-files/fpml-5-10/products/commodity/com-ex02-gas-swap-prices-first-day.xml","excludedPaths":0,"externalPaths":60,"outstandingMappings":4,"validationFailures":5,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Swap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}, | ||
{"fileName":"cdm-sample-files/fpml-5-10/products/commodity/com-ex03-gas-swap-prices-last-three-days.xml","excludedPaths":0,"externalPaths":64,"outstandingMappings":5,"validationFailures":5,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Swap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}, | ||
{"fileName":"cdm-sample-files/fpml-5-10/products/commodity/com-ex04-electricity-swap-hourly-off-peak.xml","excludedPaths":0,"externalPaths":62,"outstandingMappings":4,"validationFailures":5,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Swap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}, | ||
{"fileName":"cdm-sample-files/fpml-5-10/products/commodity/com-ex05-gas-v-electricity-spark-spread.xml","excludedPaths":0,"externalPaths":67,"outstandingMappings":4,"validationFailures":6,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Swap_Basis","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}, | ||
{"fileName":"cdm-sample-files/fpml-5-10/products/commodity/com-ex06-gas-call-option.xml","excludedPaths":0,"externalPaths":61,"outstandingMappings":9,"validationFailures":8,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Option","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}, | ||
{"fileName":"cdm-sample-files/fpml-5-10/products/commodity/com-ex07-gas-put-option.xml","excludedPaths":0,"externalPaths":59,"outstandingMappings":9,"validationFailures":8,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Option","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}, | ||
{"fileName":"cdm-sample-files/fpml-5-10/products/commodity/com-ex08-oil-call-option-strip.xml","excludedPaths":0,"externalPaths":64,"outstandingMappings":9,"validationFailures":6,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Option","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}, | ||
{"fileName":"cdm-sample-files/fpml-5-10/products/commodity/com-ex09-oil-put-option-american.xml","excludedPaths":0,"externalPaths":66,"outstandingMappings":11,"validationFailures":6,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Option","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}, | ||
{"fileName":"cdm-sample-files/fpml-5-10/products/commodity/com-ex27-wti-put-option-asian-listedoption-date.xml","excludedPaths":0,"externalPaths":63,"outstandingMappings":11,"validationFailures":5,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Option","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}, | ||
{"fileName":"cdm-sample-files/fpml-5-10/products/commodity/com-ex28-gas-swap-daily-delivery-prices-option-last.xml","excludedPaths":0,"externalPaths":66,"outstandingMappings":6,"validationFailures":4,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Swap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}, | ||
{"fileName":"cdm-sample-files/fpml-5-10/products/commodity/com-ex39-basket-option-confirmation.xml","excludedPaths":0,"externalPaths":114,"outstandingMappings":96,"validationFailures":4,"qualificationExpectation":{"success":true,"qualifyResults":[],"qualifiableObjectCount":0}}, | ||
{"fileName":"cdm-sample-files/fpml-5-10/products/commodity/com-ex41-oil-asian-barrier-option-strip.xml","excludedPaths":0,"externalPaths":83,"outstandingMappings":29,"validationFailures":9,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Option","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}, | ||
{"fileName":"cdm-sample-files/fpml-5-10/products/commodity/com-ex46-simple-financial-put-option.xml","excludedPaths":0,"externalPaths":62,"outstandingMappings":8,"validationFailures":6,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Option","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}] | ||
{"fileName":"cdm-sample-files/fpml-5-10/products/commodity/com-ex41-oil-asian-barrier-option-strip.xml","excludedPaths":0,"externalPaths":83,"outstandingMappings":29,"validationFailures":8,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Option","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}, | ||
{"fileName":"cdm-sample-files/fpml-5-10/products/commodity/com-ex46-simple-financial-put-option.xml","excludedPaths":0,"externalPaths":62,"outstandingMappings":8,"validationFailures":5,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Option","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}] |
6 changes: 3 additions & 3 deletions
6
...source/src/main/resources/cdm-sample-files/fpml-5-12/products/commodity/expectations.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
[ | ||
{"fileName":"cdm-sample-files/fpml-5-12/products/commodity/com-ex1-gas-swap-daily-delivery-prices-last.xml","excludedPaths":0,"externalPaths":62,"outstandingMappings":4,"validationFailures":5,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Swap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}, | ||
{"fileName":"cdm-sample-files/fpml-5-12/products/commodity/com-ex5-gas-v-electricity-spark-spread.xml","excludedPaths":0,"externalPaths":67,"outstandingMappings":4,"validationFailures":7,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Swap_Basis","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}, | ||
{"fileName":"cdm-sample-files/fpml-5-12/products/commodity/com-ex8-oil-call-option-strip.xml","excludedPaths":0,"externalPaths":64,"outstandingMappings":9,"validationFailures":7,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Option","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}] | ||
{"fileName":"cdm-sample-files/fpml-5-12/products/commodity/com-ex1-gas-swap-daily-delivery-prices-last.xml","excludedPaths":0,"externalPaths":62,"outstandingMappings":4,"validationFailures":4,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Swap_FixedFloat","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}, | ||
{"fileName":"cdm-sample-files/fpml-5-12/products/commodity/com-ex5-gas-v-electricity-spark-spread.xml","excludedPaths":0,"externalPaths":67,"outstandingMappings":4,"validationFailures":6,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Swap_Basis","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}, | ||
{"fileName":"cdm-sample-files/fpml-5-12/products/commodity/com-ex8-oil-call-option-strip.xml","excludedPaths":0,"externalPaths":64,"outstandingMappings":9,"validationFailures":6,"qualificationExpectation":{"success":true,"qualifyResults":[{"qualifiedName":"Commodity_Option","qualifiedObjectClass":"cdm.product.template.EconomicTerms"}],"qualifiableObjectCount":1}}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.