package entities

import (
	"time"

	"gorm.io/gorm"
)

type LayingTransferTarget struct {
	Id                          uint           `gorm:"primaryKey"`
	LayingTransferId            uint           `gorm:"index;not null"`
	TargetProjectFlockKandangId uint           `gorm:"not null"`
	TotalQty                    float64        `gorm:"type:numeric(15,3);default:0;not null"`        // FIFO STOCKABLE field
	TotalUsed                   float64        `gorm:"type:numeric(15,3);default:0;not null"`        // FIFO STOCKABLE field
	ProductWarehouseId          *uint          `gorm:""`
	Note                        string         `gorm:"type:text"`
	CreatedAt                   time.Time      `gorm:"autoCreateTime"`
	UpdatedAt                   time.Time      `gorm:"autoUpdateTime"`
	DeletedAt                   gorm.DeletedAt `gorm:"index"`

	LayingTransfer            *LayingTransfer      `gorm:"foreignKey:LayingTransferId;references:Id"`
	TargetProjectFlockKandang *ProjectFlockKandang `gorm:"foreignKey:TargetProjectFlockKandangId;references:Id"`
	ProductWarehouse          *ProductWarehouse    `gorm:"foreignKey:ProductWarehouseId;references:Id"`
}

