Frontend: - Implementar máscara de entrada de telefone para números BR ((XX) XXXXX-XXXX). - Atualizar formulário de cadastro para enviar dados completos do perfil do candidato (endereço, formação, habilidades, etc.). - Corrigir problemas de idioma misto na página de Detalhes da Vaga e adicionar traduções faltantes. Backend: - Atualizar modelo de Usuário, Entidade e DTOs para incluir campos de perfil (Data de Nascimento, Endereço, Formação, etc.). - Atualizar UserRepository para persistir e recuperar os dados estendidos do usuário no PostgreSQL. - Atualizar RegisterCandidateUseCase para mapear campos de entrada para a entidade Usuário.
73 lines
2.5 KiB
Go
Executable file
73 lines
2.5 KiB
Go
Executable file
package dto
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// LoginRequest represents the login request payload
|
|
type LoginRequest struct {
|
|
Identifier string `json:"identifier" validate:"required,min=3"`
|
|
Password string `json:"password" validate:"required,min=8"`
|
|
}
|
|
|
|
// LoginResponse represents the login response
|
|
type LoginResponse struct {
|
|
Token string `json:"token"`
|
|
User UserInfo `json:"user"`
|
|
Companies []CompanyInfo `json:"companies,omitempty"`
|
|
ActiveCompanyID *string `json:"activeCompanyId,omitempty"`
|
|
}
|
|
|
|
// UserInfo represents basic user information in responses
|
|
type UserInfo struct {
|
|
ID string `json:"id"`
|
|
Identifier string `json:"identifier"`
|
|
Role string `json:"role"`
|
|
FullName string `json:"fullName"`
|
|
Language string `json:"language"`
|
|
}
|
|
|
|
// CompanyInfo represents basic company information
|
|
type CompanyInfo struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
Role string `json:"role"` // Role in this company (admin or recruiter)
|
|
}
|
|
|
|
// RegisterRequest represents user registration
|
|
type RegisterRequest struct {
|
|
Identifier string `json:"identifier" validate:"required,min=3,max=50"`
|
|
Password string `json:"password" validate:"required,min=8"`
|
|
FullName string `json:"fullName" validate:"required"`
|
|
Phone *string `json:"phone,omitempty"`
|
|
WhatsApp *string `json:"whatsapp,omitempty"`
|
|
LineID *string `json:"lineId,omitempty"`
|
|
Instagram *string `json:"instagram,omitempty"`
|
|
Language string `json:"language" validate:"required,oneof=pt en es ja"`
|
|
Role string `json:"role" validate:"required,oneof=candidate recruiter admin"`
|
|
|
|
// Candidate Specific
|
|
BirthDate string `json:"birthDate,omitempty"` // YYYY-MM-DD
|
|
Address *string `json:"address,omitempty"`
|
|
City *string `json:"city,omitempty"`
|
|
State *string `json:"state,omitempty"`
|
|
ZipCode *string `json:"zipCode,omitempty"`
|
|
Education *string `json:"education,omitempty"`
|
|
Experience *string `json:"experience,omitempty"`
|
|
Skills *string `json:"skills,omitempty"` // Comma separated or just text
|
|
Objective *string `json:"objective,omitempty"`
|
|
}
|
|
|
|
// User represents a generic user profile
|
|
type User struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
Email string `json:"email"`
|
|
Role string `json:"role"`
|
|
Status string `json:"status"`
|
|
Phone *string `json:"phone,omitempty"`
|
|
Bio *string `json:"bio,omitempty"`
|
|
AvatarUrl *string `json:"avatarUrl,omitempty"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
CompanyID *string `json:"companyId,omitempty"`
|
|
}
|