chore: update
This commit is contained in:
@@ -31,7 +31,7 @@ func validateItemID(itemID int) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func validateQuantite(quantite int) error {
|
||||
func validateQuantite(quantite float64) error {
|
||||
if quantite <= 0 {
|
||||
return fmt.Errorf("quantité doit être > 0")
|
||||
}
|
||||
@@ -96,7 +96,8 @@ func validateItemStatus(status string) error {
|
||||
func (d *Database) InsertCommandItemWithClientInfo(
|
||||
commandID int,
|
||||
produit string,
|
||||
productID, quantite int,
|
||||
productID int,
|
||||
quantite float64,
|
||||
prix float64,
|
||||
clientUsername, clientNom, clientPrenom, clientTelephone, deliveryAddress string,
|
||||
) error {
|
||||
@@ -231,7 +232,8 @@ func (d *Database) GetCommandItems(commandID int) ([]map[string]interface{}, err
|
||||
var items []map[string]interface{}
|
||||
|
||||
for rows.Next() {
|
||||
var id, commandID, quantite int
|
||||
var id, commandID int
|
||||
var quantite float64
|
||||
var productID sql.NullInt64 // ✅ FIX: Utiliser NullInt64 pour gérer NULL
|
||||
var produit, clientUsername, clientNom, clientPrenom, clientTelephone string
|
||||
var deliveryAddress, status sql.NullString
|
||||
@@ -345,7 +347,8 @@ func (d *Database) GetCommandItemsByUsername(username string) ([]map[string]inte
|
||||
var items []map[string]interface{}
|
||||
|
||||
for rows.Next() {
|
||||
var id, commandID, quantite int
|
||||
var id, commandID int
|
||||
var quantite float64
|
||||
var productID sql.NullInt64 // ✅ FIX: NullInt64
|
||||
var produit, clientUsername, clientNom, clientPrenom, clientTelephone string
|
||||
var deliveryAddress, status sql.NullString
|
||||
|
||||
Reference in New Issue
Block a user