diff --git a/src/main/java/com/rit/whatsapp/handler/StudentMenuHandler.java b/src/main/java/com/rit/whatsapp/handler/StudentMenuHandler.java index 99eff2f..c6dbc0b 100644 --- a/src/main/java/com/rit/whatsapp/handler/StudentMenuHandler.java +++ b/src/main/java/com/rit/whatsapp/handler/StudentMenuHandler.java @@ -113,13 +113,27 @@ public class StudentMenuHandler { break; case "student_contact_department": - messageService.sendMessage(phoneNumber, "Contact Department is currently under development. Please check back later!"); + messageService.sendMessage(phoneNumber, "❌ No such Faculty mentor is assigned."); + sendMainMenu(phoneNumber); + break; + + case "student_academic_calendar": + messageService.sendMessage(phoneNumber, "❌ Academic calendar is not updated yet."); + sendMainMenu(phoneNumber); + break; + + case "student_exam_schedule": + messageService.sendMessage(phoneNumber, "❌ Exam schedule is not updated yet."); + sendMainMenu(phoneNumber); + break; + + case "student_circulars": + messageService.sendMessage(phoneNumber, "❌ Circulars & Notices are not updated yet."); sendMainMenu(phoneNumber); break; default: - messageService.sendMessage(phoneNumber, "You selected an option that is currently under development. Please check back later!"); - // Resend main menu + messageService.sendMessage(phoneNumber, "❌ Details are not updated yet."); sendMainMenu(phoneNumber); break; } diff --git a/src/main/java/com/rit/whatsapp/util/MessageFormatter.java b/src/main/java/com/rit/whatsapp/util/MessageFormatter.java index d97070e..d77318d 100644 --- a/src/main/java/com/rit/whatsapp/util/MessageFormatter.java +++ b/src/main/java/com/rit/whatsapp/util/MessageFormatter.java @@ -438,6 +438,21 @@ public class MessageFormatter { } } + boolean hasAnyCat1Marks = false; + if (targetArray != null && targetArray.size() > 0) { + for (JsonNode subject : targetArray) { + String co1 = subject.has("co1") ? subject.get("co1").asText().trim() : ""; + if (!co1.isEmpty() && !co1.equalsIgnoreCase("N/A") && !co1.equalsIgnoreCase("null")) { + hasAnyCat1Marks = true; + break; + } + } + } + + if (!hasAnyCat1Marks) { + return "📈 *CAT 1 MARKS REPORT*\n\n❌ CAT-1 marks are not updated yet."; + } + if (targetArray != null && targetArray.size() > 0) { for (JsonNode subject : targetArray) { String code = subject.has("code") ? subject.get("code").asText() : ""; @@ -484,6 +499,21 @@ public class MessageFormatter { } } + boolean hasAnyCat2Marks = false; + if (targetArray != null && targetArray.size() > 0) { + for (JsonNode subject : targetArray) { + String co2 = subject.has("co2") ? subject.get("co2").asText().trim() : ""; + if (!co2.isEmpty() && !co2.equalsIgnoreCase("N/A") && !co2.equalsIgnoreCase("null")) { + hasAnyCat2Marks = true; + break; + } + } + } + + if (!hasAnyCat2Marks) { + return "📈 *CAT 2 MARKS REPORT*\n\n❌ CAT-2 marks are not updated yet."; + } + if (targetArray != null && targetArray.size() > 0) { for (JsonNode subject : targetArray) { String code = subject.has("code") ? subject.get("code").asText() : ""; @@ -530,6 +560,21 @@ public class MessageFormatter { } } + boolean hasAnyCat3Marks = false; + if (targetArray != null && targetArray.size() > 0) { + for (JsonNode subject : targetArray) { + String co3 = subject.has("co3") ? subject.get("co3").asText().trim() : ""; + if (!co3.isEmpty() && !co3.equalsIgnoreCase("N/A") && !co3.equalsIgnoreCase("null")) { + hasAnyCat3Marks = true; + break; + } + } + } + + if (!hasAnyCat3Marks) { + return "📈 *CAT 3 MARKS REPORT*\n\n❌ CAT-3 marks are not updated yet."; + } + if (targetArray != null && targetArray.size() > 0) { for (JsonNode subject : targetArray) { String code = subject.has("code") ? subject.get("code").asText() : ""; diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 74664a7..548579b 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -18,4 +18,4 @@ spring.jpa.hibernate.ddl-auto=update # Encryption Secret for Passcodes (Must be 16, 24, or 32 bytes) bot.encryption.secret=12345678901234567890123456789012 -whatsapp.api-token=EAAc3Wjql00oBSQ81I5DWheuPhMzkFAYq7IceC6K8ButfwnlDDiDnehYdCbTHZCCLcI2X8Ejj2GYuZBgZAI4rFJcu8qegpud0UJQsw1oMKOZCiNeWHhVVbyGOgwhfH6WeLiX3Tl5rN3qnkfDIDEXNcp4P2WpOguSrjzVrkysmVhyYBb9mAnXDWtXRZCu6zJdZALTzXiWjgUXRCdQmD0IjluLkURg5TioRAhqZBzP18GdNeYP3oYwuogNlODQhi7G3Hfq5bsfu5X2rqIUM95lcDjK0EZB0IgZDZD +whatsapp.api-token=EAAc3Wjql00oBSYnCGsx7aUPvhT4zXSbuH5XREbSdaNwqihp0Sf7HJUC8KnzdxCexSjSzAGjuZB5CDCi5qF2gu8LmgqNv6hZA1hXuPkRA3N26d6Uoo5ZAvOCl4vEqZBPuL9tmmRuck3tqkck4ltNczYSGsf4TYxZB9m57CnLZCiRgDX8FS8mNtXLrG6uIwcZAWp4x46YDhTxttqH68fwXONvltayCrmcuD2TnBDMQHS2IwyGDboR3JYlypHApZC25DsElG5ZAfP0DNcV6eYIzc0TZBW34KQ