from django.db import models
from common.models.base import TimeStampedModel
from producers_products.models.producers_products import ProducersProducts
from producers_products_colors.models.producers_products_color import ProductsColor
from producers_product_type_and_size.models.product_type_and_size import ProductsTypeAndSize

class ProductsVariants(TimeStampedModel):
    product = models.ForeignKey(ProducersProducts,on_delete=models.CASCADE,related_name="product_variant")
    products_color = models.ForeignKey(ProductsColor,on_delete=models.CASCADE,related_name="product_variant_color")
    product_type_and_size = models.ForeignKey(ProductsTypeAndSize,on_delete=models.CASCADE,related_name="product_variant_type_and_size")
    quantity = models.PositiveIntegerField()

    class Meta:
        ordering = ['id']
        verbose_name_plural = 'producers_products_variants'