package rule

import (
	"cloud.o-forge.io/core/oc-lib/logs"
	"cloud.o-forge.io/core/oc-lib/models/utils"
	"cloud.o-forge.io/core/oc-lib/tools"
)

type ruleMongoAccessor struct {
	utils.AbstractAccessor[*Rule]
}

// New creates a new instance of the ruleMongoAccessor
func NewAccessor(request *tools.APIRequest) *ruleMongoAccessor {
	return &ruleMongoAccessor{
		AbstractAccessor: utils.AbstractAccessor[*Rule]{
			Logger:  logs.CreateLogger(tools.RULE.String()), // Create a logger with the data type
			Request: request,
			Type:    tools.RULE,
			New:     func() *Rule { return &Rule{} },
		},
	}
}
