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:
@@ -19,7 +19,9 @@ class StationPriceCurrent extends Model
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
protected $primaryKey = null;
|
||||
protected $primaryKey = 'station_id';
|
||||
|
||||
protected $keyType = 'string';
|
||||
|
||||
public $incrementing = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user