Revision 8a57f3b03992351f46c4537fd0d9351592278d2b (click the page title to view the current version)

Scotiabank Mortgages

Changes from 8a57f3b03992351f46c4537fd0d9351592278d2b to 9b0d959aea55e085083652864435023cc39f0785
---
title: Family of Scotiabank Mortgages modeled in Clafer
toc: true
...


General concepts

```clafer
abstract Currency : integer

abstract Percentage : integer
    [ this >= 0 && this <= 100 ]
```

Most general concept: Mortgage

```clafer
abstract Mortgage
    valueProposition : string
    term -> MortgageTerm
    xor kind
        open
        closed
    principalMortgageAmount -> Currency
    [ 5000 <= principalMortgageAmount && principalMortgageAmount <= 9999999 ]
    balance -> Currency
    [ balance <= principalMortgageAmount ] 
    [ balance <= principalMortgageAmount ]
    propertyValue -> Currency
    loanToValue -> Percentage
//    [ loanToValue == balance / propertyValue ]
    amortization : integer
    [ 1 <= amortization && amortization <= 30 ]
    xor interestRate
        fixedForTheFullTerm 
        fixedForTheFullTerm
        resetTogetherWithPaymentAmountEachTimeScotiabankPrimeRateChanges
    currentInterestRate -> Percentage
    // [ 0.5 <= currentInterestRate && currentInterestRate <= 25 ]
    currentPayment -> Currency
    xor paymentFrequency
        weekly 
        weekly
        biweekly
        semiMonthly
        monthly
    xor financingAvailable 
    xor financingAvailable
        conventional
        insured
```

```clafer
enum MortgageTerm = sixMonths | oneYear
```

```{.clafer .ide}
```