make a savings-goals.html(Savings Goals:Setting and tracking of various saving objectives with progress reports.). It should take inputs and record.
AccountController.java:
package com.weathGuardian.controller;

import com.weathGuardian.models.Account;
import com.weathGuardian.Service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/accounts")
public class AccountController {

    private final AccountService accountService;

    @Autowired
    public AccountController(AccountService accountService) {
        this.accountService = accountService;
    }

    @PostMapping
    public ResponseEntity<Account> createAccount(@RequestBody Account account) {
        accountService.createAccount(account);
        return new ResponseEntity<>(account, HttpStatus.CREATED);
    }

    @GetMapping("/{id}")
    public ResponseEntity<Account> getAccountById(@PathVariable Long id) {
        Account account = accountService.getAccountById(id);
        if (account != null) {
            return new ResponseEntity<>(account, HttpStatus.OK);
        } else {
            return new ResponseEntity<>(HttpStatus.NOT_FOUND);
        }
    }

    @GetMapping
    public ResponseEntity<List<Account>> getAllAccounts() {
        List<Account> accounts = accountService.getAllAccounts();
        // Assuming you'd fetch all accounts from service
        return new ResponseEntity<>(accounts, HttpStatus.OK);
    }
}BudgetController.java:
package com.weathGuardian.controller;

import com.weathGuardian.models.Budget;
import com.weathGuardian.Service.BudgetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/budgets")
public class BudgetController {

    private final BudgetService budgetService;

    @Autowired
    public BudgetController(BudgetService budgetService) {
        this.budgetService = budgetService;
    }

    @PostMapping
    public ResponseEntity<Budget> createBudget(@RequestBody Budget budget) {
        budgetService.createBudget(budget);
        return new ResponseEntity<>(budget, HttpStatus.CREATED);
    }

    @GetMapping("/{id}")
    public ResponseEntity<Budget> getBudgetById(@PathVariable Long id) {
        Budget budget = budgetService.getBudgetById(id);
        if (budget != null) {
            return new ResponseEntity<>(budget, HttpStatus.OK);
        } else {
            return new ResponseEntity<>(HttpStatus.NOT_FOUND);
        }
    }

    @GetMapping
    public ResponseEntity<List<Budget>> getAllBudgets() {
        List<Budget> budgets = budgetService.getAllBudgets();
        return new ResponseEntity<>(budgets, HttpStatus.OK);
    }

    @DeleteMapping("/{id}")
    public ResponseEntity<Void> deleteBudget(@PathVariable Long id) {
        budgetService.deleteBudget(id);
        return new ResponseEntity<>(HttpStatus.NO_CONTENT);
    }
}TransactionController.java:
package com.weathGuardian.controller;

import com.weathGuardian.models.Transaction;
import com.weathGuardian.models.User;
import com.weathGuardian.Service.TransactionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

@Controller
@RequestMapping("/dashboard")
public class TransactionController {

    private final TransactionService transactionService;

    @Autowired
    public TransactionController(TransactionService transactionService) {
        this.transactionService = transactionService;
    }

    @GetMapping
    public String dashboard(Model model) {
        User currentUser = getCurrentUser();
        List<Transaction> transactions = transactionService.getAllTransactions();
        String budgetStatus = calculateBudgetStatus();
        String remainingBudget = calculateRemainingBudget();
        List<SavingsGoal> savingsGoals = getSavingsGoals();

        model.addAttribute("currentUser", currentUser);
        model.addAttribute("transactions", transactions);
        model.addAttribute("budgetStatus", budgetStatus);
        model.addAttribute("remainingBudget", remainingBudget);
        model.addAttribute("savingsGoals", savingsGoals);

        return "dashboard"; // Corresponds to dashboard.html in templates directory
    }

    @PostMapping("/update-savings-goal")
    public String updateSavingsGoal(@RequestParam("goalName") String goalName,
                                    @RequestParam("amount") double amount,
                                    Model model) {
        // Logic to update savings goal - you can integrate this with your existing service
        // For demonstration, let's assume updating a mock savings goal
        SavingsGoal updatedGoal = new SavingsGoal(goalName, amount);
        model.addAttribute("updatedGoal", updatedGoal);

        // Refresh dashboard with updated data
        return "redirect:/dashboard";
    }

    // Replace with actual logic to get current user
    private User getCurrentUser() {
        return new User(); // Example return
    }

    // Example methods to calculate budget status and remaining budget
    private String calculateBudgetStatus() {
        return "Good"; // Example return
    }

    private String calculateRemainingBudget() {
        return "$1000"; // Example return
    }

    // Example method to get savings goals
    private List<SavingsGoal> getSavingsGoals() {
        List<SavingsGoal> goals = new ArrayList<>();
        goals.add(new SavingsGoal("Goal 1", 500));
        goals.add(new SavingsGoal("Goal 2", 1000));
        return goals;
    }

    // Static inner class for mock savings goal
    private static class SavingsGoal {
        private String goalName;
        private double amount;

        public SavingsGoal(String goalName, double amount) {
            this.goalName = goalName;
            this.amount = amount;
        }

        public String getGoalName() {
            return goalName;
        }

        public void setGoalName(String goalName) {
            this.goalName = goalName;
        }

        public double getAmount() {
            return amount;
        }

        public void setAmount(double amount) {
            this.amount = amount;
        }
    }
}