2022-05-03 15:26:32 +05:30
|
|
|
package model
|
|
|
|
|
|
2022-05-04 14:50:15 +05:30
|
|
|
import "github.com/pkg/errors"
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
ErrorTokenExpired = errors.New("Token is expired")
|
|
|
|
|
)
|
|
|
|
|
|
2022-05-03 15:26:32 +05:30
|
|
|
type InviteRequest struct {
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
Email string `json:"email"`
|
|
|
|
|
Role string `json:"role"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type InviteResponse struct {
|
|
|
|
|
Email string `json:"email"`
|
|
|
|
|
InviteToken string `json:"inviteToken"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type InvitationResponseObject struct {
|
|
|
|
|
Email string `json:"email" db:"email"`
|
|
|
|
|
Name string `json:"name" db:"name"`
|
|
|
|
|
Token string `json:"token" db:"token"`
|
|
|
|
|
CreatedAt int64 `json:"createdAt" db:"created_at"`
|
|
|
|
|
Role string `json:"role" db:"role"`
|
|
|
|
|
Organization string `json:"organization" db:"organization"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type LoginRequest struct {
|
|
|
|
|
Email string `json:"email"`
|
|
|
|
|
Password string `json:"password"`
|
|
|
|
|
RefreshToken string `json:"refreshToken"`
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-06 20:13:30 +05:30
|
|
|
type UserJwtObject struct {
|
2022-05-03 15:26:32 +05:30
|
|
|
AccessJwt string `json:"accessJwt"`
|
|
|
|
|
AccessJwtExpiry int64 `json:"accessJwtExpiry"`
|
|
|
|
|
RefreshJwt string `json:"refreshJwt"`
|
|
|
|
|
RefreshJwtExpiry int64 `json:"refreshJwtExpiry"`
|
2022-10-06 20:13:30 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type LoginResponse struct {
|
|
|
|
|
UserJwtObject
|
|
|
|
|
UserId string `json:"userId"`
|
2022-05-03 15:26:32 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ChangePasswordRequest struct {
|
|
|
|
|
UserId string `json:"userId"`
|
|
|
|
|
OldPassword string `json:"oldPassword"`
|
|
|
|
|
NewPassword string `json:"newPassword"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ResetPasswordEntry struct {
|
|
|
|
|
UserId string `json:"userId" db:"user_id"`
|
|
|
|
|
Token string `json:"token" db:"token"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type UserRole struct {
|
|
|
|
|
UserId string `json:"user_id"`
|
|
|
|
|
GroupName string `json:"group_name"`
|
|
|
|
|
}
|