package automation

import (
	"github.com/prometheus/client_golang/prometheus"
	"github.com/prometheus/client_golang/prometheus/promauto"
)

var (
	approvalActionReplayAttempts = promauto.NewCounterVec(
		prometheus.CounterOpts{
			Name: "nexuscrm_approval_action_replay_attempts_total",
			Help: "Approval lifecycle action replay attempts by lifecycle event and outcome.",
		},
		[]string{"lifecycle_event", "outcome"},
	)

	approvalActionReplayExhausted = promauto.NewCounterVec(
		prometheus.CounterOpts{
			Name: "nexuscrm_approval_action_replay_exhausted_total",
			Help: "Approval lifecycle action replay rows that exhausted retry budget.",
		},
		[]string{"lifecycle_event"},
	)
)

func recordApprovalActionReplayAttempt(lifecycleEvent, outcome string) {
	approvalActionReplayAttempts.WithLabelValues(lifecycleEvent, outcome).Inc()
}

func recordApprovalActionReplayExhausted(lifecycleEvent string) {
	approvalActionReplayExhausted.WithLabelValues(lifecycleEvent).Inc()
}
