package repository

import (
	"context"

	"github.com/tidbcloud/tidb-management-service/tidb-mgmt-service/domain/entity"
)

// ProjectMigrationTaskRepo is the persistence interface for ProjectMigrationTask.
//
//go:generate go run go.uber.org/mock/mockgen@latest -source=$GOFILE -package=mock_$GOPACKAGE -destination=./mock_$GOPACKAGE/mock_project_migration_task.go
type ProjectMigrationTaskRepo interface {
	// GetByOrgID returns the migration task for the given org, or (nil, nil) when not found.
	GetByOrgID(ctx context.Context, orgID uint64) (*entity.ProjectMigrationTask, error)
	// GetByID returns the migration task with the given primary key, or (nil, nil) when not found.
	GetByID(ctx context.Context, id uint64) (*entity.ProjectMigrationTask, error)
	// Save creates or updates the task record.
	Save(ctx context.Context, task *entity.ProjectMigrationTask) error
}
