package repo

import (
	"context"
	"time"

	"github.com/tidbcloud/cluster-service-ng/domain/entity"
)

type LightweightRestoreFilter struct {
	ExcludeRestoreID   []string
	IncludeStatuses    []string
	SourceSharedPoolID *string
	TargetSharedPoolID *string
	IncludeDeleted     bool
	StartTime          *time.Time
	ScaleMade          *bool
}

type LightweightRestoreRepo interface {
	// simple crud
	Create(ctx context.Context, restore *entity.LightweightRestore) error
	Save(ctx context.Context, restore *entity.LightweightRestore) error
	Load(ctx context.Context, id string, includeDeleted bool) (*entity.LightweightRestore, error)
	Delete(ctx context.Context, id string) error
	List(ctx context.Context, filter *LightweightRestoreFilter) ([]*entity.LightweightRestore, error)

	// for special cases
	SetStatus(ctx context.Context, restoreID string, status string) error
	SetStatusWithFailure(ctx context.Context, restoreID string, status string, failure *entity.RestoreFailure) error
	AddExecutedAction(ctx context.Context, restoreID string, action string) (added bool, err error)
}
