mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-24 15:25:43 +00:00
a0bdc7b23c
✅ DB Schema: product_warehouse entity and migration ✅ Master Data: added filter params to getall APIs 🚧 Pending: stock_logs implementation and adjustment APIs
24 lines
918 B
Go
24 lines
918 B
Go
package entities
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type ProductWarehouse struct {
|
|
Id uint `json:"id" gorm:"primaryKey;autoIncrement"`
|
|
ProductId uint `json:"product_id" gorm:"not null"`
|
|
WarehouseId uint `json:"warehouse_id" gorm:"not null"`
|
|
Quantity int `json:"quantity" gorm:"default:0"`
|
|
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
|
|
UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`
|
|
CreatedBy uint `json:"created_by" gorm:"not null"`
|
|
DeletedAt gorm.DeletedAt `json:"deleted_at" gorm:"index"`
|
|
|
|
// Relations
|
|
Product Product `json:"product,omitempty" gorm:"foreignKey:ProductId;references:Id"`
|
|
Warehouse Warehouse `json:"warehouse,omitempty" gorm:"foreignKey:WarehouseId;references:Id"`
|
|
CreatedUser User `json:"created_user,omitempty" gorm:"foreignKey:CreatedBy;references:Id"`
|
|
}
|