package reservedcapacitytemplate

import (
	"context"

	globalngv1 "github.com/tidbcloud/tidb-management-service/api/spec/global/nextgen/v1"
	"github.com/tidbcloud/tidb-management-service/nextgen-global-service/domain/entity"
	"github.com/tidbcloud/tidb-management-service/utilities/bizerr"
)

type Filter struct {
	Ids            []uint64
	OrganizationId uint64
	Status         globalngv1.ReservedCapacityTemplate_Status
	Scope          globalngv1.ReservedCapacityTemplate_Scope
	PageSize       uint32
	Page           uint32
	ShowDeleted    bool
}

//go:generate go run go.uber.org/mock/mockgen@latest -source=$GOFILE -package=mock_$GOPACKAGE -destination=./mock_$GOPACKAGE/mock_$GOFILE
type Repo interface {
	Create(ctx context.Context, template *entity.ReservedCapacityTemplate) bizerr.BizError
	Load(ctx context.Context, id uint64, showDeleted bool) (*entity.ReservedCapacityTemplate, bizerr.BizError)
	Query(ctx context.Context, filter *Filter) ([]*entity.ReservedCapacityTemplate, uint32, bizerr.BizError)
	UpdateStatus(
		ctx context.Context,
		id uint64,
		status globalngv1.ReservedCapacityTemplate_Status,
	) (*entity.ReservedCapacityTemplate, bizerr.BizError)
	Delete(ctx context.Context, id uint64) bizerr.BizError
}
