from django.db import models
from django.contrib.auth.models import AbstractUser
from django.db.models.base import Model
import django.utils.timezone as timezone
from django.db.models.query import QuerySet
from apps.system.models import CommonAModel, CommonBModel, Organization, User, Dict, File
from utils.model import SoftModel, BaseModel
from simple_history.models import HistoricalRecords



class Employee(CommonAModel):
    """
    员工信息
    """
    user = models.OneToOneField(User, on_delete=models.CASCADE, related_name='employee_user')
    number = models.CharField('人员编号', max_length=50,null=True, blank=True, unique=True)
    photo = models.CharField('证件照', max_length=1000, null=True, blank=True)
    ID_number = models.CharField('身份证号', max_length=100, null=True, blank=True)
    gender = models.CharField('性别', max_length=10, default='男')
    signature = models.CharField('签名图片', max_length=200, null=True, blank=True)
    class Meta:
        verbose_name = '员工补充信息'
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.name