Refactor scheduler and settings UI

This commit is contained in:
Mikhail Chusavitin
2026-03-07 21:10:20 +03:00
parent 27e33db446
commit b2b2f4774c
23 changed files with 1601 additions and 551 deletions

View File

@@ -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"`

View File

@@ -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 {

View File

@@ -24,7 +24,6 @@ func AllModels() []interface{} {
&LotBundle{},
&LotBundleItem{},
&VendorPartnumberSeen{},
&BOM{},
}
}

View 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"
}