<?php

require_once './bootstrapMigration.php';

$instanceManager = \Zeedhi\Framework\DependencyInjection\InstanceManager::getInstance();
/** @var \Teknisa\Libs\Service\Migration $migrationService */
$migrationService = $instanceManager->getService('migrationService');

/**
 * $argv[0] => Current file name: "pendentMigration.php"
 * $argv[1] => Organization ID
 * $argv[2] => Repositories information
 */

$pendentMigration = $migrationService->getPendentMigrations($argv[1], $argv[2]);
if(isset($pendentMigration['ERROR']) && !empty($pendentMigration['ERROR'])) {
	$pendentMigration['ERROR'] = utf8_encode($pendentMigration['ERROR']);
}
echo json_encode($pendentMigration);