trypost/database/factories/PlanFactory.php
Paulo Castellano 21e45b4847 chore: remove legacy plan tiers (starter/plus/pro/max)
All customers were migrated to the single Workspace plan and the old plan rows
were deleted in production, so drop the now-dead legacy tiers from the code:
reduce the Plan Slug enum to Workspace only and default the PlanFactory to it.
Rework StripeEventListenerTest around the single Workspace plan (its monthly and
yearly price ids still exercise plan-by-price mapping, trial clearing, deletion,
and previous-plan propagation), and point the remaining tests that referenced
the starter/pro slugs at the seeded Workspace plan.
2026-06-22 15:31:32 -03:00

40 lines
850 B
PHP

<?php
declare(strict_types=1);
namespace Database\Factories;
use App\Enums\Plan\Slug;
use App\Models\Plan;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends Factory<Plan>
*/
class PlanFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'slug' => Slug::Workspace,
'name' => 'Workspace',
'stripe_monthly_price_id' => null,
'stripe_yearly_price_id' => null,
'monthly_credits_limit' => 2500,
'sort' => 0,
'is_archived' => false,
];
}
public function archived(): static
{
return $this->state(fn (array $attributes): array => [
'is_archived' => true,
]);
}
}