Fixes de telefono y apellido de persona

This commit is contained in:
Juan Pablo Vial
2025-05-16 16:35:17 -04:00
parent 16cd29635d
commit 105179b4ed
6 changed files with 29 additions and 12 deletions

View File

@ -2,9 +2,9 @@
namespace Incoviba\Service;
use DateTimeImmutable;
use DateTimeZone;
use InvalidArgumentException;
use OutOfRangeException;
use PDOException;
use Psr\Log\LoggerInterface;
use Incoviba\Common\Ideal;
use Incoviba\Common\Implement\Exception\EmptyRedis;
@ -65,9 +65,9 @@ class Job extends Ideal\Service
*/
public function add(array $configuration): Model\Job
{
$now = (new DateTimeImmutable());
$now = (new DateTimeImmutable('now', new DateTimeZone($_ENV['TZ'] ?? 'America/Santiago')));
$data = [
'id' => $now->getTimestamp(),
'id' => $now->format('Uu'),
'configuration' => $configuration,
'executed' => false,
'created_at' => $now->format('Y-m-d H:i:s'),
@ -129,8 +129,10 @@ class Job extends Ideal\Service
*/
protected function findJob(array $jobs, int $id): int
{
$idx = array_find_key($jobs, fn($job) => $job['id'] === $id);
if ($idx === false) {
$idx = array_find_key($jobs, function($job) use ($id) {
return (int) $job['id'] === $id;
});
if ($idx === null) {
throw new EmptyResult("SELECT * FROM jobs WHERE id = ?");
}
return $idx;