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:
Ovidiu U
2026-04-29 18:32:55 +01:00
parent 775e076bb7
commit 783297694c
4 changed files with 36 additions and 22 deletions

View File

@@ -19,7 +19,9 @@ class StationPriceCurrent extends Model
public $timestamps = false;
protected $primaryKey = null;
protected $primaryKey = 'station_id';
protected $keyType = 'string';
public $incrementing = false;