You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the system to expire orders that are not paid, we need a solution to handle expired orders.
The proposition is to have a task, that will anonymize the expired orders after some time.
For all expired orders older than TTL, we should remove everything that is related to user.
1. General Assumptions
We are introducing a new Celery task that will be responsible for anonymizing all expired orders after exceeding the provided TTL.
Everything related to the user and attached to the order should be anonymized, including order.user, order.email, order.shipping_address, order.billing_address, and order.user_email.
The Celery task should be capable of handling high load. As an example implementation, we can use the one from issue #11257. The Celery beat should trigger the task once per day, and we should ensure that we do not call all high load Celery tasks at the same time.
The TTL (time-to-live) for anonymizing expired orders will be controlled by staff users through channel settings, similar to the one used for controlling expiring orders. Staff users will be able to provide a value in days (new scalar) within a range defined by Saleor, which is proposed to be from 1 to 60 days. The default value is 30 days.
For example, if an order expires on 2023-Jan-01 00:00:00 with the default value, it will be anonymized on 2023-Jan-31.
Acceptance Criteria
A staff user can set a Time To Live (TTL) for anonymizing orders.
Settings can be set by a user with permissions: MANAGE_ORDERS or MANAGE_CHANNELS
Once the TTL has expired, the order should have all user details removed.
2. API changes
"""The `Day` scalar type represents number of days by integer value."""scalarDayinputOrderSettingsInput@doc(category: "Orders") {
"""Anonymize expired orders time in days. Default 30. Enter 0 or null to disable. """anonymizeExpiredOrdersAfter: Day
}
typeChannel {
...
anonymizeExpiredOrdersAfter: Day!
}
korycins
added
payments
Issues related to payments implementation
rfc
Request For Comments: blueprints of upcoming changes.
order
and removed
payments
Issues related to payments implementation
labels
Apr 13, 2023
Problem
With the system to expire orders that are not paid, we need a solution to handle expired orders.
The proposition is to have a task, that will anonymize the expired orders after some time.
For all expired orders older than TTL, we should remove everything that is related to user.
1. General Assumptions
We are introducing a new Celery task that will be responsible for anonymizing all expired orders after exceeding the provided TTL.
Everything related to the user and attached to the order should be anonymized, including
order.user
,order.email
,order.shipping_address
,order.billing_address
, andorder.user_email
.The Celery task should be capable of handling high load. As an example implementation, we can use the one from issue #11257. The Celery beat should trigger the task once per day, and we should ensure that we do not call all high load Celery tasks at the same time.
The TTL (time-to-live) for anonymizing expired orders will be controlled by staff users through channel settings, similar to the one used for controlling expiring orders. Staff users will be able to provide a value in days (new scalar) within a range defined by Saleor, which is proposed to be from 1 to 60 days. The default value is 30 days.
For example, if an order expires on 2023-Jan-01 00:00:00 with the default value, it will be anonymized on 2023-Jan-31.
Acceptance Criteria
2. API changes
3. Database changes
The
expired_at
field will be used to determine whether an order should be anonymized.5. To Do list
Tasks
The text was updated successfully, but these errors were encountered: