mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
Merge branch 'dev/ragil-before-sso' into 'development-before-sso'
Dev/ragil before sso See merge request mbugroup/lti-api!44
This commit is contained in:
@@ -7,12 +7,29 @@ import (
|
||||
)
|
||||
|
||||
type Recording struct {
|
||||
Id uint `gorm:"primaryKey"`
|
||||
Name string `gorm:"not null;uniqueIndex:idx_name,where:deleted_at IS NULL"`
|
||||
CreatedBy uint `gorm:"not null"`
|
||||
CreatedAt time.Time `gorm:"autoCreateTime"`
|
||||
UpdatedAt time.Time `gorm:"autoUpdateTime"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
||||
Id uint `gorm:"primaryKey"`
|
||||
ProjectFlockKandangId uint `gorm:"column:project_flock_id;not null;index"`
|
||||
RecordDatetime time.Time `gorm:"column:record_datetime;not null"`
|
||||
RecordDate *time.Time `gorm:"column:record_date"`
|
||||
Ontime int `gorm:"column:ontime;not null;default:0"`
|
||||
Day *int `gorm:"column:day"`
|
||||
TotalDepletion *int `gorm:"column:total_depletion"`
|
||||
CumDepletionRate *float64 `gorm:"column:cum_depletion_rate"`
|
||||
DailyGain *float64 `gorm:"column:daily_gain"`
|
||||
AvgDailyGain *float64 `gorm:"column:avg_daily_gain"`
|
||||
CumIntake *int64 `gorm:"column:cum_intake"`
|
||||
FcrValue *float64 `gorm:"column:fcr_value"`
|
||||
TotalChick *int64 `gorm:"column:total_chick"`
|
||||
DailyDepletionRate *float64 `gorm:"column:daily_depletion_rate"`
|
||||
CumDepletion *int `gorm:"column:cum_depletion"`
|
||||
CreatedBy uint `gorm:"column:created_by"`
|
||||
CreatedAt time.Time `gorm:"autoCreateTime"`
|
||||
UpdatedAt time.Time `gorm:"autoUpdateTime"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
||||
|
||||
CreatedUser User `gorm:"foreignKey:CreatedBy;references:Id"`
|
||||
ProjectFlockKandang *ProjectFlockKandang `gorm:"foreignKey:ProjectFlockKandangId;references:Id"`
|
||||
CreatedUser *User `gorm:"foreignKey:CreatedBy;references:Id"`
|
||||
BodyWeights []RecordingBW `gorm:"foreignKey:RecordingId;references:Id"`
|
||||
Depletions []RecordingDepletion `gorm:"foreignKey:RecordingId;references:Id"`
|
||||
Stocks []RecordingStock `gorm:"foreignKey:RecordingId;references:Id"`
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
package entities
|
||||
|
||||
import "time"
|
||||
|
||||
type RecordingBW struct {
|
||||
Id uint `gorm:"primaryKey"`
|
||||
RecordingId uint `gorm:"column:recording_id;not null;index"`
|
||||
Weight float64 `gorm:"column:weight;not null"`
|
||||
Qty int `gorm:"column:qty;not null;default:1"`
|
||||
Notes *string `gorm:"column:notes"`
|
||||
CreatedAt time.Time `gorm:"autoCreateTime"`
|
||||
UpdatedAt time.Time `gorm:"autoUpdateTime"`
|
||||
|
||||
Recording Recording `gorm:"foreignKey:RecordingId;references:Id"`
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package entities
|
||||
|
||||
type RecordingDepletion struct {
|
||||
Id uint `gorm:"primaryKey"`
|
||||
RecordingId uint `gorm:"column:recording_id;not null;index"`
|
||||
ProductWarehouseId uint `gorm:"column:product_warehouse_id;not null"`
|
||||
Total int64 `gorm:"column:total;not null"`
|
||||
Notes *string `gorm:"column:notes"`
|
||||
|
||||
Recording Recording `gorm:"foreignKey:RecordingId;references:Id"`
|
||||
ProductWarehouse ProductWarehouse `gorm:"foreignKey:ProductWarehouseId;references:Id"`
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package entities
|
||||
|
||||
type RecordingStock struct {
|
||||
Id uint `gorm:"primaryKey"`
|
||||
RecordingId uint `gorm:"column:recording_id;not null;index"`
|
||||
ProductWarehouseId uint `gorm:"column:product_warehouse_id;not null"`
|
||||
Increase *float64 `gorm:"column:increase"`
|
||||
Decrease *float64 `gorm:"column:decrease"`
|
||||
UsageAmount *int64 `gorm:"column:usage_amount"`
|
||||
Notes *string `gorm:"column:notes"`
|
||||
|
||||
Recording Recording `gorm:"foreignKey:RecordingId;references:Id"`
|
||||
ProductWarehouse ProductWarehouse `gorm:"foreignKey:ProductWarehouseId;references:Id"`
|
||||
}
|
||||
Reference in New Issue
Block a user