use App\Services\PricingService;
use Livewire\Component;
use Livewire\Attributes\Title;
use Livewire\Attributes\Computed;
use Illuminate\Validation\Rule;
use Illuminate\Support\Facades\Validator;
use Livewire\Attributes\On;
class PricingCalculator extends Component
{
protected PricingService $pricingService;
// ...
public string $webComputeSize;
public string $workerComputeSize;
public ?string $mysqlDatabaseSize;
public float $postgresComputeUnits;
public string $kvTier;
// ...
public function boot(PricingService $pricingService)
{
$this->pricingService = $pricingService;
}
public function mount()
{
// Initialize properties using the service
$this->webComputeSize = $this->pricingService->getComputeDefaultSizeKey();
$this->workerComputeSize = $this->pricingService->getComputeDefaultSizeKey();
$this->mysqlDatabaseSize = $this->pricingService->getMySqlDefaultSizeKey();
$this->postgresComputeUnits = $this->pricingService->getPostgresMinCpu();
$this->kvTier = $this->pricingService->getKvDefaultTierKey();
$this->resetUsageToPlanDefaults();
}
// ...
}