Skip to content

Instantly share code, notes, and snippets.

@jamesperes-zz
Created May 29, 2020 02:51
Show Gist options
  • Save jamesperes-zz/f4e42022f6a9749ac33f3d0969ee6fcf to your computer and use it in GitHub Desktop.
Save jamesperes-zz/f4e42022f6a9749ac33f3d0969ee6fcf to your computer and use it in GitHub Desktop.

Revisions

  1. @jamesperes jamesperes created this gist May 29, 2020.
    22 changes: 22 additions & 0 deletions entity.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    from dataclasses import dataclass


    @dataclass
    class UserInfo():
    """Entity to establish User info."""

    id: int = None
    type: str = None
    company_number: int = None
    phone: int = None
    name: str = None

    def __bool__(self):
    """Validate if attributes are empties.
    Returns:
    False if id is empty. True if at least on is not
    empty.
    """
    return bool(self.id)