This commit is contained in:
Alex Shevchuk
2025-08-18 17:12:04 +03:00
commit d84487d238
157 changed files with 160686 additions and 0 deletions

104
internal/auth/domain.go Normal file
View File

@@ -0,0 +1,104 @@
package auth
type (
User struct {
Email string
Password string
FirstName string
SecondName string
Patronymic *string
Number string
Permissions map[string]string
}
RegisterUserRequest struct {
User User
UserType int32
}
RegisterUserResponse struct {
UserId string
}
)
type (
LoginUserRequest struct {
Email string
Password string
}
LoginUserResponse struct {
UserId string `json:"user_id"`
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
}
)
type (
GetUserTokenResponse struct {
AccessToken string `json:"access_token"`
}
)
type (
LogoutUserRequest struct {
RefreshToken string
}
)
type (
GetNewAccessTokenRequest struct {
RefreshToken string
}
GetNewAccessTokenResponse struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
}
)
type (
UserInfoFromToken struct {
UserId string
}
)
type (
GetPermissionsByUsersIdResponse struct {
Balance string
Company string
Employees string
Profile string
Submissions string
Vacancies string
}
)
type (
CheckPermissionsRequest struct {
UserId string
RequiredPermission string
RequiredPermissionLevel string
}
)
type (
ResetPasswordRequest struct {
Email string
NewPassword string
}
)
type (
UserInfo struct {
Email string
FirstName string
SecondName string
Patronymic *string
Permissions map[string]string
UserType int32
}
)
type GetEmailVerificationResponse struct {
EmailVerified bool `json:"email_verified"`
}