fix: multi currency seeders

This commit is contained in:
hackerESQ
2025-05-15 20:05:14 -05:00
parent 26370c03c4
commit 689aa4d50b
6 changed files with 66 additions and 225 deletions
@@ -97,9 +97,14 @@ return new class extends Migration
'--force' => true,
]);
CurrencyRate::timeSeriesRates(
Holding::all()->groupBy('market_data.currency')->keys()->toArray(),
Transaction::min('date')
Holding::all()->groupBy('market_data.currency')->keys()->each(
fn ($currency) => dispatch(
function () use ($currency) {
CurrencyRate::timeSeriesRates(
$currency,
Transaction::min('date')
);
})
);
CurrencyRate::refreshCurrencyData();