mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 21:41:55 +00:00
31 lines
1.3 KiB
Go
31 lines
1.3 KiB
Go
package entities
|
|
|
|
import (
|
|
"database/sql"
|
|
"time"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type Expense struct {
|
|
Id uint64 `gorm:"primaryKey;autoIncrement"`
|
|
ReferenceNumber string `gorm:"type:varchar(50);uniqueIndex"`
|
|
SupplierId uint64 `gorm:""`
|
|
Category string `gorm:"type:varchar(50);not null"`
|
|
PoNumber string `gorm:"type:varchar(50)"`
|
|
DocumentPath sql.NullString `gorm:"type:json"`
|
|
RealizationDocumentPath sql.NullString `gorm:"type:json;column:realization_document_path"`
|
|
RealizationDate time.Time `gorm:"type:date;column:realization_date"`
|
|
TransactionDate time.Time `gorm:"type:date;not null"`
|
|
Notes string `gorm:"type:text;column:notes"`
|
|
CreatedBy uint64 `gorm:""`
|
|
CreatedAt time.Time `gorm:"autoCreateTime"`
|
|
UpdatedAt time.Time `gorm:"autoUpdateTime"`
|
|
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
|
|
|
Supplier *Supplier `gorm:"foreignKey:SupplierId;references:Id"`
|
|
CreatedUser *User `gorm:"foreignKey:CreatedBy;references:Id"`
|
|
Nonstocks []ExpenseNonstock `gorm:"foreignKey:ExpenseId;references:Id"`
|
|
LatestApproval *Approval `gorm:"-" json:"latest_approval,omitempty"`
|
|
}
|