fix: dispatch time series updates

This commit is contained in:
hackerESQ
2025-05-16 19:31:44 -05:00
parent 689aa4d50b
commit 3589242996
3 changed files with 44 additions and 9 deletions
+10 -1
View File
@@ -111,7 +111,7 @@ class CurrencyRate extends Model
*
* @return array<string, float>
*/
public static function timeSeriesRates(?string $currency = null, mixed $start = null, mixed $end = null): array
public static function timeSeriesRates(string|array|null $currency = null, mixed $start = null, mixed $end = null): array
{
if (empty($start)) {
return [];
@@ -132,6 +132,15 @@ class CurrencyRate extends Model
return $dateRange;
}
if (is_array($currency)) {
foreach ($currency as $curr) {
dispatch(self::timeSeriesRates($curr, $start, $end));
}
return [];
}
// handle currency alias
if (! empty($currency)) {