add revenue now workd through shell command

This commit is contained in:
samantha42
2026-03-24 21:31:01 +01:00
parent 7e2c332e60
commit 63be7b9282
13 changed files with 200 additions and 78 deletions

View File

@@ -1,6 +1,7 @@
package shell
import (
"Portifolio/internal/database"
"Portifolio/internal/model"
"Portifolio/internal/service"
"bufio"
@@ -67,6 +68,12 @@ func AddRevenue(scanner *bufio.Scanner, db *sql.DB) {
fmt.Println(" ✗", err)
return
}
// checking if company exits
_, err = database.GetCompanyByID(db, companyID)
if err != nil {
fmt.Println("No company by that id:", err)
return
}
currencyID, err := promptInt(scanner, " Currency ID: ")
if err != nil {
fmt.Println(" ✗", err)