File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 66
77use Terminal42 \CashctrlApi \ApiClientInterface ;
88use Terminal42 \CashctrlApi \Entity \Order ;
9+ use Terminal42 \CashctrlApi \Enum \OrderType ;
910use Terminal42 \CashctrlApi \Exception \DomainException ;
1011
1112/**
1213 * @extends ListFilter<Order>
1314 */
1415class OrderListFilter extends ListFilter
1516{
16- public const TYPE_SALES = 'SALES ' ;
17-
18- public const TYPE_PURCHASE = 'PURCHASE ' ;
19-
2017 protected int |null $ categoryId = null ;
2118
2219 protected string |null $ columns = null ;
@@ -41,7 +38,7 @@ class OrderListFilter extends ListFilter
4138
4239 protected int |null $ statusId = null ;
4340
44- protected string |null $ type = null ;
41+ protected OrderType |null $ type = null ;
4542
4643 private readonly ApiClientInterface $ client ;
4744
@@ -102,7 +99,7 @@ public function withStatus(int $statusId): self
10299 return $ this ;
103100 }
104101
105- public function ofType (string $ type ): self
102+ public function ofType (OrderType $ type ): self
106103 {
107104 $ this ->type = $ type ;
108105
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Terminal42 \CashctrlApi \Enum ;
6+
7+ enum OrderType: string
8+ {
9+ case Sales = 'SALES ' ;
10+ case Purchase = 'PURCHASE ' ;
11+ }
You can’t perform that action at this time.
0 commit comments