import json

from app.service.design_batch.design_batch_celery import batch_design
from app.service.design_batch.utils.MQ import publish_status


async def start_design_batch_generate(data, file):
    generate_clothes_task = batch_design.delay(json.loads(file.decode())['objects'], data.tasks_id, data.file_name)
    print(generate_clothes_task)
    publish_status(data.tasks_id, "0/100", "")
    return {"task_id": data.tasks_id}
