Refactor scheduler and settings UI
This commit is contained in:
@@ -56,7 +56,6 @@ type Configuration struct {
|
||||
PricelistID *uint `gorm:"index" json:"pricelist_id,omitempty"`
|
||||
WarehousePricelistID *uint `gorm:"index" json:"warehouse_pricelist_id,omitempty"`
|
||||
CompetitorPricelistID *uint `gorm:"index" json:"competitor_pricelist_id,omitempty"`
|
||||
BOMID *uint64 `gorm:"column:bom_id;index" json:"bom_id,omitempty"`
|
||||
DisablePriceRefresh bool `gorm:"default:false" json:"disable_price_refresh"`
|
||||
OnlyInStock bool `gorm:"default:false" json:"only_in_stock"`
|
||||
PriceUpdatedAt *time.Time `gorm:"type:timestamp" json:"price_updated_at,omitempty"`
|
||||
|
||||
@@ -139,19 +139,6 @@ func (VendorPartnumberSeen) TableName() string {
|
||||
return "qt_vendor_partnumber_seen"
|
||||
}
|
||||
|
||||
type BOM struct {
|
||||
ID uint64 `gorm:"column:id;primaryKey;autoIncrement" json:"id"`
|
||||
ExternalBOMID string `gorm:"column:external_bom_id;size:255;not null;index:uq_qt_bom_source_external,unique" json:"external_bom_id"`
|
||||
SourceSystem string `gorm:"column:source_system;size:100;not null;index:uq_qt_bom_source_external,unique" json:"source_system"`
|
||||
Payload *string `gorm:"column:payload;type:json" json:"payload,omitempty"`
|
||||
CreatedAt time.Time `gorm:"column:created_at;autoCreateTime" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime" json:"updated_at"`
|
||||
}
|
||||
|
||||
func (BOM) TableName() string {
|
||||
return "qt_bom"
|
||||
}
|
||||
|
||||
// StockIgnoreRule is deprecated and kept for backward compatibility only.
|
||||
// New logic uses VendorPartnumberSeen.is_ignored.
|
||||
type StockIgnoreRule struct {
|
||||
|
||||
@@ -24,7 +24,6 @@ func AllModels() []interface{} {
|
||||
&LotBundle{},
|
||||
&LotBundleItem{},
|
||||
&VendorPartnumberSeen{},
|
||||
&BOM{},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
16
internal/models/scheduler.go
Normal file
16
internal/models/scheduler.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
type SchedulerRun struct {
|
||||
JobName string `gorm:"column:job_name;primaryKey;size:100" json:"job_name"`
|
||||
LastStartedAt *time.Time `gorm:"column:last_started_at" json:"last_started_at,omitempty"`
|
||||
LastFinishedAt *time.Time `gorm:"column:last_finished_at" json:"last_finished_at,omitempty"`
|
||||
LastStatus string `gorm:"column:last_status;size:20;not null;default:'idle'" json:"last_status"`
|
||||
LastError string `gorm:"column:last_error;type:text" json:"last_error,omitempty"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime" json:"updated_at"`
|
||||
}
|
||||
|
||||
func (SchedulerRun) TableName() string {
|
||||
return "qt_scheduler_runs"
|
||||
}
|
||||
Reference in New Issue
Block a user