34 lines
899 B
Go
34 lines
899 B
Go
package domain
|
|
|
|
import "time"
|
|
|
|
// TeamOtp stores password-reset OTPs for team_members (admin panel).
|
|
type TeamOtp struct {
|
|
ID int64
|
|
TeamMemberID int64
|
|
SentTo string
|
|
Medium OtpMedium
|
|
For OtpFor
|
|
Otp string
|
|
Used bool
|
|
UsedAt time.Time
|
|
CreatedAt time.Time
|
|
ExpiresAt time.Time
|
|
}
|
|
|
|
type TeamSendPasswordResetReq struct {
|
|
Email string `json:"email" validate:"required,email"`
|
|
}
|
|
|
|
type TeamResetPasswordReq struct {
|
|
Email string `json:"email" validate:"required,email"`
|
|
Otp string `json:"otp" validate:"required"`
|
|
Password string `json:"password" validate:"required,min=8"`
|
|
}
|
|
|
|
// TeamVerifyPasswordResetRes is returned by GET /team/verifyResetCode (does not consume the OTP).
|
|
type TeamVerifyPasswordResetRes struct {
|
|
Valid bool `json:"valid"`
|
|
Reason string `json:"reason,omitempty"` // missing | invalid | used | expired
|
|
}
|