package persistence

import (
	"crypto/sha256"
	"encoding/hex"
)

func recordEventRepairFor(lastError string) RuntimePoisonRepair {
	digest := sha256.Sum256([]byte(lastError))
	return RuntimePoisonRepair{
		RowID: "event-poison", ExpectedRetryCount: 3, ExpectedLastErrorSHA256: hex.EncodeToString(digest[:]),
		RepairID: "repair-1", Reason: "Catalog metadata corrected and republished",
	}
}

func recordEventTestScope() RuntimeWorkScope {
	return RuntimeWorkScope{OrgID: "org-test", AppInstallationID: "installation-test", RuntimeCapabilityID: "runtime.records.mutate.v1"}
}
