change log api to reflect data split into base and extension
This commit is contained in:
@@ -3,14 +3,14 @@ package fertilizing
|
||||
import (
|
||||
"wagfarm-api/assets/fertilizer"
|
||||
"wagfarm-api/database"
|
||||
"wagfarm-api/logs/base"
|
||||
"wagfarm-api/logs/generic"
|
||||
|
||||
"github.com/shopspring/decimal"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type FertilizingLog struct {
|
||||
base.ExtendedLog
|
||||
generic.BaseExtendedLog
|
||||
FertilizerID uint `gorm:"not null"`
|
||||
Fertilizer fertilizer.Fertilizer `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;not null"`
|
||||
Amount float64 `gorm:"not null"` // in units of the fertilizer
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package fertilizing
|
||||
|
||||
import (
|
||||
"wagfarm-api/generic"
|
||||
"wagfarm-api/logs/generic"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func RegisterRoutes(rg *gin.RouterGroup) {
|
||||
generic.RegisterCRUDRoutes(rg.Group("/fertilizer"), generic.DefaultCRUDController[FertilizingLog]())
|
||||
generic.RegisterCRUDRoutes(rg.Group("/fertilizer"), generic.LogCRUDController[FertilizingLog]())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user