Desistir venta

This commit is contained in:
2023-12-21 18:45:47 -03:00
parent 93431e41b3
commit 80a6bf1535
8 changed files with 221 additions and 62 deletions

View File

@ -2,6 +2,7 @@
namespace Incoviba\Service;
use DateTimeInterface;
use DateTimeImmutable;
use Incoviba\Common\Implement\Exception\EmptyRedis;
class UF
@ -10,8 +11,11 @@ class UF
public function __construct(protected Redis $redisService, protected Money $moneyService) {}
public function get(DateTimeInterface $date): float
public function get(?DateTimeInterface $date = null): float
{
if ($date === null) {
$date = new DateTimeImmutable();
}
$ufs = [];
try {
$ufs = json_decode($this->redisService->get($this->redisKey), JSON_OBJECT_AS_ARRAY);