refactor: restructure Stripe pricing config to support monthly and annual tiers
- Nest price IDs under `monthly` and `annual` keys for each tier (basic, plus, pro)
This commit is contained in:
@@ -4,7 +4,10 @@ namespace App\Filament\Resources\BrentPriceResource\Pages;
|
||||
|
||||
use App\Filament\Resources\BrentPriceResource;
|
||||
use App\Filament\Widgets\BrentPriceChartWidget;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
|
||||
class ListBrentPrices extends ListRecords
|
||||
{
|
||||
@@ -12,7 +15,30 @@ class ListBrentPrices extends ListRecords
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [];
|
||||
return [
|
||||
Action::make('fetchPrices')
|
||||
->label('Fetch Prices Now')
|
||||
->icon('heroicon-o-arrow-down-tray')
|
||||
->requiresConfirmation()
|
||||
->modalHeading('Fetch latest Brent prices?')
|
||||
->modalDescription('Pulls the latest Brent crude prices from EIA (falls back to FRED if EIA is unavailable).')
|
||||
->action(function () {
|
||||
$result = Artisan::call('oil:fetch');
|
||||
|
||||
if ($result === 0) {
|
||||
Notification::make()
|
||||
->title('Brent prices fetched successfully')
|
||||
->success()
|
||||
->send();
|
||||
} else {
|
||||
Notification::make()
|
||||
->title('Fetch failed')
|
||||
->body('Both EIA and FRED failed. Check API Logs for details.')
|
||||
->danger()
|
||||
->send();
|
||||
}
|
||||
}),
|
||||
];
|
||||
}
|
||||
|
||||
protected function getHeaderWidgets(): array
|
||||
|
||||
@@ -20,9 +20,9 @@ class ListOilPredictions extends ListRecords
|
||||
->icon('heroicon-o-cpu-chip')
|
||||
->requiresConfirmation()
|
||||
->modalHeading('Run oil price prediction?')
|
||||
->modalDescription('This will fetch the latest FRED prices and generate a new prediction. May take a few seconds.')
|
||||
->modalDescription('Generates a new prediction from the stored Brent prices. Runs even if a prediction already exists for the latest price.')
|
||||
->action(function () {
|
||||
$result = Artisan::call('oil:predict', ['--fetch' => true]);
|
||||
$result = Artisan::call('oil:predict', ['--force' => true]);
|
||||
|
||||
if ($result === 0) {
|
||||
Notification::make()
|
||||
|
||||
Reference in New Issue
Block a user