feat: customer list

This commit is contained in:
fernanda-one
2024-08-15 11:01:55 +07:00
parent 1a9d04a2d9
commit 21f8d170fa
9 changed files with 234 additions and 1 deletions
+11
View File
@@ -86,6 +86,17 @@ func (s *UserService) GetAll(ctx mycontext.Context, search entity.UserSearch) ([
return users.ToUserList(), total, nil
}
func (s *UserService) GetAllCustomer(ctx mycontext.Context, search entity.CustomerSearch) ([]*entity.Customer, int, error) {
users, total, err := s.repo.GetAllCustomer(ctx, search)
if err != nil {
logger.ContextLogger(ctx).Error("error when get all users", zap.Error(err))
return nil, 0, err
}
return users.ToCustomerList(), total, nil
}
func (s *UserService) GetByID(ctx mycontext.Context, id int64) (*entity.User, error) {
userDB, err := s.repo.GetUserByID(ctx, id)
if err != nil {