fix: daily change should be synced when before latest transaction
This commit is contained in:
@@ -21,7 +21,7 @@ class EnsureDailyChangeIsSynced
|
|||||||
! Cache::has($cacheKey)
|
! Cache::has($cacheKey)
|
||||||
&& $model->date->lessThan(now())
|
&& $model->date->lessThan(now())
|
||||||
&& ($model->date->lessThan($model->portfolio->daily_change()->min('date') ?? now())
|
&& ($model->date->lessThan($model->portfolio->daily_change()->min('date') ?? now())
|
||||||
|| $model->date->lessThan($model->portfolio->transactions()->where('id', '!=', $model->id)->min('date') ?? now())
|
|| $model->date->lessThan($model->portfolio->transactions()->where('id', '!=', $model->id)->max('date') ?? now())
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
defer(fn () => $model->portfolio->syncDailyChanges());
|
defer(fn () => $model->portfolio->syncDailyChanges());
|
||||||
|
|||||||
Reference in New Issue
Block a user