feat: refactor cart and bundle handling to support Buyable interface for improved flexibility
This commit is contained in:
20
app/Domains/Shared/Contracts/Buyable.php
Normal file
20
app/Domains/Shared/Contracts/Buyable.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domains\Shared\Contracts;
|
||||
|
||||
interface Buyable
|
||||
{
|
||||
public function getPrice(): float;
|
||||
|
||||
public function getName(): string;
|
||||
|
||||
public function availableQuantity(): ?int;
|
||||
|
||||
public function reserveStock(int $amount): void;
|
||||
|
||||
public function decrementReservedStock(int $amount): void;
|
||||
|
||||
public function buy(int $amount): void;
|
||||
|
||||
public function validateStock(): void;
|
||||
}
|
||||
Reference in New Issue
Block a user