chatbot
clear chat
Skip to main content

Compare

GET 

/scenarios/:scenarioId/diff/:otherScenarioId

Compares two scenarios and returns the differences. The resulting payload will contain only the entities that were either created, modified or deleted in/from the other scenario compared to the base scenario.

For example, if the mortgage was changed from a fixed rate mortgage to an interest only one, the payload will look similar to the example below, but with different values.

{
"debts": {
"created": [],
"deleted": [],
"modified": [
{
"base": {
"class": "Mortgage",
"name": "Mortgage",
"description": null,
"source": null,
"amount": "GBP350,000.00",
"startDate": "2019-04-17T16:05:30.729Z",
"endDate": "2045-04-17T16:05:30.729Z",
"balanceAmount": "GBP0.00",
"balanceDate": "2019-04-17T16:05:30.73Z",
"interestOnly": false,
"fixedRate": true,
"fixedRateValue": 0.03,
"variableRateIndex": 0,
"variableRateSpread": 0,
"property": {
"class": "ResidentialProperty",
"name": "House",
"description": null,
"source": null,
"country": "UK",
"region": null,
"state": null,
"city": null,
"value": "GBP500,000.00",
"valuationDate": "2019-04-17T15:59:43.278Z",
"primary": true,
"id": "5d0122ecf4bad40013cf7e65"
},
"id": "5d0122ef77c1550012cbd547"
},
"deltas": {
"interestOnly": {
"base": false,
"other": true
},
"fixedRate": {
"base": true,
"other": false
},
"fixedRateValue": {
"base": 0.03,
"other": 0
},
"variableRateSpread": {
"base": 0,
"other": 0.05
}
}
}
]
}
}

Each household entity contains three arrays.

{
"created": [],
"deleted": [],
"modified": []
}

  • created - contains all the newly created entities (debts in the example above) that are present in the new scenario but are not in the base scenario.
  • deleted - contains the entities that were deleted from the new scenario compared to the base scenario.
  • modified - contains the entities whose values have changed compared to the entities in the base scenario.

Each entity will have the base entity and the deltas which contain the entity's properties that are affected.
In the above example the mortgage in the new scenario has the following changes:

{
"deltas": {
"interestOnly": {
"base": false,
"other": true
},
"fixedRate": {
"base": true,
"other": false
},
"fixedRateValue": {
"base": 0.03,
"other": 0
},
"variableRateSpread": {
"base": 0,
"other": 0.05
}
}
}

  • interestOnly was changed from false to true.
  • fixedRate was changed from false to true.
  • fixedRateValue was changed from 0.03 to 0.
  • variableRateSpread was changed from 0 to 0.05.

  • The changes cumulatively mean that in the new scenario the mortgage was changed from a fixed rate mortgage to be an interest only one.

Request

Path Parameters

    scenarioId stringrequired

    The scenario's id

    otherScenarioId stringrequired

    The other scenario's id

Responses

OK

Schema
    property name* DiffDto
    created object[]

    Entities that were created in the other scenario compared to the base scenario.

    deleted object[]

    Entities that were deleted from the other scenario compared to the base scenario.

    modified object[]

    Entities that were modified in the other scenario compared to the base scenario.

Loading...