update config

This commit is contained in:
aditya.siregar
2025-05-03 10:50:41 +07:00
parent d77f7c7981
commit f0a7c6352f
18 changed files with 438 additions and 55 deletions
+13
View File
@@ -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"`