fix: model audit cleanups (primaryKey, fuel_type cast, cadence cache)
- StationPriceCurrent: $primaryKey was null; set to 'station_id' + keyType string so Eloquent has a sensible default for save() / find() paths. - UserNotificationPreference: add FuelType enum cast on fuel_type so it hydrates as an enum like every other price model. - Plan::resolveCadenceForUser: cache for 1h under the same plans tag as resolveForUser; HandleStripeWebhook busts both keys on subscription events. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\FuelType;
|
||||
use Database\Factories\UserNotificationPreferenceFactory;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
@@ -44,6 +45,7 @@ class UserNotificationPreference extends Model
|
||||
{
|
||||
return [
|
||||
'enabled' => 'boolean',
|
||||
'fuel_type' => FuelType::class,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user