package domaintest

import (
	"time"

	"gitea.dwysokinski.me/twhelp/corev3/internal/domain"
	"github.com/brianvoe/gofakeit/v6"
	"github.com/stretchr/testify/require"
)

type BaseEnnoblementConfig struct {
	VillageID int
}

func NewBaseEnnoblement(tb TestingTB, opts ...func(cfg *BaseEnnoblementConfig)) domain.BaseEnnoblement {
	tb.Helper()

	cfg := &BaseEnnoblementConfig{
		VillageID: RandID(),
	}

	for _, opt := range opts {
		opt(cfg)
	}

	e, err := domain.NewBaseEnnoblement(
		cfg.VillageID,
		RandID(),
		RandID(),
		RandID(),
		RandID(),
		gofakeit.IntRange(1, 10000),
		time.Now(),
	)
	require.NoError(tb, err)

	return e
}
