from django.db import models
from shop_management.models.base import DataRoot
from shop_management.models.data.shop import Shop
from django.utils import timezone


# A Product model that holds details about each product.
class Employee(DataRoot):
    shop = models.ForeignKey(Shop,on_delete=models.CASCADE,related_name='employee')
    name = models.CharField(max_length=255,null=True,blank=True)
    email = models.EmailField(null=True,blank=True)
    contact = models.CharField(max_length=14,null=True,blank=True)
    address = models.CharField(max_length=200,null=True,blank=True)
    salary = models.DecimalField(max_digits=12,decimal_places=2,null=True,blank=True)
    age = models.IntegerField(null=True,blank=True)
    contract_date = models.DateField(default=timezone.now)
    contract_durations = models.CharField(max_length=200,null=True,blank=True)

    def __str__(self):
        return self.name
    
    
