feat: improvements in entity domain logic
This commit is contained in:
@@ -5,10 +5,9 @@
|
||||
package mock
|
||||
|
||||
import (
|
||||
reflect "reflect"
|
||||
|
||||
entity "github.com/eminetto/clean-architecture-go-v2/domain/entity"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
// MockUseCase is a mock of UseCase interface
|
||||
|
||||
@@ -35,10 +35,6 @@ func (s *Service) Borrow(u *entity.User, b *entity.Book) error {
|
||||
return domain.ErrNotEnoughBooks
|
||||
}
|
||||
|
||||
_, err = u.GetBook(b.ID)
|
||||
if err == nil {
|
||||
return domain.ErrBookAlreadyBorrowed
|
||||
}
|
||||
err = u.AddBook(b.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user