feat: ship creator journey v2 and profile updates
This commit is contained in:
@@ -7,6 +7,7 @@ namespace App\Observers;
|
||||
use App\Jobs\RecComputeSimilarByBehaviorJob;
|
||||
use App\Jobs\RecComputeSimilarHybridJob;
|
||||
use App\Models\ArtworkFavourite;
|
||||
use App\Services\Profile\CreatorJourneyService;
|
||||
use App\Services\UserStatsService;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
@@ -18,6 +19,7 @@ class ArtworkFavouriteObserver
|
||||
{
|
||||
public function __construct(
|
||||
private readonly UserStatsService $userStats,
|
||||
private readonly CreatorJourneyService $journeys,
|
||||
) {}
|
||||
|
||||
public function created(ArtworkFavourite $favourite): void
|
||||
@@ -25,6 +27,7 @@ class ArtworkFavouriteObserver
|
||||
$creatorId = $this->creatorId($favourite->artwork_id);
|
||||
if ($creatorId) {
|
||||
$this->userStats->incrementFavoritesReceived($creatorId);
|
||||
$this->journeys->requestRebuild($creatorId);
|
||||
}
|
||||
|
||||
// §7.5 On-demand: recompute behavior similarity when artwork reaches threshold
|
||||
@@ -36,6 +39,7 @@ class ArtworkFavouriteObserver
|
||||
$creatorId = $this->creatorId($favourite->artwork_id);
|
||||
if ($creatorId) {
|
||||
$this->userStats->decrementFavoritesReceived($creatorId);
|
||||
$this->journeys->requestRebuild($creatorId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user