from django.db.models.signals import post_save
from apps.system.models import User
from django.dispatch import receiver
from apps.hrm.models import Employee
from apps.vm.models import Visitor


# @receiver(post_save, sender=Employee)
# def updateVisitor(sender, instance, created, **kwargs):
#     # if created:
#     if instance.type == 'visitor':
#         Visitor.objects.get_or_create(create_by=instance.user, employee=instance,
#                                       defaults={
#                                           'employee': instance,
#                                           'name': instance.name,
#                                           'phone': instance.phone,
#                                           'photo': instance.photo,
#                                           'id_number': instance.id_number,
#                                           'create_by': instance.user
#                                       })
