58 lines
1.9 KiB
Go
Executable file
58 lines
1.9 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 *int `json:"activeCompanyId,omitempty"`
|
|
}
|
|
|
|
// UserInfo represents basic user information in responses
|
|
type UserInfo struct {
|
|
ID int `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 int `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"`
|
|
}
|
|
|
|
// User represents a generic user profile
|
|
type User struct {
|
|
ID int `json:"id"`
|
|
Name string `json:"name"`
|
|
Email string `json:"email"`
|
|
Role string `json:"role"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
CompanyID *string `json:"companyId,omitempty"`
|
|
}
|