package runtimeworker

import (
	"testing"

	"github.com/nexuscrm/audit"
	"github.com/nexuscrm/backend/internal/runtimeconfig"
	"github.com/nexuscrm/persistence"
)

func TestProductionWorkerPoolInterpolatesOnlyPlatformCommandParameters(t *testing.T) {
	platform := productionWorkerPool(runtimeconfig.WorkerRole{
		WorkFamily: persistence.RuntimePlatformCommandExecutionWorkFamily,
	})
	if !platform.InterpolateParams {
		t.Fatal("platform-command InterpolateParams = false, want true")
	}

	for _, family := range []string{
		"runtime.record-event-dispatch.v1",
		audit.AuditHistoryFanoutWorkFamily,
	} {
		other := productionWorkerPool(runtimeconfig.WorkerRole{WorkFamily: family})
		if other.InterpolateParams {
			t.Fatalf("%s InterpolateParams = true, want unchanged false default", family)
		}
	}
}
