Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InterestRateForwardDebtPriceMappingProcessor updated to handle 'Percentage' quoteUnits [5.x.x] - Release #3244

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# _Mapping Update - InterestRateForwardDebtPriceMappingProcessor updated to handle 'Percentage' quoteUnits_

_Background_

The price of bond forwards is captured as a monetary value whereas it should be a decimal/percentage. Even if the value in FpML was 'Percentage', the CDM representation value did not accurately represent this, causing misinterpretations.

_What is being released?_

- An update to the **InterestRateForwardDebtPriceMappingProcessor** code to fix the described issue. This change, would correct the interpretation by dividing the current monetary value by 100, when the *quoteUnits* corresponds to the XML value '*Percentage*'.
- The **bond-fwd-generic-ex01.xml** and **bond-fwd-generic-ex02.xml** samples have been updated as the files were using the value 'Percent' but the correct value according to the enum should be 'Percentage'


_Review directions_

In Rosetta, select the Textual Browser and inspect each of the changes identified above.

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

# _CDM Model - CapacityUnit Enum_

_Background_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,13 @@ private Map<Path, List<Mapping>> findMappings(List<Mapping> mappings, Path synon

private void addPrice(Path genenicProductPath, PriceQuantityBuilder priceQuantityBuilder, Path quotePath, List<Mapping> quoteMappings) {
Mapping valueMapping = getNonNullMapping(quoteMappings, quotePath.addElement("value")).orElse(null);
Mapping quoteUnitsMapping = getNonNullMapping(quoteMappings, quotePath.addElement("quoteUnits")).orElse(null);

if (isPriceNotation(quotePath, quoteMappings) && valueMapping != null) {
BigDecimal rate = new BigDecimal(String.valueOf(valueMapping.getXmlValue()));
if (quoteUnitsMapping != null && String.valueOf(quoteUnitsMapping.getXmlValue()).equals("Percentage")){
rate = rate.divide(BigDecimal.valueOf(100));
}
UnitType.UnitTypeBuilder unitType = toCurrencyUnitType(genenicProductPath);
PriceTypeEnum priceType = PriceTypeEnum.ASSET_PRICE;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
<quote>
<value>72.6600701</value>
<measureType>PriceNotation</measureType>
<quoteUnits>Percent</quoteUnits>
<quoteUnits>Percentage</quoteUnits>
</quote>
<quote>
<value>1</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
<quote>
<value>52.6600701</value>
<measureType>PriceNotation</measureType>
<quoteUnits>Percent</quoteUnits>
<quoteUnits>Percentage</quoteUnits>
</quote>
<quote>
<value>1</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
"priceQuantity" : [ {
"price" : [ {
"value" : {
"value" : 72.6600701,
"value" : 0.726600701,
"unit" : {
"currency" : {
"value" : "JPY"
Expand Down Expand Up @@ -293,7 +293,7 @@
}
},
"meta" : {
"globalKey" : "cd963b24"
"globalKey" : "8de01a3e"
}
} ]
} ],
Expand Down Expand Up @@ -394,10 +394,10 @@
}
} ],
"meta" : {
"globalKey" : "6b5f1e74"
"globalKey" : "3c625b8e"
}
},
"meta" : {
"globalKey" : "6b5f1e74"
"globalKey" : "3c625b8e"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
"priceQuantity" : [ {
"price" : [ {
"value" : {
"value" : 52.6600701,
"value" : 0.526600701,
"unit" : {
"currency" : {
"value" : "JPY"
Expand Down Expand Up @@ -293,7 +293,7 @@
}
},
"meta" : {
"globalKey" : "f9474587"
"globalKey" : "d5cb17dd"
}
} ]
} ],
Expand Down Expand Up @@ -394,10 +394,10 @@
}
} ],
"meta" : {
"globalKey" : "1163f6d6"
"globalKey" : "8ffc3b2c"
}
},
"meta" : {
"globalKey" : "1163f6d6"
"globalKey" : "8ffc3b2c"
}
}
Loading