<commit_before>from django.db import models
from django.utils.translation import ugettext_lazy as _

from cities_light.models import City


PHONENUMBER_TYPE_HOME = 'H'
PHONENUMBER_TYPE_WORK = 'W'
PHONENUMBER_TYPES = (
    (PHONENUMBER_TYPE_HOME, _("home")),
    (PHONENUMBER_TYPE_WORK, _("work")),
)

PHONENUMBER_TECHNOLOGYTYPE_LANDLINE = 'L'
PHONENUMBER_TECHNOLOGYTYPE_MOBILE = 'M'
PHONENUMBER_TECHNOLOGY_TYPES = (
    (PHONENUMBER_TECHNOLOGYTYPE_LANDLINE, _("landline phone")),
    (PHONENUMBER_TECHNOLOGYTYPE_MOBILE, _("mobile phone")),
)

PHYSICALADDRESS_TYPE_FISCAL = 'F'
PHYSICALADDRESS_TYPE_HOME = 'H'
PHYSICALADDRESS_TYPES = (
    (PHYSICALADDRESS_TYPE_FISCAL, _("fiscal")),
    (PHYSICALADDRESS_TYPE_HOME, _("home")),
)

class PhoneNumber(models.Model):
    number = models.CharField(
        _("number"),
        max_length=30
    )
    phonenumber_type = models.CharField(
        _("phone number type"),
        max_length=1,
        choices=PHONENUMBER_TYPES,
        default=PHONENUMBER_TYPE_WORK
    )
    technology_type = models.CharField(
        _("technology type"),
        max_length=1,
        choices=PHONENUMBER_TECHNOLOGY_TYPES,
        default=PHONENUMBER_TECHNOLOGYTYPE_MOBILE
    )

    def __str__(self):
        return self.number

    class Meta:
        verbose_name = _("phone number")
        verbose_name_plural = _("phone numbers")
        default_permissions = ('view', 'add', 'change', 'delete')


class ExtraEmailAddress(models.Model):
    """
    Employees and clients may have more than one email address.
    When in doubt, the official should always be the one in 
    'django.contrib.auth.models.User.email'.
    """
    email = models.EmailField(
        _("email address")
    )

    def __str__(self):
        return self.email

    class Meta:
        verbose_name = _("extra email address")
        verbose_name_plural = _("extra email addresses")
        default_permissions = ('view', 'add', 'change', 'delete')


class PhysicalAddress(models.Model):
    """
    Physical address are of high importance due to impositive regulations.
    """
    address_type = models.CharField(
        _("address type"),
        max_length=1,
        choices=PHYSICALADDRESS_TYPES,
        default=PHYSICALADDRESS_TYPE_FISCAL
    )
    street_name = models.CharField(
        _("street name"),
        max_length=150
    )
    street_number = models.CharField(
        _("street number"),
        max_length=10
    )
    floor_number = models.CharField(
        _("floor number"),
        max_length=4,
        blank=True,
        null=True
    )
    apartment_number = models.CharField(
        _("apartment number"),
        max_length=6,
        blank=True,
        null=True
    )
    city = models.ForeignKey(
        City,
        verbose_name=_('city')
    )
    postal_code = models.CharField(
        _("postal code"),
        max_length=20
    )

    class Meta:
        verbose_name = _("physical address")
        verbose_name_plural = _("physical addresses")
        default_permissions = ('view', 'add', 'change', 'delete')
    

class PersonProfile(models.Model):
    """
    This is an abstract class where Employee and Client inherit their
    main attributes.
    """
    birth_date = models.DateField(
        _("birth date"),
        blank=True,
        null=True
    )
    phone_numbers = models.ManyToManyField(
        PhoneNumber,
        blank=True,
        null=True,
        verbose_name=_('phone numbers')
    )
    extra_emails = models.ManyToManyField(
        ExtraEmailAddress,
        blank=True,
        null=True,
        verbose_name=_('extra email addresses')
    )

    class Meta:
        abstract = True
<commit_msg>ADD initial Employee and Client<commit_after>from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User

from cities_light.models import City


PHONENUMBER_TYPE_HOME = 'H'
PHONENUMBER_TYPE_WORK = 'W'
PHONENUMBER_TYPES = (
    (PHONENUMBER_TYPE_HOME, _("home")),
    (PHONENUMBER_TYPE_WORK, _("work")),
)

PHONENUMBER_TECHNOLOGYTYPE_LANDLINE = 'L'
PHONENUMBER_TECHNOLOGYTYPE_MOBILE = 'M'
PHONENUMBER_TECHNOLOGY_TYPES = (
    (PHONENUMBER_TECHNOLOGYTYPE_LANDLINE, _("landline phone")),
    (PHONENUMBER_TECHNOLOGYTYPE_MOBILE, _("mobile phone")),
)

PHYSICALADDRESS_TYPE_FISCAL = 'F'
PHYSICALADDRESS_TYPE_HOME = 'H'
PHYSICALADDRESS_TYPES = (
    (PHYSICALADDRESS_TYPE_FISCAL, _("fiscal")),
    (PHYSICALADDRESS_TYPE_HOME, _("home")),
)

class PhoneNumber(models.Model):
    number = models.CharField(
        _("number"),
        max_length=30
    )
    phonenumber_type = models.CharField(
        _("phone number type"),
        max_length=1,
        choices=PHONENUMBER_TYPES,
        default=PHONENUMBER_TYPE_WORK
    )
    technology_type = models.CharField(
        _("technology type"),
        max_length=1,
        choices=PHONENUMBER_TECHNOLOGY_TYPES,
        default=PHONENUMBER_TECHNOLOGYTYPE_MOBILE
    )

    def __str__(self):
        return self.number

    class Meta:
        verbose_name = _("phone number")
        verbose_name_plural = _("phone numbers")
        default_permissions = ('view', 'add', 'change', 'delete')


class ExtraEmailAddress(models.Model):
    """
    Employees and clients may have more than one email address.
    When in doubt, the official should always be the one in 
    'django.contrib.auth.models.User.email'.
    """
    email = models.EmailField(
        _("email address")
    )

    def __str__(self):
        return self.email

    class Meta:
        verbose_name = _("extra email address")
        verbose_name_plural = _("extra email addresses")
        default_permissions = ('view', 'add', 'change', 'delete')


class PhysicalAddress(models.Model):
    """
    Physical address are of high importance due to impositive regulations.
    """
    address_type = models.CharField(
        _("address type"),
        max_length=1,
        choices=PHYSICALADDRESS_TYPES,
        default=PHYSICALADDRESS_TYPE_FISCAL
    )
    street_name = models.CharField(
        _("street name"),
        max_length=150
    )
    street_number = models.CharField(
        _("street number"),
        max_length=10
    )
    floor_number = models.CharField(
        _("floor number"),
        max_length=4,
        blank=True,
        null=True
    )
    apartment_number = models.CharField(
        _("apartment number"),
        max_length=6,
        blank=True,
        null=True
    )
    city = models.ForeignKey(
        City,
        verbose_name=_('city')
    )
    postal_code = models.CharField(
        _("postal code"),
        max_length=20
    )

    class Meta:
        verbose_name = _("physical address")
        verbose_name_plural = _("physical addresses")
        default_permissions = ('view', 'add', 'change', 'delete')
    

class PersonProfile(models.Model):
    """
    This is an abstract class where Employee and Client inherit their
    main attributes.
    """
    birth_date = models.DateField(
        _("birth date"),
        blank=True,
        null=True
    )
    phone_numbers = models.ManyToManyField(
        PhoneNumber,
        blank=True,
        null=True,
        verbose_name=_('phone numbers')
    )
    extra_emails = models.ManyToManyField(
        ExtraEmailAddress,
        blank=True,
        null=True,
        verbose_name=_('extra email addresses')
    )

    class Meta:
        abstract = True


GENRE_TYPE_MALE = 'M'
GENRE_TYPE_FEMALE = 'F'
GENRE_TYPES = (
    (GENRE_TYPE_MALE, _('Male'))
    (GENRE_TYPE_FEMALE, _('Female'))
)

class EmployeeProfile(PersonProfile):
    """
    All Employees must have a User, whereas they'll use the system or not.
    """
    user = models.OneToOneField(
        User
        verbose_name=_('user')
    )
    genre = models.CharField(
        _('genre'),
        max_length=1,
        choices=GENRE_TYPES,
    )
    member_since = models.DateField(
        _('member_since'),
        blank=True,
        null=True
    )


class ClientProfile(PersonProfile):
    """
    Clients don't have a User.
    """
    pass

{'fraction_non_alphanumeric': 0.10424377004687886, 'fraction_numerical': 0.0035775968418455466, 'mean_word_length': 2.7136967475950526, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3259104', 'n_tokens_mistral': 2640, 'n_tokens_neox': 2614, 'n_words': 518}