/
OrderItemInterface.php
72 lines (62 loc) · 1.3 KB
/
OrderItemInterface.php
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
namespace Fiscal\OFD;
/**
* Interface OrderItemInterface
*
* Apply this interface to your Order item class (i.e. model).
*/
interface OrderItemInterface
{
public const DISCOUNT_TYPE_VALUE = 'value';
public const DISCOUNT_TYPE_PERCENT = 'percent';
/**
* Order item id. It must be Unique among order items.
*
* @return int|null
*/
public function getPositionId(): ?int;
/**
* Product name.
*
* @return string
*/
public function getName(): string;
/**
* Quantity measure
*
* @return string
*/
public function getMeasure(): string;
/**
* Quantity value
*
* @return int|float
*/
public function getQuantity(): float;
/**
* Product code. (i.e. id inside your system or article)
*
* @return string
*/
public function getCode(): string;
/**
* Single product price.
*
* @return float
*/
public function getPrice(): float;
/**
* Single product price multiply by quantity
*
* Not required if getPrice is specified
*
* @return float
*/
public function getAmount(): ?float;
/**
* Product currency in ISO-4217 format.
*
* @return string|null
*/
public function getCurrency(): ?string;
}