Update Member
This commit is contained in:
@@ -189,6 +189,7 @@ func (o *UserDB) SetDeleted(updatedby int64) {
|
||||
o.Status = userstatus.Inactive
|
||||
}
|
||||
|
||||
type MemberList []*Customer
|
||||
type CustomerList []*UserDB
|
||||
|
||||
type CustomerSearch struct {
|
||||
@@ -210,3 +211,9 @@ func (b *CustomerList) ToCustomerList() []*Customer {
|
||||
}
|
||||
return users
|
||||
}
|
||||
|
||||
type MemberSearch struct {
|
||||
Search string
|
||||
Limit int
|
||||
Offset int
|
||||
}
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
package entity
|
||||
|
||||
import "time"
|
||||
|
||||
type CustomerResolutionRequest struct {
|
||||
ID *int64
|
||||
Name string
|
||||
Email string
|
||||
PhoneNumber string
|
||||
BirthDate time.Time
|
||||
}
|
||||
|
||||
type CustomerCheckResponse struct {
|
||||
Exists bool
|
||||
Customer *Customer
|
||||
Message string
|
||||
}
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"enaklo-pos-be/internal/constants"
|
||||
"time"
|
||||
)
|
||||
|
||||
type MemberRegistrationRequest struct {
|
||||
Name string `json:"name" validate:"required"`
|
||||
Email string `json:"email" validate:"required,email"`
|
||||
Phone string `json:"phone" validate:"required"`
|
||||
BirthDate time.Time `json:"birth_date"`
|
||||
BranchID int64 `json:"branch_id" validate:"required"`
|
||||
CashierID int64 `json:"cashier_id" validate:"required"`
|
||||
}
|
||||
|
||||
type MemberRegistrationResponse struct {
|
||||
Token string `json:"token"`
|
||||
Status string `json:"status"`
|
||||
ExpiresAt time.Time `json:"expires_at"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
type MemberRegistration struct {
|
||||
ID string `json:"id"`
|
||||
Token string `json:"token"`
|
||||
Name string `json:"name"`
|
||||
Email string `json:"email"`
|
||||
Phone string `json:"phone"`
|
||||
BirthDate time.Time `json:"birth_date"`
|
||||
OTP string `json:"-"` // Not exposed in JSON responses
|
||||
Status constants.RegistrationStatus `json:"status"`
|
||||
ExpiresAt time.Time `json:"expires_at"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at,omitempty"`
|
||||
BranchID int64 `json:"branch_id"`
|
||||
CashierID int64 `json:"cashier_id"`
|
||||
}
|
||||
|
||||
type MemberVerificationRequest struct {
|
||||
Token string `json:"token" validate:"required"`
|
||||
OTP string `json:"otp" validate:"required"`
|
||||
}
|
||||
|
||||
type MemberVerificationResponse struct {
|
||||
CustomerID int64 `json:"customer_id"`
|
||||
Name string `json:"name"`
|
||||
Email string `json:"email"`
|
||||
Phone string `json:"phone"`
|
||||
Points int `json:"points"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
|
||||
type MemberRegistrationStatus struct {
|
||||
Token string `json:"token"`
|
||||
Status string `json:"status"`
|
||||
ExpiresAt time.Time `json:"expires_at"`
|
||||
IsExpired bool `json:"is_expired"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
type ResendOTPRequest struct {
|
||||
Token string `json:"token" validate:"required"`
|
||||
}
|
||||
|
||||
type ResendOTPResponse struct {
|
||||
Token string `json:"token"`
|
||||
ExpiresAt time.Time `json:"expires_at"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
@@ -75,7 +75,7 @@ type OrderItem struct {
|
||||
ItemID int64 `gorm:"type:int;column:item_id"`
|
||||
ItemType string `gorm:"type:varchar;column:item_type"`
|
||||
Price float64 `gorm:"type:numeric;not null;column:price"`
|
||||
Quantity int `gorm:"type:int;column:qty"`
|
||||
Quantity int `gorm:"type:int;column:quantity"`
|
||||
CreatedAt time.Time `gorm:"autoCreateTime;column:created_at"`
|
||||
UpdatedAt time.Time `gorm:"autoUpdateTime;column:updated_at"`
|
||||
CreatedBy int64 `gorm:"type:int;column:created_by"`
|
||||
|
||||
@@ -49,6 +49,8 @@ type Customer struct {
|
||||
SiteName string
|
||||
PartnerName string
|
||||
ResetPassword bool
|
||||
CustomerID string
|
||||
BirthDate time.Time
|
||||
}
|
||||
|
||||
type AuthenticateUser struct {
|
||||
|
||||
Reference in New Issue
Block a user