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.
67 lines
1.5 KiB
67 lines
1.5 KiB
package cli
|
|
|
|
import (
|
|
"fmt"
|
|
"marmic/servicetrade-toolbox/internal/api"
|
|
"marmic/servicetrade-toolbox/internal/ui"
|
|
"marmic/servicetrade-toolbox/internal/utils"
|
|
)
|
|
|
|
func HandleQuotes(session *api.Session) {
|
|
for {
|
|
ui.ClearScreen()
|
|
fmt.Println("Quotes Menu:")
|
|
fmt.Println("1. List Quotes")
|
|
fmt.Println("2. Create Quote")
|
|
fmt.Println("3. Edit Quote")
|
|
fmt.Println("4. Delete Quote")
|
|
fmt.Println("5. Back to Main Menu")
|
|
|
|
choice, err := utils.GetUserChoice(5)
|
|
if err != nil {
|
|
ui.DisplayError("Invalid input:", err)
|
|
utils.PressEnterToContinue()
|
|
continue
|
|
}
|
|
switch choice {
|
|
case 1:
|
|
listQuotes(session)
|
|
case 2:
|
|
createQuote(session)
|
|
case 3:
|
|
editQuote(session)
|
|
case 4:
|
|
deleteQuote(session)
|
|
case 5:
|
|
return
|
|
}
|
|
}
|
|
}
|
|
|
|
func listQuotes(session *api.Session) {
|
|
ui.ClearScreen()
|
|
fmt.Println("Listing quotes...")
|
|
// TODO: Implement quote listing logic using the API
|
|
utils.PressEnterToContinue()
|
|
}
|
|
|
|
func createQuote(session *api.Session) {
|
|
ui.ClearScreen()
|
|
fmt.Println("Creating a new quote...")
|
|
// TODO: Implement quote creation logic using the API
|
|
utils.PressEnterToContinue()
|
|
}
|
|
|
|
func editQuote(session *api.Session) {
|
|
ui.ClearScreen()
|
|
fmt.Println("Editing a quote...")
|
|
// TODO: Implement quote editing logic using the API
|
|
utils.PressEnterToContinue()
|
|
}
|
|
|
|
func deleteQuote(session *api.Session) {
|
|
ui.ClearScreen()
|
|
fmt.Println("Deleting a quote...")
|
|
// TODO: Implement quote deletion logic using the API
|
|
utils.PressEnterToContinue()
|
|
}
|
|
|