Skip to content

Commit

Permalink
Merge pull request #1 from NathMorgan/feature/hyva-support
Browse files Browse the repository at this point in the history
Hyva Support & Module Rework
  • Loading branch information
NathMorgan authored Oct 22, 2024
2 parents 181b907 + 41f6c09 commit adea9aa
Show file tree
Hide file tree
Showing 32 changed files with 502 additions and 214 deletions.
40 changes: 40 additions & 0 deletions Api/Data/SetRightToForgetMessageInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

declare(strict_types=1);

namespace Tuqiri\GDPR\Api\Data;

use Magento\Framework\Phrase;

interface SetRightToForgetMessageInterface
{
/**
* Get success
*
* @return bool
*/
public function getSuccess(): bool;

/**
* Set success
*
* @param bool $success
* @return void
*/
public function setSuccess(bool $success): void;

/**
* Set message
*
* @param Phrase $message
* @return void
*/
public function setMessage(Phrase $message): void;

/**
* Get message
*
* @return Phrase
*/
public function getMessage(): Phrase;
}
23 changes: 23 additions & 0 deletions Api/SetRightToForgetInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

declare(strict_types=1);

namespace Tuqiri\GDPR\Api;

use Tuqiri\GDPR\Api\Data\SetRightToForgetMessageInterface;

/**
* Save right to forget
*
* @api
*/
interface SetRightToForgetInterface
{
/**
* @param int $customerId
* @return SetRightToForgetMessageInterface
*/
public function save(
int $customerId
): SetRightToForgetMessageInterface;
}
2 changes: 1 addition & 1 deletion Block/Account/RightToForget.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Ruroc\GDPR\Block\Account;
namespace Tuqiri\GDPR\Block\Account;

use Magento\Customer\Api\CustomerRepositoryInterface;
use Magento\Customer\Api\Data\CustomerInterface;
Expand Down
4 changes: 2 additions & 2 deletions Controller/Rtf/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

declare(strict_types=1);

namespace Ruroc\GDPR\Controller\Rtf;
namespace Tuqiri\GDPR\Controller\Rtf;

use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
use Magento\Framework\View\Result\PageFactory as ResultPageFactory;
use Ruroc\GDPR\Controller\RtfInterface;
use Tuqiri\GDPR\Controller\RtfInterface;

class Index implements RtfInterface, HttpGetActionInterface
{
Expand Down
137 changes: 0 additions & 137 deletions Controller/Rtf/SubmitRequest.php

This file was deleted.

2 changes: 1 addition & 1 deletion Controller/RtfInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Ruroc\GDPR\Controller;
namespace Tuqiri\GDPR\Controller;

use Magento\Customer\Controller\AccountInterface;

Expand Down
61 changes: 61 additions & 0 deletions Model/Data/SetRightToForgetMessage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php

declare(strict_types=1);

namespace Tuqiri\GDPR\Model\Data;

use Magento\Framework\Phrase;
use Tuqiri\GDPR\Api\Data\SetRightToForgetMessageInterface;

class SetRightToForgetMessage implements SetRightToForgetMessageInterface
{
/** @var Phrase */
private Phrase $message;

/** @var bool */
private bool $success;

/**
* @param Phrase|null $message
* @param bool $success
*/
public function __construct(
Phrase $message = null,
bool $success = false
) {
$this->message = $message;
$this->success = $success;
}

/**
* @inheritDoc
*/
public function setMessage(Phrase $message): void
{
$this->message = $message;
}

/**
* @inheritDoc
*/
public function getMessage(): Phrase
{
return $this->message;
}

/**
* @inheritDoc
*/
public function getSuccess(): bool
{
return $this->success;
}

/**
* @inheritDoc
*/
public function setSuccess(bool $success): void
{
$this->success = $success;
}
}
10 changes: 4 additions & 6 deletions Model/RightToForget.php → Model/EmailNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Ruroc\GDPR\Model;
namespace Tuqiri\GDPR\Model;

use Magento\Backend\Model\UrlInterface as BackendUrlInterface;
use Magento\Framework\App\Area;
Expand All @@ -11,9 +11,9 @@
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\Mail\Template\TransportBuilder;
use Magento\Store\Model\StoreManagerInterface;
use Ruroc\GDPR\Scope\Config as ScopeConfig;
use Tuqiri\GDPR\Scope\Config as ScopeConfig;

class RightToForget
class EmailNotification
{
/** @var ScopeConfig */
protected $scopeConfig;
Expand All @@ -27,8 +27,6 @@ class RightToForget
/** @var StoreManagerInterface */
protected $storeManager;

public const RIGHT_TO_FORGET_CUSTOMER_ATTRIBUTE = 'right_to_forget';

/**
* @param ScopeConfig $scopeConfig
* @param BackendUrlInterface $backendUrl
Expand Down Expand Up @@ -56,7 +54,7 @@ public function __construct(
* @throws MailException
* @throws NoSuchEntityException
*/
public function sendRightToForgetEmail(int $customerId): void
public function rightToForgetAdmin(int $customerId): void
{
$storeId = $this->storeManager->getStore()->getId();

Expand Down
Loading

0 comments on commit adea9aa

Please sign in to comment.