package com.MedInsuranceV2.Version20.Insurance;
 // உங்கள் package name ஐ மாற்றவும்

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.ui.Model;

@Controller
public class InsurancePlanController {

//    @GetMapping("/newInsurancePlans")
//    public String showNewInsurancePlans() {
//        return "newInsurancePlans"; // newInsurancePlans.jsp ஐ ரெண்டர் செய்யும்
//    }

    // paymentGateway பக்கத்திற்கு amount ஐ அனுப்பும் endpoint
    @GetMapping("/paymentGateway")
    public String showPaymentGateway(@RequestParam("amount") double amount, Model model) {
        // 'amount' என்ற parameter-ஐ URL இலிருந்து பெற்று, அதை model-க்கு சேர்க்கிறது
        // இது paymentGateway.jsp பக்கத்தில் கிடைக்கும்
        model.addAttribute("premiumAmount", amount);
        return "paymentGateway"; // paymentGateway.jsp ஐ ரெண்டர் செய்யும்
    }

//    @GetMapping("/medicalInsurance")
//    public String backToMedicalInsurance() {
//        return "medicalInsurance"; // medicalInsurance.jsp (உள்ளது என்று கருதுகிறோம்)
//    }
//    
//
//    @GetMapping("/home")
//    public String goToHome() {
//        return "home"; // home.jsp (உள்ளது என்று கருதுகிறோம்)
//    }
//
//    @GetMapping("/logout")
//    public String logout() {
//        // Logout logic here (e.g., invalidate session)
//        return "redirect:/login"; // அல்லது உங்கள் login page
//    }
}