mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-20 02:42:11 +00:00
bd62b6d8ad
Extend ProtectionRollup with a tri-state VerifyIntent (verified / stale / unknown) plus LastVerifiedAt, derived at read-time from the existing recovery_points.verified column. Stale means: a successful backup exists but no verification-bearing point has landed within BackupVerifyStaleWindow (7d, package-level constant for the MVP). Both fields are omitempty so existing rollup snapshot consumers see no shape change until they opt into the verify loop. The SQL ListRollups path projects verified into the filtered CTE and folds MAX(CASE WHEN verified=1 THEN ts_ms END) into the per-subject aggregate. The in-memory BuildRollupsFromPoints mirrors the same logic via the new ComputeVerifyIntentAt helper so mock mode and the persisted store agree.
63 lines
1.9 KiB
Go
63 lines
1.9 KiB
Go
package recovery
|
|
|
|
import "github.com/rcourtman/pulse-go-rewrite/internal/recovery/model"
|
|
|
|
// Re-export the recovery model types/constants from a dependency-minimal package so
|
|
// other packages (notably internal/mock) can reference the canonical JSON shapes
|
|
// without importing the full recovery store/manager (which depends on config).
|
|
|
|
type Provider = model.Provider
|
|
|
|
const (
|
|
ProviderProxmoxPVE Provider = model.ProviderProxmoxPVE
|
|
ProviderProxmoxPBS Provider = model.ProviderProxmoxPBS
|
|
ProviderProxmoxPMG Provider = model.ProviderProxmoxPMG
|
|
ProviderKubernetes Provider = model.ProviderKubernetes
|
|
ProviderTrueNAS Provider = model.ProviderTrueNAS
|
|
ProviderDocker Provider = model.ProviderDocker
|
|
ProviderAgent Provider = model.ProviderAgent
|
|
ProviderHostAgent Provider = model.ProviderHostAgent
|
|
)
|
|
|
|
type Kind = model.Kind
|
|
|
|
const (
|
|
KindSnapshot Kind = model.KindSnapshot
|
|
KindBackup Kind = model.KindBackup
|
|
KindOther Kind = model.KindOther
|
|
)
|
|
|
|
type Mode = model.Mode
|
|
|
|
const (
|
|
ModeSnapshot Mode = model.ModeSnapshot
|
|
ModeLocal Mode = model.ModeLocal
|
|
ModeRemote Mode = model.ModeRemote
|
|
)
|
|
|
|
type Outcome = model.Outcome
|
|
|
|
const (
|
|
OutcomeSuccess Outcome = model.OutcomeSuccess
|
|
OutcomeWarning Outcome = model.OutcomeWarning
|
|
OutcomeFailed Outcome = model.OutcomeFailed
|
|
OutcomeRunning Outcome = model.OutcomeRunning
|
|
OutcomeUnknown Outcome = model.OutcomeUnknown
|
|
)
|
|
|
|
type ExternalRef = model.ExternalRef
|
|
type RecoveryPoint = model.RecoveryPoint
|
|
type RecoveryPointDisplay = model.RecoveryPointDisplay
|
|
type ProtectionRollup = model.ProtectionRollup
|
|
type ListPointsOptions = model.ListPointsOptions
|
|
type PointsSeriesBucket = model.PointsSeriesBucket
|
|
type PointsFacets = model.PointsFacets
|
|
|
|
type VerifyIntent = model.VerifyIntent
|
|
|
|
const (
|
|
VerifyIntentVerified VerifyIntent = model.VerifyIntentVerified
|
|
VerifyIntentStale VerifyIntent = model.VerifyIntentStale
|
|
VerifyIntentUnknown VerifyIntent = model.VerifyIntentUnknown
|
|
)
|