You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.4 KiB
57 lines
1.4 KiB
package cli
|
|
|
|
import (
|
|
"fmt"
|
|
"marmic/servicetrade-toolbox/internal/api"
|
|
"marmic/servicetrade-toolbox/internal/ui"
|
|
"marmic/servicetrade-toolbox/internal/utils"
|
|
)
|
|
|
|
func HandleNotifications(session *api.Session) {
|
|
for {
|
|
ui.ClearScreen()
|
|
fmt.Println("Notifications Menu:")
|
|
fmt.Println("1. View Notifications")
|
|
fmt.Println("2. Mark Notification as Read")
|
|
fmt.Println("3. Delete Notification")
|
|
fmt.Println("4. Back to Main Menu")
|
|
|
|
choice, err := utils.GetUserChoice(4)
|
|
if err != nil {
|
|
ui.DisplayError("Invalid input:", err)
|
|
utils.PressEnterToContinue()
|
|
continue
|
|
}
|
|
switch choice {
|
|
case 1:
|
|
viewNotifications(session)
|
|
case 2:
|
|
markNotificationAsRead(session)
|
|
case 3:
|
|
deleteNotification(session)
|
|
case 4:
|
|
return
|
|
}
|
|
}
|
|
}
|
|
|
|
func viewNotifications(session *api.Session) {
|
|
ui.ClearScreen()
|
|
fmt.Println("Viewing notifications...")
|
|
// TODO: Implement notification viewing logic using the API
|
|
utils.PressEnterToContinue()
|
|
}
|
|
|
|
func markNotificationAsRead(session *api.Session) {
|
|
ui.ClearScreen()
|
|
fmt.Println("Marking notification as read...")
|
|
// TODO: Implement marking notification as read logic using the API
|
|
utils.PressEnterToContinue()
|
|
}
|
|
|
|
func deleteNotification(session *api.Session) {
|
|
ui.ClearScreen()
|
|
fmt.Println("Deleting notification...")
|
|
// TODO: Implement notification deletion logic using the API
|
|
utils.PressEnterToContinue()
|
|
}
|
|
|