diff --git a/assets/main.css b/assets/main.css index 26ff67d..a9fccff 100644 --- a/assets/main.css +++ b/assets/main.css @@ -365,6 +365,16 @@ section.special { padding: 25px 10px; } +section.mi .row { + width: 100%; + display: flex; + gap: 10px; +} + +section.mi .row input[type=checkbox] { + margin-right: 0; +} + .loading span.error { top: 40px; position: absolute; diff --git a/components/new/details.vue b/components/new/details.vue index 8de2afe..d5ef5ac 100644 --- a/components/new/details.vue +++ b/components/new/details.vue @@ -161,9 +161,17 @@ @save="addFee" /> -<section class="form radios"> +<section class="form inputs mi"> <h3>Mortgage Insurance</h3> -<p>N/A</p> +<div class="row"> + <input checked type="radio" name="mi"/><label>Manual %</label> + <input type="checkbox" :value="loans[sel].mi.rate" + @change="e => $emit('toggle:manualMIMonthly')" /> + <label>monthly</label> +</div> +<div class="row"> +<input @input="e => $emit('update:manualMI', stripPerc(e))" /> +</div> </section> <section class="form inputs"> @@ -290,6 +298,8 @@ export default { 'update:hazard', 'update:taxEscrow', 'update:tax', + 'update:manualMI', + 'toggle:manualMIMonthly', 'continue' ], diff --git a/components/new/new.vue b/components/new/new.vue index fa89345..e79813e 100644 --- a/components/new/new.vue +++ b/components/new/new.vue @@ -48,6 +48,9 @@ class="bi bi-plus" viewBox="0 0 16 16"> <path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 @update:hazard="(h) => loans[sel].hazard = h" @update:taxEscrow="(t) => loans[sel].taxEscrow = t" @update:tax="(t) => loans[sel].tax = t" + @update:manualMI="perc => loans[sel].mi.rate = perc" + @toggle:manualMIMonthly= + "() => loans[sel].mi.monthly = !loans[sel].mi.monthly" @continue="generate" /> <loan-summary v-if="hash == '#new/summary'" @@ -83,7 +86,7 @@ const example = { pud: true, // Property under development zip: '', fees: [], - mi: {} + mi: {monthly: false, rate: 0} } // The default loans on a new estimate diff --git a/components/new/summary.vue b/components/new/summary.vue index a5a9d5d..b3ac6a1 100644 --- a/components/new/summary.vue +++ b/components/new/summary.vue @@ -17,7 +17,7 @@ <section class="form inputs"> <button>Save Estimate</button> -<button>Generage PDF</button> +<button>Generate PDF</button> </section> </div> diff --git a/skouter.go b/skouter.go index 8e2ad7a..d1811da 100644 --- a/skouter.go +++ b/skouter.go @@ -101,16 +101,17 @@ type Loan struct { } type MI struct { - Type string - Label string - Lender string - Rate float32 - Premium float32 - Upfront float32 - FiveYearTotal float32 - InitialAllInPremium float32 - InitialAllInRate float32 - InitialAmount float32 + Type string `json:"user"` + Label string `json:"label"` + Lender string `json:"lender"` + Rate float32 `json:"rate"` + Premium float32 `json:"premium"` + Upfront float32 `json:"upfront"` + Monthly bool `json:"monthly"` + FiveYearTotal float32 `json:"fiveYearTotal"` + InitialAllInPremium float32 `json:"initialAllInPremium"` + InitialAllInRate float32 `json:"initialAllInRate"` + InitialAmount float32 `json:"initialAmount"` } type Result struct {