Skip to content

Commit

Permalink
Major module rework
Browse files Browse the repository at this point in the history
  • Loading branch information
flurrybox committed Nov 19, 2018
1 parent 0c2d937 commit 1da1fdb
Show file tree
Hide file tree
Showing 87 changed files with 3,693 additions and 1,951 deletions.
74 changes: 74 additions & 0 deletions Api/CustomerManagementInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?php
/**
* This file is part of the Flurrybox EnhancedPrivacy package.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Flurrybox EnhancedPrivacy
* to newer versions in the future.
*
* @copyright Copyright (c) 2018 Flurrybox, Ltd. (https://flurrybox.com/)
* @license GNU General Public License ("GPL") v3.0
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Flurrybox\EnhancedPrivacy\Api;

use Magento\Customer\Api\Data\CustomerInterface;

/**
* Customer management.
*
* @api
* @since 2.0.0
*/
interface CustomerManagementInterface
{
/**
* Check if customer has made any order.
*
* @param \Magento\Customer\Api\Data\CustomerInterface $customer
*
* @return bool
*/
public function hasOrders(CustomerInterface $customer);

/**
* Check if customer is to be deleted.
*
* @param \Magento\Customer\Api\Data\CustomerInterface $customer
*
* @return bool
*/
public function isCustomerToBeDeleted(CustomerInterface $customer);

/**
* Process customer delete.
*
* @param \Magento\Customer\Api\Data\CustomerInterface $customer
*
* @return void
*/
public function deleteCustomer(CustomerInterface $customer);

/**
* Process customer anonymization.
*
* @param \Magento\Customer\Api\Data\CustomerInterface $customer
*
* @return void
*/
public function anonymizeCustomer(CustomerInterface $customer);

/**
* Cancel customer deletion or anonymization.
*
* @param \Magento\Customer\Api\Data\CustomerInterface $customer
*
* @return void
* @throws \Exception
*/
public function cancelCustomerDeletion(CustomerInterface $customer);
}
20 changes: 8 additions & 12 deletions Block/Account/Delete.php → Api/Data/CustomerManagementInterface.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,18 @@
* file that was distributed with this source code.
*/

namespace Flurrybox\EnhancedPrivacy\Block\Account;

use Flurrybox\EnhancedPrivacy\Block\Account;
namespace Flurrybox\EnhancedPrivacy\Api\Data;

/**
* Customer delete account block.
* Interface CustomerManagementInterface.
*
* @api
* @since 2.0.0
*/
class Delete extends Account
interface CustomerManagementInterface
{
/**
* Get action controller url.
*
* @return string
* Attribute code.
*/
public function getAction()
{
return $this->getUrl('privacy/delete/delete');
}
const ATTRIBUTE_IS_ANONYMIZED = 'is_anonymized';
}
77 changes: 77 additions & 0 deletions Api/Data/ReasonInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?php
/**
* This file is part of the Flurrybox EnhancedPrivacy package.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Flurrybox EnhancedPrivacy
* to newer versions in the future.
*
* @copyright Copyright (c) 2018 Flurrybox, Ltd. (https://flurrybox.com/)
* @license GNU General Public License ("GPL") v3.0
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Flurrybox\EnhancedPrivacy\Api\Data;

/**
* Interface ReasonInterface.
*
* @api
* @since 2.0.0
*/
interface ReasonInterface
{
/**
* Table.
*/
const TABLE = 'flurrybox_enhancedprivacy_delete_reasons';

/**
* Table fields.
*/
const ID = 'id';
const REASON = 'reason';
const CREATED_AT = 'created_at';

/**
* Get reason id.
*
* @return int
*/
public function getId();

/**
* Get reason.
*
* @return string
*/
public function getReason();

/**
* Get created at time.
*
* @return string
*/
public function getCreatedAt();

/**
* Set reason.
*
* @param string $reason
*
* @return \Flurrybox\EnhancedPrivacy\Api\Data\ReasonInterface
*/
public function setReason(string $reason);

/**
* Set created at time.
*
* @param string $time
*
* @return \Flurrybox\EnhancedPrivacy\Api\Data\ReasonInterface
*/
public function setCreatedAt(string $time);
}
44 changes: 44 additions & 0 deletions Api/Data/ReasonSearchResultsInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* This file is part of the Flurrybox EnhancedPrivacy package.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Flurrybox EnhancedPrivacy
* to newer versions in the future.
*
* @copyright Copyright (c) 2018 Flurrybox, Ltd. (https://flurrybox.com/)
* @license GNU General Public License ("GPL") v3.0
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Flurrybox\EnhancedPrivacy\Api\Data;

use Magento\Framework\Api\SearchResultsInterface;

/**
* Interface ReasonSearchResultsInterface.
*
* @api
* @since 2.0.0
*/
interface ReasonSearchResultsInterface extends SearchResultsInterface
{
/**
* Get reasons list.
*
* @return \Flurrybox\EnhancedPrivacy\Api\Data\ReasonInterface[]
*/
public function getItems();

/**
* Set reasons.
*
* @param \Flurrybox\EnhancedPrivacy\Api\Data\ReasonInterface[] $items
*
* @return \Flurrybox\EnhancedPrivacy\Api\Data\ReasonSearchResultsInterface
*/
public function setItems(array $items);
}
139 changes: 139 additions & 0 deletions Api/Data/ScheduleInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
<?php
/**
* This file is part of the Flurrybox EnhancedPrivacy package.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Flurrybox EnhancedPrivacy
* to newer versions in the future.
*
* @copyright Copyright (c) 2018 Flurrybox, Ltd. (https://flurrybox.com/)
* @license GNU General Public License ("GPL") v3.0
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Flurrybox\EnhancedPrivacy\Api\Data;

use Magento\Framework\Api\ExtensibleDataInterface;

/**
* Interface ScheduleInterface.
*
* @api
* @since 2.0.0
*/
interface ScheduleInterface extends ExtensibleDataInterface
{
/**
* Table name.
*/
const TABLE = 'flurrybox_enhancedprivacy_cleanup_schedule';

/**#@+
* Table column.
*/
const ID = 'id';
const SCHEDULED_AT = 'scheduled_at';
const CUSTOMER_ID = 'customer_id';
const TYPE = 'type';
const REASON_ID = 'reason_id';
/**#@-*/

/**#@+
* Schedule type.
*/
const TYPE_DELETE = 1;
const TYPE_ANONYMIZE = 2;
/**#@-*/

/**
* Get schedule id.
*
* @return int
*/
public function getId();

/**
* Get schedule at time.
*
* @return string
*/
public function getScheduledAt();

/**
* Set scheduled at time.
*
* @param string $time
*
* @return \Flurrybox\EnhancedPrivacy\Api\Data\ScheduleInterface
*/
public function setScheduledAt(string $time);

/**
* Get customer id.
*
* @return int
*/
public function getCustomerId();

/**
* Set customer id.
*
* @param int $customerId
*
* @return \Flurrybox\EnhancedPrivacy\Api\Data\ScheduleInterface
*/
public function setCustomerId(int $customerId);

/**
* Get schedule type.
*
* @return string
*/
public function getType();

/**
* Get deletion reason id.
*
* @return int
*/
public function getReasonId();



/**
* Set schedule type.
*
* @param string $type
*
* @return \Flurrybox\EnhancedPrivacy\Api\Data\ScheduleInterface
*/
public function setType(string $type);

/**
* Set deletion reason id.
*
* @param int $id
*
* @return \Flurrybox\EnhancedPrivacy\Api\Data\ScheduleInterface
*/
public function setReasonId(int $id);

/**
* Get extension attributes.
*
* @return \Flurrybox\EnhancedPrivacy\Api\Data\ScheduleExtensionInterface
*/
public function getExtensionAttributes();

/**
* Set extension attributes.
*
* @param \Flurrybox\EnhancedPrivacy\Api\Data\ScheduleExtensionInterface $extensionAttributes
*
* @return \Flurrybox\EnhancedPrivacy\Api\Data\ScheduleInterface
*/
public function setExtensionAttributes(ScheduleExtensionInterface $extensionAttributes);
}
Loading

0 comments on commit 1da1fdb

Please sign in to comment.