-
-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathPriceAmendable.php
More file actions
47 lines (39 loc) · 1.2 KB
/
PriceAmendable.php
File metadata and controls
47 lines (39 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
namespace Whitecube\Price;
use Brick\Money\AbstractMoney;
interface PriceAmendable
{
/**
* Return the modifier type (tax, discount, other, ...)
*/
public function type(): string;
/**
* Define the modifier type (tax, discount, other, ...)
*/
public function setType(?string $type = null): static;
/**
* Return the modifier's identification key
*/
public function key(): ?string;
/**
* Get the modifier attributes that should be saved in the
* price modification history.
*/
public function attributes(): ?array;
/**
* Whether the modifier should be applied before the
* VAT value has been computed.
*/
public function appliesAfterVat(): bool;
/**
* Apply the modifier on the given Money instance
*
* @param \Brick\Money\AbstractMoney $build
* @param float $units
* @param bool $perUnit
* @param null|\Brick\Money\AbstractMoney $exclusive
* @param null|\Whitecube\Price\Vat $vat
* @return null|\Brick\Money\AbstractMoney
*/
public function apply(AbstractMoney $build, float $units, bool $perUnit, ?AbstractMoney $exclusive = null, ?Vat $vat = null) : ?AbstractMoney;
}