package shared

import "gitea.maximumdirect.net/eric/notarius/internal/framework/contracts"

type ReferenceSlotDescriptions struct {
	Glossary string
	Party    string
	Players  string
	Roster   string
}

var referenceMediaTypes = []string{
	"application/json",
	"application/x-yaml",
	"application/yaml",
	"text/markdown",
	"text/plain",
}

func ReferenceMediaTypes() []string {
	return append([]string(nil), referenceMediaTypes...)
}

func ReferenceSlots(descriptions ReferenceSlotDescriptions) []contracts.ReferenceSlot {
	return contracts.CloneReferenceSlots([]contracts.ReferenceSlot{
		{
			Name:               "glossary",
			Description:        descriptions.Glossary,
			AcceptedMediaTypes: ReferenceMediaTypes(),
		},
		{
			Name:               "party",
			Description:        descriptions.Party,
			AcceptedMediaTypes: ReferenceMediaTypes(),
		},
		{
			Name:               "players",
			Description:        descriptions.Players,
			AcceptedMediaTypes: ReferenceMediaTypes(),
		},
		{
			Name:               "roster",
			Description:        descriptions.Roster,
			AcceptedMediaTypes: ReferenceMediaTypes(),
		},
	})
}
