90 lines
1.8 KiB
Go
90 lines
1.8 KiB
Go
package domain
|
|
|
|
import (
|
|
"errors"
|
|
"time"
|
|
)
|
|
|
|
var (
|
|
ErrUserNotFound = errors.New("user not found")
|
|
)
|
|
|
|
type User struct {
|
|
ID int64
|
|
FirstName string
|
|
LastName string
|
|
Email string `json:"email"`
|
|
PhoneNumber string `json:"phone_number"`
|
|
Password []byte
|
|
Role Role
|
|
//
|
|
EmailVerified bool
|
|
PhoneVerified bool
|
|
//
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
//
|
|
SuspendedAt time.Time
|
|
Suspended bool
|
|
//
|
|
CompanyID ValidInt64
|
|
}
|
|
|
|
type RegisterUserReq struct {
|
|
FirstName string
|
|
LastName string
|
|
Email string
|
|
PhoneNumber string
|
|
Password string
|
|
Role string
|
|
Otp string
|
|
ReferralCode string `json:"referral_code"`
|
|
OtpMedium OtpMedium
|
|
}
|
|
type CreateUserReq struct {
|
|
FirstName string
|
|
LastName string
|
|
Email string
|
|
PhoneNumber string
|
|
Password string
|
|
Role string
|
|
Suspended bool
|
|
CompanyID ValidInt64
|
|
}
|
|
type ResetPasswordReq struct {
|
|
Email string
|
|
PhoneNumber string
|
|
Password string
|
|
Otp string
|
|
OtpMedium OtpMedium
|
|
}
|
|
type UpdateUserReq struct {
|
|
UserId int64
|
|
FirstName ValidString
|
|
LastName ValidString
|
|
Suspended ValidBool
|
|
|
|
CompanyID ValidInt64
|
|
}
|
|
|
|
type UpdateUserReferalCode struct {
|
|
UserID int64
|
|
Code string
|
|
}
|
|
|
|
type GetCashier struct {
|
|
ID int64 `json:"id"`
|
|
FirstName string `json:"first_name"`
|
|
LastName string `json:"last_name"`
|
|
Email string `json:"email"`
|
|
PhoneNumber string `json:"phone_number"`
|
|
Role Role `json:"role"`
|
|
EmailVerified bool `json:"email_verified"`
|
|
PhoneVerified bool `json:"phone_verified"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
SuspendedAt time.Time `json:"suspended_at"`
|
|
Suspended bool `json:"suspended"`
|
|
BranchID int64 `json:"branch_id"`
|
|
}
|