clean up scheduled commands

also add comments to each command
This commit is contained in:
hackerESQ
2024-09-05 21:21:18 -05:00
parent 6f63ac7067
commit 8511cc833d
12 changed files with 51 additions and 35 deletions
+3 -2
View File
@@ -17,6 +17,7 @@ class Transaction extends Model
protected $fillable = [
'symbol',
'date',
'portfolio_id',
'transaction_type',
'quantity',
'cost_basis',
@@ -48,14 +49,14 @@ class Transaction extends Model
$transaction->refreshMarketData();
cache()->tags(['metrics', auth()->user()->id])->flush();
cache()->tags(['metrics', $transaction->portfolio_id])->flush();
});
static::deleted(function ($transaction) {
$transaction->syncToHolding();
cache()->tags(['metrics', auth()->user()->id])->flush();
cache()->tags(['metrics', $transaction->portfolio_id])->flush();
});
}