update config
This commit is contained in:
@@ -2,6 +2,7 @@ package entity
|
||||
|
||||
import (
|
||||
"enaklo-pos-be/internal/constants"
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -12,6 +13,16 @@ type MemberRegistrationRequest struct {
|
||||
BirthDate time.Time `json:"birth_date"`
|
||||
BranchID int64 `json:"branch_id" validate:"required"`
|
||||
CashierID int64 `json:"cashier_id" validate:"required"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
func (m *MemberRegistrationRequest) GetHashPassword() string {
|
||||
hashedPassword, err := bcrypt.GenerateFromPassword([]byte(m.Password), bcrypt.DefaultCost)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
return string(hashedPassword)
|
||||
}
|
||||
|
||||
type MemberRegistrationResponse struct {
|
||||
@@ -35,6 +46,7 @@ type MemberRegistration struct {
|
||||
UpdatedAt time.Time `json:"updated_at,omitempty"`
|
||||
BranchID int64 `json:"branch_id"`
|
||||
CashierID int64 `json:"cashier_id"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
type MemberVerificationRequest struct {
|
||||
@@ -43,6 +55,7 @@ type MemberVerificationRequest struct {
|
||||
}
|
||||
|
||||
type MemberVerificationResponse struct {
|
||||
Auth *AuthenticateUser
|
||||
CustomerID int64 `json:"customer_id"`
|
||||
Name string `json:"name"`
|
||||
Email string `json:"email"`
|
||||
|
||||
Reference in New Issue
Block a user