33 lines
1.3 KiB
Go
33 lines
1.3 KiB
Go
package admission
|
|
|
|
import "context"
|
|
|
|
// CandidateRepository defines the persistence layer for candidates
|
|
type CandidateRepository interface {
|
|
GetCandidateByIDContext(ctx context.Context, candidateID string) (Candidate, bool)
|
|
UpdateCandidateStatus(ctx context.Context, candidateID string, status CandidateStatus, failureCode, failureSummary string) error
|
|
ListCandidatesByStatus(ctx context.Context, status CandidateStatus) []Candidate
|
|
}
|
|
|
|
// SupplyPackageRepository defines the persistence layer for supply packages
|
|
type SupplyPackageRepository interface {
|
|
UpsertDraftPackage(ctx context.Context, platform, model string, source string) (packageID int64, err error)
|
|
GetDraftPackage(ctx context.Context, platform, model string) (DraftPackage, bool)
|
|
}
|
|
|
|
// TestLogger persists admission test run logs.
|
|
type TestLogger interface {
|
|
AppendAdmissionTestLog(ctx context.Context, candidateID, status, failureCode, failureSummary string, testedAt string) error
|
|
}
|
|
|
|
// DraftPackage represents a draft supply package created after admission passes
|
|
type DraftPackage struct {
|
|
PackageID int64 `json:"package_id"`
|
|
Platform string `json:"platform"`
|
|
Model string `json:"model"`
|
|
Status string `json:"status"` // draft, active, deprecated
|
|
Source string `json:"source"`
|
|
CreatedAt string `json:"created_at"`
|
|
Version int64 `json:"version"`
|
|
}
|