from uuid import uuid4

from tortoise import models, fields


class MemberModel(models.Model):
    """Member session

    :param: member_id - Identifier member
    :type member_id: str

    :param: email - Email address
    :param: email_verified - If the user has validated their email
    :param: password - Password
    :param: created_at - Date of creation
    :param: updated_at - Date of update
    """

    member_id = fields.UUIDField(pk=True, title='Identifier', description='Identifier', default=uuid4)
    email = fields.CharField(max_length=200, unique=True)
    email_verified = fields.BooleanField(default=False)
    password = fields.CharField(max_length=60)
    created_at = fields.DatetimeField(auto_now_add=True)
    updated_at = fields.DatetimeField(now_add=True, auto_now_add=True)

    class PydanticMeta:
        exclude = ['created_at', 'updated_at']

    class Meta:
        table = 'member'


Member = MemberModel

from uuid import uuid4

from tortoise import models, fields


class MemberModel(models.Model):
    """Member session

    :param: member_id - Identifier member
    :type member_id: str

    :param: email - Email address
    :param: email_verified - If the user has validated their email
    :param: password - Password
    :param: created_at - Date of creation
    :param: updated_at - Date of update
    """

    member_id = fields.UUIDField(pk=True, title='Identifier', description='Identifier', default=uuid4)
    email = fields.CharField(max_length=200, unique=True)
    email_verified = fields.BooleanField(default=False)
    password = fields.CharField(max_length=60)
    created_at = fields.DatetimeField(auto_now_add=True)
    updated_at = fields.DatetimeField(now_add=True, auto_now_add=True)

    class PydanticMeta:
        exclude = ['created_at', 'updated_at']

    class Meta:
        table = 'member'


Member = MemberModel

Member session      :param: member_id - Identifier member     :type member_id: str      :param: email - Email address     :param: email_verified - If the user has validated their email     :param: password - Password     :param: created_at - Date of creation     :param: updated_at - Date of update