Skip to content

Commit

Permalink
Feature/nem handel type (#4)
Browse files Browse the repository at this point in the history
* ✨ Add nemHandelType to recipient

* Fix styling

---------

Co-authored-by: SimonJnsson <[email protected]>
  • Loading branch information
SimonJnsson and SimonJnsson authored Jan 22, 2024
1 parent edeaaba commit cef4977
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/DTOs/Recipient.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Morningtrain\Economic\DTOs;

use Morningtrain\Economic\Abstracts\Resource;
use Morningtrain\Economic\Enums\NemHandelType;
use Morningtrain\Economic\Resources\VatZone;

class Recipient extends Resource
Expand All @@ -25,6 +26,8 @@ class Recipient extends Resource

public ?Attention $attention = null;

public ?NemHandelType $nemHandelType = null;

public static function new(
string $name,
VatZone $vatZone,
Expand All @@ -35,6 +38,7 @@ public static function new(
?string $ean = null,
?string $publicEntryNumber = null,
?Attention $attention = null,
?NemHandelType $nemHandelType = null,
): static {
return new static([
'name' => $name,
Expand All @@ -46,6 +50,7 @@ public static function new(
'ean' => $ean,
'publicEntryNumber' => $publicEntryNumber,
'attention' => $attention,
'nemHandelType' => $nemHandelType,
]);
}
}
10 changes: 10 additions & 0 deletions src/Enums/NemHandelType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace Morningtrain\Economic\Enums;

enum NemHandelType: string
{
case EAN = 'ean';
case CORPORATE_IDENTIFICATION_NUMBER = 'corporateIdentificationNumber';
case P_NUMBER = 'pNumber';
}
8 changes: 4 additions & 4 deletions src/Traits/Resources/EndpointResolvable.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
trait EndpointResolvable
{
/**
* @param string $endpointAttributeClass - The attribute class to resolve
* @param ...$references - The references to pass to the endpoint. Can be strings, integers or a single array with references
* @param string $endpointAttributeClass - The attribute class to resolve
* @param ...$references - The references to pass to the endpoint. Can be strings, integers or a single array with references
*
* @throws Exception
*/
Expand All @@ -26,8 +26,8 @@ public static function getEndpoint(string $endpointAttributeClass, ...$reference
}

/**
* @param string $slug - The attribute slug to resolve
* @param ...$references - The references to pass to the endpoint. Can be strings, integers or a single array with references
* @param string $slug - The attribute slug to resolve
* @param ...$references - The references to pass to the endpoint. Can be strings, integers or a single array with references
*
* @throws Exception
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/Resources/GetSingleable.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ trait GetSingleable
use EndpointResolvable;

/**
* @param ...$references - The references to pass to the endpoint. Can be string(s), integer(s) or a single array with named references
* @param ...$references - The references to pass to the endpoint. Can be string(s), integer(s) or a single array with named references
*
* @throws \Exception
*/
Expand Down

0 comments on commit cef4977

Please sign in to comment.