Skip to content

Commit

Permalink
fix: refactoring user fields
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorAmaralC committed Nov 29, 2023
1 parent c1fe215 commit 2c21a2f
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 76 deletions.
35 changes: 17 additions & 18 deletions gestao/db/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,39 @@ class Meta(BaseMeta):

id: str = ormar.String(max_length=200, primary_key=True)
fullName: str = ormar.String(max_length=200)
warName: Optional[str] = ormar.String(max_length=200, unique=True, nullable=True)
warName: str = ormar.String(max_length=200, nullable=True)
registration: str = ormar.String(max_length=200, unique=True)
birthDate: date = ormar.Date()
rg: str = ormar.String(max_length=200, unique=True)
cpf: str = ormar.String(max_length=200, unique=True)
placeOfBirth: str = ormar.String(max_length=200)
ufNatural: str = ormar.String(max_length=100)
marital_status: str = ormar.String(max_length=200)
zipcode: str = ormar.String(max_length=100)
civilState: str = ormar.String(max_length=200, nullable=True)
cep: str = ormar.String(max_length=100)
address: str = ormar.String(max_length=200)
number: str = ormar.String(max_length=100)
number: str = ormar.String(max_length=100, nullable=True)
neighborhood: str = ormar.String(max_length=100, nullable=True)
city: str = ormar.String(max_length=100)
complement: str = ormar.String(max_length=200, nullable=True)
uf: str = ormar.String(max_length=100)
complement: str = ormar.String(max_length=200)
email: str = ormar.String(max_length=200)
cellphone: str = ormar.String(max_length=200)
phone: str = ormar.String(max_length=200)
phone: str = ormar.String(max_length=200, nullable=True)
gender: str = ormar.String(max_length=200)
motherName: str = ormar.String(max_length=200)
fatherName: str = ormar.String(max_length=200)
scolarity: str = ormar.String(max_length=200)
religion: str = ormar.String(max_length=200)
bloodType: str = ormar.String(max_length=200)
function: str = ormar.String(max_length=200)
actualSituation: str = ormar.String(max_length=200)
fatherName: str = ormar.String(max_length=200, nullable=True)
scolarity: str = ormar.String(max_length=200, nullable=True)
religion: str = ormar.String(max_length=200, nullable=True)
bloodType: str = ormar.String(max_length=200, nullable=True)
actualWorkSituation: str = ormar.String(max_length=200)
admissionDate: date = ormar.Date()
role: str = ormar.String(max_length=200)
jobRole: str = ormar.String(max_length=200, nullable=True)
bodyOfLaw: str = ormar.String(max_length=200)
lotation: str = ormar.String(max_length=200)
workstation: Optional[str] = ormar.String(max_length=200, nullable=True)

lotation: str = ormar.String(max_length=200, nullable=True)
workPost: str = ormar.String(max_length=200, nullable=True)
systemRole: str = ormar.String(max_length=200, nullable=True)
password: str = ormar.String(max_length=200, nullable=True)
status: str = ormar.String(max_length=200, default="active")
dispatcher: str = ormar.String(max_length=200)
dispatched_date: date = ormar.Date()
created_at: datetime = ormar.DateTime(timezone=True, default=datetime.now)
updated_at: datetime = ormar.DateTime(
timezone=True,
Expand Down
114 changes: 56 additions & 58 deletions gestao/web/api/user/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from pydantic import BaseModel


class CreateUserDependentDTO(BaseModel):
name: str
birth_date: date
Expand All @@ -13,70 +12,69 @@ class CreateUserDependentDTO(BaseModel):
phone: str
pensioner: Optional[str]


class CreateUserDTO(BaseModel):
name: str
fullName: str
warName: Optional[str]
registration: str
birthDate: date
rg: str
cpf: str
placeOfBirth: str
ufNatural: str
civilState: Optional[str]
cep: str
address: str
neighborhood: str
number: Optional[str]
city: str
state: str
zipcode: str
cpf: str
rg: str
birth_date: date
place_of_birth: str
blood_type: str
gender: str
father_name: str
mother_date: str
position: str
occupancy: str
admission_date: date
situation: str
phone: str
uf: str
complement: Optional[str]
email: str
marital_status: str
education: str
registration: str
role: str
category: str
pattern: str
dispatcher: str
dispatched_date: date
cellphone: str
phone: Optional[str]
gender: str
motherName: str
fatherName: Optional[str]
scolarity: Optional[str]
religion: Optional[str]
bloodType: Optional[str]
function: str
actualWorkSituation: str
admissionDate: date
bodyOfLaw: str
lotation: Optional[str]
workPost: Optional[str]
systemRole: Optional[str]
dependents: Optional[List[CreateUserDependentDTO]]
workstation: Optional[str]
nickname: Optional[str]


class UpdateUserDTO(BaseModel):
name: Optional[str]
fullName: Optional[str]
warName: Optional[str]
registration: Optional[str]
birthDate: Optional[date]
rg: Optional[str]
cpf: Optional[str]
placeOfBirth: Optional[str]
ufNatural: Optional[str]
civilState: Optional[str]
cep: Optional[str]
address: Optional[str]
neighborhood: Optional[str]
number: Optional[str]
city: Optional[str]
state: Optional[str]
zipcode: Optional[str]
cpf: Optional[str]
rg: Optional[str]
birth_date: Optional[date]
place_of_birth: Optional[str]
blood_type: Optional[str]
gender: Optional[str]
father_name: Optional[str]
mother_date: Optional[str]
position: Optional[str]
occupancy: Optional[str]
admission_date: Optional[date]
situation: Optional[str]
phone: Optional[str]
uf: Optional[str]
complement: Optional[str]
email: Optional[str]
marital_status: Optional[str]
education: Optional[str]
registration: Optional[str]
role: Optional[str]
category: Optional[str]
pattern: Optional[str]
dispatcher: Optional[str]
dispatched_date: Optional[date]
workstation: Optional[str]
nickname: Optional[str]
status: Optional[str]
cellphone: Optional[str]
phone: Optional[str]
gender: Optional[str]
motherName: Optional[str]
fatherName: Optional[str]
scolarity: Optional[str]
religion: Optional[str]
bloodType: Optional[str]
function: Optional[str]
actualWorkSituation: Optional[str]
admissionDate: Optional[date]
bodyOfLaw: Optional[str]
lotation: Optional[str]
workPost: Optional[str]
systemRole: Optional[str]

0 comments on commit 2c21a2f

Please sign in to comment.