diff --git a/Model/Config.php b/Model/Config.php
index e8471aa..3a5fa91 100644
--- a/Model/Config.php
+++ b/Model/Config.php
@@ -18,7 +18,7 @@ final class Config
*/
public const CONFIG_PATH_GENERAL_ENABLED = 'gdpr/general/enabled';
public const CONFIG_PATH_ERASURE_ENABLED = 'gdpr/erasure/enabled';
- public const CONFIG_PATH_ERASURE_ALLOWED_STATES = 'gdpr/erasure/allowed_states';
+ public const CONFIG_PATH_ERASURE_ALLOWED_STATUSES = 'gdpr/erasure/allowed_statuses';
public const CONFIG_PATH_EXPORT_ENABLED = 'gdpr/export/enabled';
private ScopeConfigInterface $scopeConfig;
@@ -48,10 +48,10 @@ public function isErasureEnabled(): bool
/**
* @return string[]
*/
- public function getAllowedStatesToErase(): array
+ public function getAllowedStatusesToErase(): array
{
return explode(',', (string) $this->scopeConfig->getValue(
- self::CONFIG_PATH_ERASURE_ALLOWED_STATES,
+ self::CONFIG_PATH_ERASURE_ALLOWED_STATUSES,
ScopeInterface::SCOPE_STORE
));
}
diff --git a/Model/Config/Source/OrderPendingStates.php b/Model/Config/Source/OrderPendingStatuses.php
similarity index 91%
rename from Model/Config/Source/OrderPendingStates.php
rename to Model/Config/Source/OrderPendingStatuses.php
index 00bc834..cf4d1c7 100644
--- a/Model/Config/Source/OrderPendingStates.php
+++ b/Model/Config/Source/OrderPendingStatuses.php
@@ -10,7 +10,7 @@
use Magento\Framework\Data\OptionSourceInterface;
use Magento\Sales\Model\ResourceModel\Order\Status\CollectionFactory;
-final class OrderPendingStates implements OptionSourceInterface
+final class OrderPendingStatuses implements OptionSourceInterface
{
private CollectionFactory $collectionFactory;
diff --git a/Model/Customer/CustomerChecker.php b/Model/Customer/CustomerChecker.php
index b2894c7..92741b5 100644
--- a/Model/Customer/CustomerChecker.php
+++ b/Model/Customer/CustomerChecker.php
@@ -40,7 +40,7 @@ public function __construct(
public function canErase(int $customerId): bool
{
if (!isset($this->cache[$customerId])) {
- $this->criteriaBuilder->addFilter(OrderInterface::STATE, $this->config->getAllowedStatesToErase(), 'nin');
+ $this->criteriaBuilder->addFilter(OrderInterface::STATUS, $this->config->getAllowedStatusesToErase(), 'nin');
$this->criteriaBuilder->addFilter(OrderInterface::CUSTOMER_ID, $customerId);
$orderList = $this->orderRepository->getList($this->criteriaBuilder->create());
diff --git a/Model/Order/OrderChecker.php b/Model/Order/OrderChecker.php
index f021bae..db4226d 100644
--- a/Model/Order/OrderChecker.php
+++ b/Model/Order/OrderChecker.php
@@ -30,6 +30,6 @@ public function canErase(int $orderId): bool
{
$order = $this->orderRepository->get($orderId);
- return in_array($order->getState(), $this->config->getAllowedStatesToErase(), true);
+ return in_array($order->getStatus(), $this->config->getAllowedStatusesToErase(), true);
}
}
diff --git a/Model/Order/SourceProvider/GuestFilterModifier.php b/Model/Order/SourceProvider/GuestFilterModifier.php
index 43ddbe7..7a1a6e7 100644
--- a/Model/Order/SourceProvider/GuestFilterModifier.php
+++ b/Model/Order/SourceProvider/GuestFilterModifier.php
@@ -31,6 +31,6 @@ public function apply(Collection $collection, Filter $filter): void
{
$collection->addFieldToFilter(OrderInterface::CUSTOMER_ID, ['null' => true]);
$collection->addFieldToFilter(OrderInterface::CUSTOMER_IS_GUEST, ['eq' => 1]);
- $collection->addFieldToFilter(OrderInterface::STATE, ['in' => $this->config->getAllowedStatesToErase()]);
+ $collection->addFieldToFilter(OrderInterface::STATUS, ['in' => $this->config->getAllowedStatusesToErase()]);
}
}
diff --git a/etc/adminhtml/system/erasure.xml b/etc/adminhtml/system/erasure.xml
index e586a38..0135e7a 100644
--- a/etc/adminhtml/system/erasure.xml
+++ b/etc/adminhtml/system/erasure.xml
@@ -68,14 +68,14 @@
gdpr/erasure/sales_max_age
-
-
- Opengento\Gdpr\Model\Config\Source\OrderPendingStates
+
+
+ Opengento\Gdpr\Model\Config\Source\OrderPendingStatuses
1
0
- gdpr/erasure/allowed_states
+ gdpr/erasure/allowed_statuses
diff --git a/etc/config.xml b/etc/config.xml
index b03705c..829845e 100755
--- a/etc/config.xml
+++ b/etc/config.xml
@@ -126,7 +126,7 @@
1095
0 1 * * *
3650
- canceled,closed,complete
+ canceled,closed,complete
1