37 lines
971 B
Go
37 lines
971 B
Go
package request
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type InitiateRegistrationRequest struct {
|
|
Name string `json:"name" validate:"required"`
|
|
Email string `json:"email" validate:"required,email"`
|
|
Phone string `json:"phone" validate:"required"`
|
|
BirthDate string `json:"birthDate" validate:"required"`
|
|
Password string `json:"password" validate:"required"`
|
|
ConfirmPassword string `json:"confirmPassword" validate:"required"`
|
|
}
|
|
|
|
func (i *InitiateRegistrationRequest) GetBirthdate() (time.Time, error) {
|
|
parsedDate, err := time.Parse("02-01-2006", i.BirthDate)
|
|
if err != nil {
|
|
return time.Time{}, err
|
|
}
|
|
return parsedDate, nil
|
|
}
|
|
|
|
type VerifyOTPRequest struct {
|
|
Token string `json:"token" validate:"required"`
|
|
OTP string `json:"otp" validate:"required"`
|
|
}
|
|
|
|
type ResendOTPRequest struct {
|
|
Token string `json:"token" validate:"required"`
|
|
}
|
|
|
|
type CheckCustomerRequest struct {
|
|
Email string `json:"email"`
|
|
Phone string `json:"phone"`
|
|
}
|