package repo

import (
	"context"
	"time"

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

type ManualBackupRepo interface {
	Create(ctx context.Context, backup *entity.ManualBackup) error
	Save(ctx context.Context, backup *entity.ManualBackup) error
	Load(ctx context.Context, clusterID, backupID string, includeDeleted bool) (*entity.ManualBackup, error)
	Delete(ctx context.Context, clusterID, backupID string) error
	ExistsUndeletedBySharedPool(ctx context.Context, sharedPoolID string) (bool, error)

	SetStatus(ctx context.Context, clusterID, backupID string, status string) error
	AddExecutedAction(ctx context.Context, clusterID, backupID string, action string) (added bool, err error)

	ListPendingLifecycleRuleRecycles(ctx context.Context, olderThan time.Duration) ([]*entity.ManualBackup, error)
	ListUndeletedSucceeded(ctx context.Context) ([]*entity.ManualBackup, error)
}
