flamingo.me/flamingo-commerce/v3@v3.11.0/customer/infrastructure/nilCustomer.go (about)

     1  package infrastructure
     2  
     3  import (
     4  	"context"
     5  
     6  	customerDomain "flamingo.me/flamingo-commerce/v3/customer/domain"
     7  	"flamingo.me/flamingo/v3/core/auth"
     8  )
     9  
    10  type (
    11  	// NilCustomerServiceAdapter for CustomerService and CustomerIdentityService that returns always NotFound
    12  	NilCustomerServiceAdapter struct{}
    13  )
    14  
    15  var _ customerDomain.CustomerIdentityService = new(NilCustomerServiceAdapter)
    16  
    17  // GetByIdentity retrieves the authenticated customer by Identity
    18  func (n *NilCustomerServiceAdapter) GetByIdentity(context.Context, auth.Identity) (customerDomain.Customer, error) {
    19  	return nil, customerDomain.ErrCustomerNotFoundError
    20  }