Skip to content

Commit

Permalink
🐛 Add productNumber to Product
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonJnsson committed Dec 7, 2023
1 parent 44fb605 commit 53bcba2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Resources/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use MorningTrain\Economic\Attributes\Resources\GetCollection;
use MorningTrain\Economic\Attributes\Resources\GetSingle;
use MorningTrain\Economic\Attributes\Resources\Properties\Filterable;
use MorningTrain\Economic\Attributes\Resources\Properties\PrimaryKey;
use MorningTrain\Economic\Attributes\Resources\Properties\ResourceType;
use MorningTrain\Economic\Attributes\Resources\Properties\Sortable;
use MorningTrain\Economic\Classes\EconomicCollection;
Expand Down Expand Up @@ -73,6 +74,9 @@ class Product extends Resource
#[Sortable]
public string $year;

#[PrimaryKey]
public int $productNumber;

public static function create(DateTime $fromDate, DateTime $toDate): static
{
return static::createRequest(compact('fromDate', 'toDate'));
Expand Down
3 changes: 3 additions & 0 deletions tests/Unit/InvoiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
],
'lines' => [
[
'product' => [
'productNumber' => 1,
],
'quantity' => 1,
'unitNetPrice' => 500,
],
Expand Down

0 comments on commit 53bcba2

Please sign in to comment.