BE-MiniERP/modules/inventory/models/product_component.go
2025-06-23 11:27:43 +07:00

21 lines
530 B
Go

package models
import "time"
type ProductComponent struct {
ID uint `gorm:"primaryKey" json:"id"`
ProductID uint `json:"product_id"` // Produk utama
Product Product `gorm:"foreignKey:ProductID" json:"product"`
ComponenID uint `json:"componen_id"` // Komponen produk
Component Product `gorm:"foreignKey:ComponenID" json:"component"`
Quantity float64 `json:"quantity"`
Unit string `json:"unit"` // Satuan dari komponen
Note string `json:"note,omitempty"`
CreatedAt time.Time
UpdatedAt time.Time
}