feat: add customer list, modify pagination utils

This commit is contained in:
2026-04-07 09:28:39 +02:00
parent c5cc4f7a48
commit 813d1f4879
8 changed files with 61 additions and 55 deletions

View File

@@ -153,7 +153,6 @@ func (s *AuthService) Register(req *model.RegisterRequest) error {
Password: string(hashedPassword),
FirstName: req.FirstName,
LastName: req.LastName,
Role: model.Role{},
Provider: model.ProviderLocal,
IsActive: false,
EmailVerified: false,

View File

@@ -150,7 +150,6 @@ func (s *AuthService) findOrCreateGoogleUser(info *view.GoogleUserInfo) (*model.
Provider: model.ProviderGoogle,
ProviderID: info.ID,
AvatarURL: info.Picture,
Role: model.Role{},
IsActive: true,
EmailVerified: true,
LangID: 2, // default is english

View File

@@ -3,6 +3,8 @@ package customerService
import (
"git.ma-al.com/goc_daniel/b2b/app/model"
"git.ma-al.com/goc_daniel/b2b/app/repos/customerRepo"
"git.ma-al.com/goc_daniel/b2b/app/utils/query/filters"
"git.ma-al.com/goc_daniel/b2b/app/utils/query/find"
)
type CustomerService struct {
@@ -18,3 +20,7 @@ func New() *CustomerService {
func (s *CustomerService) GetById(id uint) (*model.Customer, error) {
return s.repo.Get(id)
}
func (s *CustomerService) Find(langId uint, p find.Paging, filt *filters.FiltersList) (*find.Found[model.Customer], error) {
return s.repo.Find(langId, p, filt)
}