
    Mfh                           G d  d          Z dS )c                   "    e Zd ZddZd Zd ZdS )ProductGenerationServiceNc                 0    || _         || _        || _        dS )u   
        :param product:        instance de Product (obligatoire)
        :param tag_service:    instance de TagService (obligatoire)
        :param image_service:  instance d’ImageService ou None (optionnel)
        N)producttag_serviceimage_service)selfr   r   r   s       C/var/www/sites/Harken/General/Product/product_generation_service.py__init__z!ProductGenerationService.__init__   s!     &*    c                 `   | j                                         }| j                                        |d         d<   | j        r2| j                                        d         d         }|r||d         d<   d|d         v r/d |d         d         D             }|r||d         d<   n	|d         d= |S )Nr   tagsimagesoptionsc                     g | ]}||S  r   ).0opts     r	   
<listcomp>zGProductGenerationService.get_formatted_product_data.<locals>.<listcomp>   s    HHHsCHsHHHr   )r   to_data_array_without_imagesr   get_tagsr   to_data_array_only_images)r   datar   cleaneds       r	   get_formatted_product_dataz3ProductGenerationService.get_formatted_product_data   s    |88:: #'"2";";"="=Y  	3'AACCINxXF 3,2Y) Y''HHd9oi&@HHHG /-4Y	**OI.r   c                 F    | j         sd S | j                                         S N)r   r   )r   s    r	   get_images_dataz(ProductGenerationService.get_images_data(   s'    ! 	4!;;===r   r   )__name__
__module____qualname__r
   r   r   r   r   r	   r   r      sF        + + + +  2> > > > >r   r   N)r   r   r   r	   <module>r!      s7   *> *> *> *> *> *> *> *> *> *>r   