Skip to content

Commit

Permalink
✨ Add Unit and DepartementalDistribution to ProductLine
Browse files Browse the repository at this point in the history
  • Loading branch information
mschadegg committed Feb 25, 2024
1 parent 702d13e commit 5ab284e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/DTOs/Invoice/ProductLine.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@
namespace Morningtrain\Economic\DTOs\Invoice;

use Morningtrain\Economic\Abstracts\Resource;
use Morningtrain\Economic\Attributes\Resources\Properties\ApiFormatting\ResourceToArray;
use Morningtrain\Economic\Resources\DepartmentalDistribution;
use Morningtrain\Economic\Resources\Product;
use Morningtrain\Economic\Resources\Unit;

class ProductLine extends Resource
{
// public ?Accrual $accrual; TODO - Implement Accrual

public ?DepartmentalDistribution $departmentalDistribution;

public ?string $description;

public ?float $discountPercentage;
Expand All @@ -15,12 +22,16 @@ class ProductLine extends Resource

public ?float $marginPercentage;

#[ResourceToArray('productNumber', 'self')]
public ?Product $product;

public ?float $quantity;

public ?int $sortKey;

#[ResourceToArray('unitNumber', 'self')]
public ?Unit $unit;

public ?float $unitCostPrice;

public ?float $unitNetPrice;
Expand All @@ -35,6 +46,8 @@ public static function new(
?float $marginPercentage = null,
?int $sortKey = null,
?float $unitCostPrice = null,
DepartmentalDistribution|int|null $departmentalDistribution = null,
Unit|int|null $unit = null,
): static {
return new static([
'product' => $product,
Expand All @@ -46,6 +59,8 @@ public static function new(
'marginPercentage' => $marginPercentage,
'sortKey' => $sortKey,
'unitCostPrice' => $unitCostPrice,
'departmentalDistribution' => $departmentalDistribution,
'unit' => $unit
]);
}
}

0 comments on commit 5ab284e

Please sign in to comment.