Skip to content

Commit

Permalink
Merge pull request #41 from Datatrics/release/1.6.8
Browse files Browse the repository at this point in the history
Release/1.6.8
  • Loading branch information
Marvin-Magmodules authored Jul 13, 2023
2 parents bdb1acf + a27df44 commit 28380bf
Show file tree
Hide file tree
Showing 18 changed files with 297 additions and 533 deletions.
98 changes: 46 additions & 52 deletions Api/Profile/DataInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,57 +47,46 @@ interface DataInterface extends ExtensibleDataInterface
/**
* @return string
*/
public function getProfileId() : string;
public function getProfileId(): string;

/**
* @param string $profileId
* @return $this
*/
public function setProfileId(string $profileId) : self;
public function setProfileId(string $profileId): self;

/**
* @return int
*/
public function getCustomerId() : int;
public function getCustomerId(): int;

/**
* @param int $customerId
* @return $this
*/
public function setCustomerId(int $customerId) : self;
public function setCustomerId(int $customerId): self;

/**
* @return int
*/
public function getAddressId() : int;
public function getAddressId(): int;

/**
* @param int $addressId
* @return $this
*/
public function setAddressId(int $addressId) : self;
public function setAddressId(int $addressId): self;

/**
* @return int
*/
public function getStoreId() : int;
public function getStoreId(): int;

/**
* @param int $storeId
* @return $this
*/
public function setStoreId(int $storeId) : self;

/**
* @return string
*/
public function getCreatedAt() : string;

/**
* @param string $createdAt
* @return $this
*/
public function setCreatedAt(string $createdAt) : self;
public function setStoreId(int $storeId): self;

/**
* @return string
Expand All @@ -108,181 +97,186 @@ public function getUpdatedAt(): string;
* @param string $updatedAt
* @return $this
*/
public function setUpdatedAt(string $updatedAt) : self;
public function setUpdatedAt(string $updatedAt): self;

/**
* @return string
*/
public function getUpdateMsg() : string;
public function getUpdateMsg(): string;

/**
* @param string $updateMsg
* @return $this
*/
public function setUpdateMsg(string $updateMsg) : self;
public function setUpdateMsg(string $updateMsg): self;

/**
* @return string
*/
public function getUpdateAttempts() : string;
public function getUpdateAttempts(): string;

/**
* @param int $updateAttempts
* @return $this
*/
public function setUpdateAttempts(int $updateAttempts) : self;
public function setUpdateAttempts(int $updateAttempts): self;

/**
* @return string
*/
public function getStatus() : string;
public function getStatus(): string;

/**
* @param string $status
* @return $this
*/
public function setStatus(string $status) : self;
public function setStatus(string $status): self;

/**
* @param string $firstname
* @return $this
*/
public function setFirstname(string $firstname) : self;
public function setFirstname(string $firstname): self;

/**
* @param string $lastname
* @return $this
*/
public function setLastname(string $lastname) : self;
public function setLastname(string $lastname): self;

/**
* @param string $name
* @return $this
*/
public function setName(string $name) : self;
public function setName(string $name): self;

/**
* @param string $email
* @return $this
*/
public function setEmail(string $email) : self;
public function setEmail(string $email): self;

/**
* @param string $company
* @return $this
*/
public function setCompany(string $company) : self;
public function setCompany(string $company): self;

/**
* @param string $address
* @return $this
*/
public function setAddress(string $address) : self;
public function setAddress(string $address): self;

/**
* @param string $country
* @return $this
*/
public function setCountry(string $country) : self;
public function setCountry(string $country): self;

/**
* @param string $city
* @return $this
*/
public function setCity(string $city) : self;
public function setCity(string $city): self;

/**
* @param string $zip
* @return $this
*/
public function setZip(string $zip) : self;
public function setZip(string $zip): self;

/**
* @param string $phone
* @return $this
*/
public function setPhone(string $phone) : self;
public function setPhone(string $phone): self;

/**
* @param string $region
* @return $this
*/
public function setRegion(string $region) : self;
public function setRegion(string $region): self;

/**
* @param string $street
* @return $this
*/
public function setStreet(string $street) : self;
public function setStreet(string $street): self;

/**
* @param string $prefix
* @return $this
*/
public function setPrefix(string $prefix) : self;
public function setPrefix(string $prefix): self;

/**
* @return string
*/
public function getFirstname(): string;

/**
* @return string
*/
public function getFirstname() : string;
public function getLastname(): string;

/**
* @return string
*/
public function getLastname() : string;
public function getName(): string;

/**
* @return string
*/
public function getName() : string;
public function getEmail(): string;

/**
* @return string
*/
public function getEmail() : string;
public function getCompany(): string;

/**
* @return string
*/
public function getCompany() : string;
public function getAddress(): string;

/**
* @return string
*/
public function getAddress() : string;
public function getCountry(): string;

/**
* @return string
*/
public function getCountry() : string;
public function getCity(): string;

/**
* @return string
*/
public function getCity() : string;
public function getZip(): string;

/**
* @return string
*/
public function getZip() : string;
public function getPhone(): string;

/**
* @return string
*/
public function getPhone() : string;
public function getRegion(): string;

/**
* @return string
*/
public function getRegion() : string;
public function getStreet(): string;

/**
* @return string
*/
public function getStreet() : string;
public function getPrefix(): string;

/**
* @return string
*/
public function getPrefix() : string;
public function getCreatedAt(): string;
}
31 changes: 13 additions & 18 deletions Api/Profile/RepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@

namespace Datatrics\Connect\Api\Profile;

use Datatrics\Connect\Api\Profile\DataInterface as ProfileData;
use Magento\Customer\Model\Customer;
use Magento\Customer\Model\Data\Customer as DataCustomer;
use Magento\Framework\Api\SearchCriteriaInterface;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\Exception\NoSuchEntityException;
use Datatrics\Connect\Api\Profile\DataInterface
as ProfileData;
use Magento\Customer\Model\Customer;
use Magento\Customer\Model\Data\Customer as DataCustomer;
use Magento\Sales\Model\Order;
use Magento\Customer\Api\Data\CustomerInterface;

/**
* Profile repository interface
Expand All @@ -27,17 +25,14 @@ interface RepositoryInterface
* Input exception text
*/
public const INPUT_EXCEPTION = 'An ID is needed. Set the ID and try again.';

/**
* "No such entity" exception text
*/
public const NO_SUCH_ENTITY_EXCEPTION = 'The entity with id "%1" does not exist.';

/**
* "Could not delete" exception text
*/
public const COULD_NOT_DELETE_EXCEPTION = 'Could not delete the entity: %1';

/**
* "Could not save" exception text
*/
Expand All @@ -61,14 +56,14 @@ interface RepositoryInterface
* @return ProfileData
* @throws LocalizedException
*/
public function get(int $entityId) : ProfileData;
public function get(int $entityId): ProfileData;

/**
* Return Profile object
*
* @return ProfileData
*/
public function create();
public function create(): ProfileData;

/**
* Retrieves an Profile matching the specified criteria.
Expand All @@ -78,7 +73,7 @@ public function create();
* @return SearchResultsInterface
* @throws LocalizedException
*/
public function getList(SearchCriteriaInterface $searchCriteria) : SearchResultsInterface;
public function getList(SearchCriteriaInterface $searchCriteria): SearchResultsInterface;

/**
* Register entity to delete
Expand All @@ -88,18 +83,17 @@ public function getList(SearchCriteriaInterface $searchCriteria) : SearchResults
* @return bool true on success
* @throws LocalizedException
*/
public function delete(ProfileData $entity) : bool;
public function delete(ProfileData $entity): bool;

/**
* Deletes a Profile entity by ID
*
* @param int $entity
*
* @param int $entityId
* @return bool true on success
* @throws NoSuchEntityException
* @throws LocalizedException
*/
public function deleteById(int $entity) : bool;
public function deleteById(int $entityId): bool;

/**
* Perform persist operations for one entity
Expand All @@ -109,18 +103,19 @@ public function deleteById(int $entity) : bool;
* @return ProfileData
* @throws LocalizedException
*/
public function save(ProfileData $entity) : ProfileData;
public function save(ProfileData $entity): ProfileData;

/**
* @param DataCustomer|Customer $customer
* @param bool $forceUpdate
* @param null $address
* @return mixed
*/
public function prepareProfileData($customer, bool $forceUpdate = false, $address = null);
public function prepareProfileData($customer, bool $forceUpdate = false, $address = null): bool;

/**
* @param Order $order
* @return mixed
*/
public function prepareGuestProfileData(Order $order);
public function prepareGuestProfileData(Order $order): bool;
}
Loading

0 comments on commit 28380bf

Please sign in to comment.