Skip to content

Commit

Permalink
Added the Stockable interface
Browse files Browse the repository at this point in the history
  • Loading branch information
fulopattila122 committed Nov 23, 2023
1 parent 0633f62 commit e2f2c23
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
- Added `isZoneRestricted()` & `isNotZoneRestricted()` helper methods to the `ShippingMethod` class
- Added the payment dependent shipping fee calculator
- Added the `units_sold` and the `last_sale_at` attributes to the master product model (SUM/MAX from variants)
- Added the `Stockable` interface (Contracts)
- Fixed possible null return type on Billpayer::getName() when is_organization is true but the company name is null

## 3.x Series
Expand Down
1 change: 1 addition & 0 deletions src/Contracts/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

- Dropped PHP 8.0 & PHP 8.1 Support
- Dropped Laravel 9 Support
- Added the `Stockable` interface

## 3.x Series

Expand Down
28 changes: 28 additions & 0 deletions src/Contracts/Stockable.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

declare(strict_types=1);

/**
* Contains the Stockable interface.
*
* @copyright Copyright (c) 2023 Vanilo UG
* @author Attila Fulop
* @license MIT
* @since 2023-11-23
*
*/

namespace Vanilo\Contracts;

interface Stockable
{
public function isOnStock(): bool;

public function onStockQuantity(): float;

public function isBackorderUnrestricted(): bool;

public function backorderQuantity(): ?float;

public function totalAvailableQuantity(): float;
}

0 comments on commit e2f2c23

Please sign in to comment.