package models

import (
	"time"
)

type CartItem struct {
	ID        uint      `json:"id" gorm:"primaryKey"`
	UserID    uint      `json:"user_id" gorm:"not null;uniqueIndex:idx_user_item"`
	ItemID    uint      `json:"item_id" gorm:"not null;uniqueIndex:idx_user_item"`
	Quantity  float64   `json:"quantity" gorm:"not null;default:1"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`

	Item Item `json:"item" gorm:"foreignKey:ItemID"`
}
