Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type CreateCustomerPayload ¶
type CreateCustomerPayload struct { PhoneNumber string `json:"phoneNumber"` Name string `json:"name"` }
func (CreateCustomerPayload) Validate ¶
func (p CreateCustomerPayload) Validate() error
type CreateStaffPayload ¶
type CreateStaffPayload struct { PhoneNumber string `json:"phoneNumber"` Name string `json:"name"` Password string `json:"password"` }
func (CreateStaffPayload) Validate ¶
func (p CreateStaffPayload) Validate() error
type CustomerResponse ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func (*Handler) CreateCustomer ¶
func (h *Handler) CreateCustomer(w http.ResponseWriter, r *http.Request)
func (*Handler) CreateStaff ¶
func (h *Handler) CreateStaff(w http.ResponseWriter, r *http.Request)
func (*Handler) ListCustomers ¶
func (h *Handler) ListCustomers(w http.ResponseWriter, r *http.Request)
func (*Handler) StaffLogin ¶
func (h *Handler) StaffLogin(w http.ResponseWriter, r *http.Request)
type ListCustomerPayload ¶
type LoginPayload ¶
type LoginPayload struct { PhoneNumber string `json:"phoneNumber"` Password string `json:"password"` }
func (LoginPayload) Validate ¶
func (p LoginPayload) Validate() error
type Repository ¶
type Repository interface { Create(ctx context.Context, user *User) error GetByPhoneNumberAndUserType(ctx context.Context, phoneNumber string, userType UserType) (*User, error) GetByID(ctx context.Context, id string) (*User, error) ListCustomers(ctx context.Context, req ListCustomerPayload) ([]*User, error) }
func NewRepository ¶
func NewRepository(db *db.DB) Repository
type Service ¶
type Service interface { CreateStaff(ctx context.Context, req CreateStaffPayload) (*StaffResponse, error) CreateCustomer(ctx context.Context, req CreateCustomerPayload) (*CustomerResponse, error) StaffLogin(ctx context.Context, req LoginPayload) (*StaffResponse, error) ListCustomers(ctx context.Context, req ListCustomerPayload) ([]*CustomerResponse, error) }
func NewService ¶
func NewService(repository Repository) Service
type StaffResponse ¶
Click to show internal directories.
Click to hide internal directories.