mirror of
https://github.com/corda/corda.git
synced 2025-02-20 09:26:41 +00:00
Added floating leg fixings to the IRS web demo deals page.
This commit is contained in:
parent
f45c3cc214
commit
1c2ae89374
@ -4,6 +4,16 @@ define(['angular', 'utils/semantic', 'services/NodeApi', 'services/HttpErrorHand
|
||||
angular.module('irsViewer').controller('DealController', function DealController($http, $scope, $routeParams, nodeService, httpErrorHandler) {
|
||||
semantic.init($scope, nodeService.isLoading);
|
||||
let handleHttpFail = httpErrorHandler.createErrorHandler($scope);
|
||||
nodeService.getDeal($routeParams.dealId).then((deal) => $scope.deal = deal, handleHttpFail);
|
||||
let decorateDeal = (deal) => {
|
||||
let paymentSchedule = deal.calculation.floatingLegPaymentSchedule;
|
||||
Object.keys(paymentSchedule).map((key, index) => {
|
||||
const sign = paymentSchedule[key].rate.positive ? 1 : -1;
|
||||
paymentSchedule[key].ratePercent = paymentSchedule[key].rate.ratioUnit ? (paymentSchedule[key].rate.ratioUnit.value * 100 * sign).toFixed(5) + "%": "";
|
||||
});
|
||||
|
||||
return deal;
|
||||
};
|
||||
|
||||
nodeService.getDeal($routeParams.dealId).then((deal) => $scope.deal = decorateDeal(deal), handleHttpFail);
|
||||
});
|
||||
});
|
@ -200,6 +200,26 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="center aligned">
|
||||
<td colspan="2">
|
||||
<div class="ui accordion">
|
||||
<div class="title">
|
||||
<i class="dropdown icon"></i>
|
||||
Fixings
|
||||
</div>
|
||||
<div class="content">
|
||||
<table class="ui celled small table">
|
||||
<tbody>
|
||||
<tr class="center aligned" ng-repeat="fixing in deal.calculation.floatingLegPaymentSchedule">
|
||||
<td>{{fixing.fixingDate[0]}}-{{fixing.fixingDate[1]}}-{{fixing.fixingDate[2]}}</td>
|
||||
<td>{{fixing.ratePercent}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user