package provision

import (
	"sub2api-cn-relay-manager/internal/host/sub2api"
	"sub2api-cn-relay-manager/internal/reconcile"
	"sub2api-cn-relay-manager/internal/store/sqlite"
)

type ReconcileRequest = reconcile.Request
type ReconcileResult = reconcile.Result

func NewReconcileService(store *sqlite.DB, host sub2api.HostAdapter) *reconcile.Service {
	return reconcile.NewService(store, host)
}

func accountIDFromProbeSummary(summaryJSON string) (string, error) {
	return reconcile.AccountIDFromProbeSummary(summaryJSON)
}

func diffManagedResources(stored []sqlite.ManagedResource, snapshot sub2api.ManagedResourceSnapshot) (int, int) {
	return reconcile.DiffManagedResources(stored, snapshot)
}

func deriveHealthyAccessStatus(closureType string) string {
	return reconcile.DeriveHealthyAccessStatus(closureType)
}
