Identified the need for separate Career and College Profile editors

This commit is contained in:
Josh 2025-07-21 18:36:25 +00:00
parent 94129495b8
commit 976ca69bfa
4 changed files with 11 additions and 10 deletions

View File

@ -48,6 +48,7 @@ const CareerOnboarding = ({ nextStep, prevStep, data, setData, finishNow }) => {
setCareerObj(navCareerObj);
localStorage.setItem('selectedCareer', JSON.stringify(navCareerObj));
setData(prev => ({
...prev,
career_name : navCareerObj.title,

View File

@ -434,6 +434,8 @@ useEffect(() => {
setData(prev => ({
...prev,
interest_rate,
loan_term,
tuition: chosenTuition,
program_length: chosenProgramLength
}));

View File

@ -1,6 +1,7 @@
import React from 'react';
// Hypothetical Button component from your UI library
import { Button } from '../ui/button.js'; // Adjust path if needed
import { data } from 'autoprefixer';
/**
* Helper to format numeric fields for display.
@ -126,6 +127,8 @@ function ReviewPage({
<div><strong>Loan Deferral Until Graduation?:</strong> {formatYesNo(collegeData.loan_deferral_until_graduation)}</div>
<div><strong>Annual Financial Aid:</strong> {formatNum(collegeData.annual_financial_aid)}</div>
<div><strong>Existing College Debt:</strong> {formatNum(collegeData.existing_college_debt)}</div>
<div><strong>Loan Interest Rate:</strong>{formatNum(data.interest_rate)}</div>
<div><strong>Loan Term (yrs):</strong>{formatNum(data.loan_term)}</div>
<div><strong>Extra Monthly Payment:</strong> {formatNum(collegeData.extra_payment)}</div>
<div><strong>Expected Graduation:</strong> {collegeData.expected_graduation || 'N/A'}</div>
<div><strong>Expected Salary:</strong> {formatNum(collegeData.expected_salary)}</div>

View File

@ -120,6 +120,7 @@ const {
// Student-loan config ----------------------------------------
studentLoanAmount: _studentLoanAmount = 0,
existing_college_debt: _existingCollegeDebt = 0,
interestRate: _interestRate = 5,
loanTerm: _loanTerm = 10,
loanDeferralUntilGraduation = false,
@ -172,6 +173,7 @@ const additionalIncome = num(_additionalIncome);
const extraPayment = num(_extraPayment);
const studentLoanAmount = num(_studentLoanAmount);
const existingCollegeDebt = num(_existingCollegeDebt);
const interestRate = num(_interestRate);
const loanTerm = num(_loanTerm);
const isProgrammeActive =
@ -316,18 +318,11 @@ function simulateDrawdown(opts){
/***************************************************
* 5) LOAN PAYMENT (if not deferring)
***************************************************/
const initialLoanPrincipal = studentLoanAmount + existingCollegeDebt;
let monthlyLoanPayment = loanDeferralUntilGraduation
? 0
: calculateLoanPayment(studentLoanAmount, interestRate, loanTerm);
// Log the initial loan info:
console.log("Initial loan payment setup:", {
studentLoanAmount,
interestRate,
loanTerm,
loanDeferralUntilGraduation,
monthlyLoanPayment
});
: calculateLoanPayment(initialLoanPrincipal, interestRate, loanTerm);
/***************************************************
* 6) SETUP FOR THE SIMULATION LOOP