feat: automatic product archiving

This commit is contained in:
imperosol
2025-09-14 01:36:46 +02:00
parent 289ffe1109
commit dc4e01ff9c
6 changed files with 160 additions and 15 deletions

12
counter/tasks.py Normal file
View File

@@ -0,0 +1,12 @@
# Create your tasks here
from celery import shared_task
from counter.models import Product
@shared_task
def archive_product(product_id: int):
product = Product.objects.get(id=product_id)
product.archived = True
product.save()