Skip to content

Commit

Permalink
Merge pull request #12 from Talentify/feature/ch14164/enviar-evento-s…
Browse files Browse the repository at this point in the history
…ent-to-ats-para-o-customer

Feature/ch14164/enviar evento sent to ats para o customer
  • Loading branch information
dreanmer authored Jul 16, 2021
2 parents fa13280 + ebe1bf3 commit 4066f9a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/Entity/EntityInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@

namespace CIO\Entity;

use CIO\Entity\Customer\Identifier;

interface EntityInterface
{
/**
* @return mixed[]
*/
public function toArray() : array;

/**
* @return Identifier
*/
public function getIdentifier() : Identifier;
}
8 changes: 8 additions & 0 deletions src/Entity/Event/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ public function __construct(
$this->attributes = $attributes;
}

/**
* @return \CIO\Entity\Customer\Identifier
*/
public function getIdentifier() : Identifier
{
return $this->getCustomerIdentifier();
}

/**
* @return \CIO\Entity\Customer\Identifier
*/
Expand Down
4 changes: 3 additions & 1 deletion src/Request/Track/Customer/AddOrUpdateCustomer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace CIO\Request\Track\Customer;

use CIO\Entity\Customer\Customer;
use CIO\Entity\EntityInterface;
use CIO\Entity\RequestMethod;
use CIO\Request\Track\TrackBaseRequest;

Expand All @@ -15,8 +16,9 @@ class AddOrUpdateCustomer extends TrackBaseRequest
*/
private $customer;

public function __construct(Customer $customer)
public function __construct(EntityInterface $customer)
{
assert($customer instanceof Customer);
$this->customer = $customer;
}

Expand Down
5 changes: 3 additions & 2 deletions src/Request/Track/Event/AddEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace CIO\Request\Track\Event;

use CIO\Entity\Customer\Customer;
use CIO\Entity\EntityInterface;
use CIO\Entity\Event\Event;
use CIO\Entity\RequestMethod;
use CIO\Request\Track\TrackBaseRequest;
Expand All @@ -14,8 +14,9 @@ class AddEvent extends TrackBaseRequest
/** @var \CIO\Entity\Event\Event */
private $event;

public function __construct(Event $event)
public function __construct(EntityInterface $event)
{
assert($event instanceof Event);
$this->event = $event;
}

Expand Down

0 comments on commit 4066f9a

Please sign in to comment.