package entity

// ProjectMigrationTaskState is the lifecycle state of a ProjectMigrationTask.
type ProjectMigrationTaskState string

const (
	ProjectMigrationTaskStatePending ProjectMigrationTaskState = "PENDING"
	ProjectMigrationTaskStateRunning ProjectMigrationTaskState = "RUNNING"
	ProjectMigrationTaskStateSucceed ProjectMigrationTaskState = "SUCCEED"
	ProjectMigrationTaskStateFailed  ProjectMigrationTaskState = "FAILED"
)

// ProjectMigration holds the source-to-target project mapping for one migration step.
type ProjectMigration struct {
	// SourceProjectID is the ID of the project whose Starter/Essential clusters will be moved.
	SourceProjectID uint64
	// TargetProjectID is the ID of the destination project (0 means not yet resolved).
	TargetProjectID uint64
	// TargetProjectName is the desired name for a newly-created target project.
	// Used when TargetProjectID == 0.
	TargetProjectName string
}

// ProjectMigrationTask represents the org-level batch migration task stored in the database.
// Each org may have at most one such record.
type ProjectMigrationTask struct {
	ID         uint64
	OrgID      uint64
	State      ProjectMigrationTaskState
	Migrations []*ProjectMigration
}
