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