package entity import ( "time" ) // ChartReference Chart 引用实体 type ChartReference struct { ID string WorkspaceID string RegistryID string Repository string ChartName string Description string IsEnabled bool CreatedAt time.Time UpdatedAt time.Time } // NewChartReference 创建新 Chart 引用 func NewChartReference(workspaceID, registryID, repository, chartName, description string) *ChartReference { now := time.Now() return &ChartReference{ WorkspaceID: workspaceID, RegistryID: registryID, Repository: repository, ChartName: chartName, Description: description, IsEnabled: true, CreatedAt: now, UpdatedAt: now, } } // Validate 验证 Chart 引用数据 func (c *ChartReference) Validate() error { if c.Repository == "" { return ErrInvalidChart } return nil }