mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 21:41:55 +00:00
28 lines
797 B
Go
28 lines
797 B
Go
package entities
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type Purchase struct {
|
|
Id uint `gorm:"primaryKey;autoIncrement"`
|
|
PrNumber string `gorm:"not null"`
|
|
PoNumber *string
|
|
PoDate *time.Time
|
|
SupplierId uint `gorm:"not null"`
|
|
CreditTerm *int
|
|
DueDate *time.Time
|
|
GrandTotal float64 `gorm:"type:numeric(15,3);default:0"`
|
|
Notes *string
|
|
CreatedAt time.Time `gorm:"autoCreateTime"`
|
|
UpdatedAt time.Time `gorm:"autoUpdateTime"`
|
|
DeletedAt *time.Time `gorm:"index"`
|
|
CreatedBy uint `gorm:"not null"`
|
|
|
|
// Relations
|
|
Supplier Supplier `gorm:"foreignKey:SupplierId;references:Id"`
|
|
Items []PurchaseItem `gorm:"foreignKey:PurchaseId"`
|
|
CreatedUser User `gorm:"foreignKey:CreatedBy;references:Id"`
|
|
LatestApproval *Approval `gorm:"-" json:"-"`
|
|
}
|