Repository: moov-io/customers (go)

Issue:
accounts: need "rejected" type status?
<!-- Please fill out the following questions, thanks! -->

Customers Version: `v0.5.0-dev`

Now that Accounts have their own OFAC searches (on HolderName) they can be rejected for a positive match. We need to reject that account. 

See the Customers flow. 
https://github.com/moov-io/customers/blob/v0.5.0-dev2/cmd/server/approval_ofac.go#L139-L148


Pull request description:
Added enum prefixes and 'frozen' to customer account status enums
Fixes #157 

Patch:
diff --git a/.openapi-generator/admin-generator-config.yml b/.openapi-generator/admin-generator-config.yml
index 091d6b0..b10685b 100644
--- a/.openapi-generator/admin-generator-config.yml
+++ b/.openapi-generator/admin-generator-config.yml
@@ -7,3 +7,4 @@ gitRepoId: "customers"
 additionalProperties:
   isGoSubmodule: true
   packageName: admin
+  enumClassPrefix: true
diff --git a/.openapi-generator/client-generator-config.yml b/.openapi-generator/client-generator-config.yml
index 2f94a43..7118eff 100644
--- a/.openapi-generator/client-generator-config.yml
+++ b/.openapi-generator/client-generator-config.yml
@@ -7,3 +7,4 @@ gitRepoId: "customers"
 additionalProperties:
   isGoSubmodule: true
   packageName: client
+  enumClassPrefix: true
diff --git a/api/client.yaml b/api/client.yaml
index 767cfe2..dc95ef9 100644
--- a/api/client.yaml
+++ b/api/client.yaml
@@ -1708,6 +1708,7 @@ components:
         - Unknown
         - ReceiveOnly
         - Verified
+        - Frozen
     CustomerMetadata:
       properties:
         metadata:
diff --git a/pkg/accounts/micro_deposits.go b/pkg/accounts/micro_deposits.go
index 7b88dcf..7a5220f 100644
--- a/pkg/accounts/micro_deposits.go
+++ b/pkg/accounts/micro_deposits.go
@@ -10,9 +10,10 @@ import (
 	"sort"
 	"strings"
 
+	"github.com/moov-io/paygate/pkg/client"
+
 	customerClient "github.com/moov-io/customers/pkg/client"
 	"github.com/moov-io/customers/pkg/paygate"
-	"github.com/moov-io/paygate/pkg/client"
 )
 
 func handleMicroDepositValidation(repo Repository, paygateClient paygate.Client, accountID, customerID, userID string, microDeposits []string) error {
@@ -41,7 +42,7 @@ func handleMicroDepositValidation(repo Repository, paygateClient paygate.Client,
 			return err
 		}
 		// Amounts validated, so mark the Account has approved
-		return repo.updateAccountStatus(accountID, customerClient.VALIDATED)
+		return repo.updateAccountStatus(accountID, customerClient.ACCOUNTSTATUS_VALIDATED)
 	}
 
 	return fmt.Errorf("microDepositID=%s is in status: %s", micro.MicroDepositID, micro.Status)
diff --git a/pkg/accounts/repository.go b/pkg/accounts/repository.go
index 2204f87..de63dc9 100644
--- a/pkg/accounts/repository.go
+++ b/pkg/accounts/repository.go
@@ -148,7 +148,7 @@ func (r *sqlAccountRepository) CreateCustomerAccount(customerID, userID string,
 		HolderName:          req.HolderName,
 		MaskedAccountNumber: req.maskedAccountNumber,
 		RoutingNumber:       req.RoutingNumber,
-		Status:              client.NONE,
+		Status:              client.ACCOUNTSTATUS_NONE,
 		Type:                req.Type,
 	}
 	query := `insert into accounts (
diff --git a/pkg/accounts/router.go b/pkg/accounts/router.go
index 9d070c8..8f878ac 100644
--- a/pkg/accounts/router.go
+++ b/pkg/accounts/router.go
@@ -98,7 +98,7 @@ func (req *CreateAccountRequest) validate() error {
 	at := func(t1, t2 client.AccountType) bool {
 		return strings.EqualFold(string(t1), string(t2))
 	}
-	if !at(req.Type, client.CHECKING) && !at(req.Type, client.SAVINGS) {
+	if !at(req.Type, client.ACCOUNTTYPE_CHECKING) && !at(req.Type, client.ACCOUNTTYPE_SAVINGS) {
 		return fmt.Errorf("invalid account type: %s", req.Type)
 	}
 
@@ -332,7 +332,7 @@ func updateAccountStatus(logger log.Logger, repo Repository) http.HandlerFunc {
 			return
 		}
 		switch req.Status {
-		case client.NONE, client.VALIDATED:
+		case client.ACCOUNTSTATUS_NONE, client.ACCOUNTSTATUS_VALIDATED:
 			// do nothing
 		default:
 			moovhttp.Problem(w, fmt.Errorf("invalid status: %s", req.Status))
diff --git a/pkg/accounts/validate.go b/pkg/accounts/validate.go
index b1c1bc1..2d01c1e 100644
--- a/pkg/accounts/validate.go
+++ b/pkg/accounts/validate.go
@@ -12,6 +12,7 @@ import (
 
 	"github.com/gorilla/mux"
 	moovhttp "github.com/moov-io/base/http"
+
 	"github.com/moov-io/customers/pkg/client"
 	"github.com/moov-io/customers/pkg/route"
 	"github.com/moov-io/customers/pkg/secrets"
@@ -75,8 +76,8 @@ func initAccountValidation(logger log.Logger, accounts Repository, validations v
 			moovhttp.Problem(w, err)
 			return
 		}
-		if !strings.EqualFold(string(account.Status), string(client.NONE)) {
-			moovhttp.Problem(w, fmt.Errorf("expected accountID=%s status to be '%s', but it is '%s'", accountID, client.NONE, account.Status))
+		if !strings.EqualFold(string(account.Status), string(client.ACCOUNTSTATUS_NONE)) {
+			moovhttp.Problem(w, fmt.Errorf("expected accountID=%s status to be '%s', but it is '%s'", accountID, client.ACCOUNTSTATUS_NONE, account.Status))
 			return
 		}
 
@@ -157,8 +158,8 @@ func completeAccountValidation(logger log.Logger, repo Repository, validations v
 			moovhttp.Problem(w, err)
 			return
 		}
-		if !strings.EqualFold(string(account.Status), string(client.NONE)) {
-			moovhttp.Problem(w, fmt.Errorf("expected accountID=%s status to be '%s', but it is '%s'", accountID, client.NONE, account.Status))
+		if !strings.EqualFold(string(account.Status), string(client.ACCOUNTSTATUS_NONE)) {
+			moovhttp.Problem(w, fmt.Errorf("expected accountID=%s status to be '%s', but it is '%s'", accountID, client.ACCOUNTSTATUS_NONE, account.Status))
 			return
 		}
 
@@ -223,7 +224,7 @@ func completeAccountValidation(logger log.Logger, repo Repository, validations v
 			return
 		}
 
-		err = repo.updateAccountStatus(accountID, client.VALIDATED)
+		err = repo.updateAccountStatus(accountID, client.ACCOUNTSTATUS_VALIDATED)
 		if err != nil {
 			moovhttp.Problem(w, err)
 			return
diff --git a/pkg/client/api/openapi.yaml b/pkg/client/api/openapi.yaml
index f842cc6..d48d18c 100644
--- a/pkg/client/api/openapi.yaml
+++ b/pkg/client/api/openapi.yaml
@@ -2102,6 +2102,7 @@ components:
       - Unknown
       - ReceiveOnly
       - Verified
+      - Frozen
       type: string
     CustomerMetadata:
       example:
diff --git a/pkg/client/model_account_status.go b/pkg/client/model_account_status.go
index f67fdb4..a6f4ea2 100644
--- a/pkg/client/model_account_status.go
+++ b/pkg/client/model_account_status.go
@@ -14,6 +14,6 @@ type AccountStatus string
 
 // List of AccountStatus
 const (
-	NONE      AccountStatus = "none"
-	VALIDATED AccountStatus = "validated"
+	ACCOUNTSTATUS_NONE      AccountStatus = "none"
+	ACCOUNTSTATUS_VALIDATED AccountStatus = "validated"
 )
diff --git a/pkg/client/model_account_type.go b/pkg/client/model_account_type.go
index 174a541..e8adfca 100644
--- a/pkg/client/model_account_type.go
+++ b/pkg/client/model_account_type.go
@@ -14,6 +14,6 @@ type AccountType string
 
 // List of AccountType
 const (
-	CHECKING AccountType = "Checking"
-	SAVINGS  AccountType = "Savings"
+	ACCOUNTTYPE_CHECKING AccountType = "Checking"
+	ACCOUNTTYPE_SAVINGS  AccountType = "Savings"
 )
diff --git a/pkg/client/model_customer_status.go b/pkg/client/model_customer_status.go
index 8528537..63516bf 100644
--- a/pkg/client/model_customer_status.go
+++ b/pkg/client/model_customer_status.go
@@ -14,9 +14,10 @@ type CustomerStatus string
 
 // List of CustomerStatus
 const (
-	DECEASED     CustomerStatus = "Deceased"
-	REJECTED     CustomerStatus = "Rejected"
-	UNKNOWN      CustomerStatus = "Unknown"
-	RECEIVE_ONLY CustomerStatus = "ReceiveOnly"
-	VERIFIED     CustomerStatus = "Verified"
+	CUSTOMERSTATUS_DECEASED     CustomerStatus = "Deceased"
+	CUSTOMERSTATUS_REJECTED     CustomerStatus = "Rejected"
+	CUSTOMERSTATUS_UNKNOWN      CustomerStatus = "Unknown"
+	CUSTOMERSTATUS_RECEIVE_ONLY CustomerStatus = "ReceiveOnly"
+	CUSTOMERSTATUS_VERIFIED     CustomerStatus = "Verified"
+	CUSTOMERSTATUS_FROZEN       CustomerStatus = "Frozen"
 )
diff --git a/pkg/client/model_customer_type.go b/pkg/client/model_customer_type.go
index 336f72d..77d653b 100644
--- a/pkg/client/model_customer_type.go
+++ b/pkg/client/model_customer_type.go
@@ -14,6 +14,6 @@ type CustomerType string
 
 // List of CustomerType
 const (
-	INDIVIDUAL CustomerType = "individual"
-	BUSINESS   CustomerType = "business"
+	CUSTOMERTYPE_INDIVIDUAL CustomerType = "individual"
+	CUSTOMERTYPE_BUSINESS   CustomerType = "business"
 )
diff --git a/pkg/customers/approval_ofac.go b/pkg/customers/approval_ofac.go
index b3844ca..e55fd00 100644
--- a/pkg/customers/approval_ofac.go
+++ b/pkg/customers/approval_ofac.go
@@ -160,7 +160,7 @@ func refreshOFACSearch(logger log.Logger, repo CustomerRepository, ofac *OFACSea
 		if result.Blocked {
 			logger.LogErrorF("customer=%s matched against OFAC entity=%s with a score of %.2f - rejecting customer", cust.CustomerID, result.EntityID, result.Match)
 
-			if err := repo.updateCustomerStatus(cust.CustomerID, client.REJECTED, "manual OFAC refresh"); err != nil {
+			if err := repo.updateCustomerStatus(cust.CustomerID, client.CUSTOMERSTATUS_REJECTED, "manual OFAC refresh"); err != nil {
 				logger.LogErrorF("error updating customer=%s error=%v", cust.CustomerID, err)
 				moovhttp.Problem(w, err)
 				return
diff --git a/pkg/customers/customers.go b/pkg/customers/customers.go
index 02df5e9..37d6e32 100644
--- a/pkg/customers/customers.go
+++ b/pkg/customers/customers.go
@@ -169,7 +169,7 @@ func validateCustomerType(t client.CustomerType) error {
 		return strings.ToLower(string(t))
 	}
 	switch norm(t) {
-	case norm(client.INDIVIDUAL), norm(client.BUSINESS):
+	case norm(client.CUSTOMERTYPE_INDIVIDUAL), norm(client.CUSTOMERTYPE_BUSINESS):
 		return nil
 	}
 	return fmt.Errorf("unknown type: %s", t)
@@ -194,7 +194,7 @@ func (req customerRequest) asCustomer(storage *ssnStorage) (*client.Customer, *S
 	}
 
 	if req.Status == "" {
-		req.Status = client.UNKNOWN
+		req.Status = client.CUSTOMERSTATUS_UNKNOWN
 	}
 
 	customer := &client.Customer{
@@ -459,7 +459,7 @@ values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);`
 	}
 
 	now := time.Now()
-	_, err = stmt.Exec(c.CustomerID, c.FirstName, c.MiddleName, c.LastName, c.NickName, c.Suffix, c.Type, birthDate, client.UNKNOWN, c.Email, now, now, organization)
+	_, err = stmt.Exec(c.CustomerID, c.FirstName, c.MiddleName, c.LastName, c.NickName, c.Suffix, c.Type, birthDate, client.CUSTOMERSTATUS_UNKNOWN, c.Email, now, now, organization)
 	if err != nil {
 		return fmt.Errorf("CreateCustomer: insert into customers err=%v | rollback=%v", err, tx.Rollback())
 	}


Test patch:
diff --git a/pkg/accounts/repository_test.go b/pkg/accounts/repository_test.go
index 180fb3f..79bcc8c 100644
--- a/pkg/accounts/repository_test.go
+++ b/pkg/accounts/repository_test.go
@@ -53,7 +53,7 @@ func TestRepository(t *testing.T) {
 	acct, err := repo.CreateCustomerAccount(customerID, userID, &CreateAccountRequest{
 		AccountNumber: "123",
 		RoutingNumber: "987654320",
-		Type:          client.CHECKING,
+		Type:          client.ACCOUNTTYPE_CHECKING,
 	})
 	if err != nil {
 		t.Fatal(err)
@@ -89,7 +89,7 @@ func TestRepository__getEncryptedAccountNumber(t *testing.T) {
 	req := &CreateAccountRequest{
 		AccountNumber: "123",
 		RoutingNumber: "987654320",
-		Type:          client.CHECKING,
+		Type:          client.ACCOUNTTYPE_CHECKING,
 	}
 	if err := req.disfigure(keeper); err != nil {
 		t.Fatal(err)
@@ -105,7 +105,7 @@ func TestRepository__getEncryptedAccountNumber(t *testing.T) {
 		CustomerID: customerID,
 		FirstName:  "jane",
 		LastName:   "doe",
-		Type:       client.INDIVIDUAL,
+		Type:       client.CUSTOMERTYPE_INDIVIDUAL,
 	}
 	custErr := customerRepo.CreateCustomer(cust, organization)
 	if custErr != nil {
@@ -132,7 +132,7 @@ func TestRepository__updateAccountStatus(t *testing.T) {
 	req := &CreateAccountRequest{
 		AccountNumber: "123",
 		RoutingNumber: "987654320",
-		Type:          client.CHECKING,
+		Type:          client.ACCOUNTTYPE_CHECKING,
 	}
 	if err := req.disfigure(keeper); err != nil {
 		t.Fatal(err)
@@ -143,7 +143,7 @@ func TestRepository__updateAccountStatus(t *testing.T) {
 	}
 
 	// update status
-	if err := repo.updateAccountStatus(acct.AccountID, client.VALIDATED); err != nil {
+	if err := repo.updateAccountStatus(acct.AccountID, client.ACCOUNTSTATUS_VALIDATED); err != nil {
 		t.Fatal(err)
 	}
 
@@ -152,7 +152,7 @@ func TestRepository__updateAccountStatus(t *testing.T) {
 	if err != nil {
 		t.Fatal(err)
 	}
-	if acct.Status != client.VALIDATED {
+	if acct.Status != client.ACCOUNTSTATUS_VALIDATED {
 		t.Errorf("unexpected status: %s", acct.Status)
 	}
 }
@@ -165,7 +165,7 @@ func TestRepositoryUnique(t *testing.T) {
 		req := &CreateAccountRequest{
 			AccountNumber: "156421",
 			RoutingNumber: "123456780",
-			Type:          client.SAVINGS,
+			Type:          client.ACCOUNTTYPE_SAVINGS,
 		}
 		if err := req.disfigure(keeper); err != nil {
 			t.Fatal(err)
diff --git a/pkg/accounts/router_test.go b/pkg/accounts/router_test.go
index 64c5323..0c80f0c 100644
--- a/pkg/accounts/router_test.go
+++ b/pkg/accounts/router_test.go
@@ -143,7 +143,7 @@ func TestAccountCreationRequest(t *testing.T) {
 	req.HolderName = "John Doe"
 	req.AccountNumber = "12345"
 	req.RoutingNumber = "987654320"
-	req.Type = client.SAVINGS
+	req.Type = client.ACCOUNTTYPE_SAVINGS
 
 	if err := req.validate(); err != nil {
 		t.Error(err)
@@ -174,7 +174,7 @@ func TestGetAccountByID(t *testing.T) {
 		accounts[i].Account, err = repo.CreateCustomerAccount(accounts[i].customerID, base.ID(), &CreateAccountRequest{
 			AccountNumber: fmt.Sprintf("%d", i),
 			RoutingNumber: "987654320",
-			Type:          client.CHECKING,
+			Type:          client.ACCOUNTTYPE_CHECKING,
 		})
 		require.NoError(t, err)
 	}
@@ -206,7 +206,7 @@ func TestRoutes__DecryptAccountNumber(t *testing.T) {
 	req := &CreateAccountRequest{
 		AccountNumber: "123",
 		RoutingNumber: "987654320",
-		Type:          client.CHECKING,
+		Type:          client.ACCOUNTTYPE_CHECKING,
 	}
 	if err := req.disfigure(keeper); err != nil {
 		t.Fatal(err)
@@ -256,7 +256,7 @@ func TestUpdateAccountStatus(t *testing.T) {
 	c := testclient.New(t, router)
 
 	req := client.UpdateAccountStatus{
-		Status: client.VALIDATED,
+		Status: client.ACCOUNTSTATUS_VALIDATED,
 	}
 	account, resp, err := c.CustomersApi.UpdateAccountStatus(context.TODO(), customerID, accountID, req)
 	if resp != nil && resp.Body != nil {
@@ -338,7 +338,7 @@ func setupCustomerWithOrganization(t *testing.T, customerID, organization string
 		CustomerID: customerID,
 		FirstName:  "jane",
 		LastName:   "doe",
-		Type:       client.INDIVIDUAL,
+		Type:       client.CUSTOMERTYPE_INDIVIDUAL,
 	}
 	custErr := customerRepo.CreateCustomer(cust, organization)
 	if custErr != nil {
@@ -370,7 +370,7 @@ func httpCreateAccount(t *testing.T, handler *mux.Router, customerID string) *cl
 		HolderName:    "John Doe",
 		AccountNumber: "18749",
 		RoutingNumber: "987654320",
-		Type:          client.SAVINGS,
+		Type:          client.ACCOUNTTYPE_SAVINGS,
 	}
 
 	var buf bytes.Buffer
diff --git a/pkg/accounts/validate_test.go b/pkg/accounts/validate_test.go
index c419d77..756f2db 100644
--- a/pkg/accounts/validate_test.go
+++ b/pkg/accounts/validate_test.go
@@ -8,11 +8,12 @@ import (
 	"bytes"
 	"encoding/json"
 	"fmt"
-	"github.com/moov-io/customers/pkg/customers"
 	"net/http"
 	"net/http/httptest"
 	"testing"
 
+	"github.com/moov-io/customers/pkg/customers"
+
 	"github.com/google/go-cmp/cmp"
 	"github.com/moov-io/base"
 	payclient "github.com/moov-io/paygate/pkg/client"
@@ -39,7 +40,7 @@ func TestRouter__AccountValidation(t *testing.T) {
 	acc, err := accounts.CreateCustomerAccount(customerID, userID, &CreateAccountRequest{
 		AccountNumber: "123",
 		RoutingNumber: "987654320",
-		Type:          client.CHECKING,
+		Type:          client.ACCOUNTTYPE_CHECKING,
 	})
 	require.NoError(t, err)
 
@@ -110,7 +111,7 @@ func TestRouter__InitAccountValidation(t *testing.T) {
 	acc, err := accounts.CreateCustomerAccount(customerID, userID, &CreateAccountRequest{
 		AccountNumber: "123",
 		RoutingNumber: "987654320",
-		Type:          client.CHECKING,
+		Type:          client.ACCOUNTTYPE_CHECKING,
 	})
 	require.NoError(t, err)
 
@@ -118,11 +119,11 @@ func TestRouter__InitAccountValidation(t *testing.T) {
 		acc, err := accounts.CreateCustomerAccount(customerID, userID, &CreateAccountRequest{
 			AccountNumber: "1234",
 			RoutingNumber: "987654321",
-			Type:          client.CHECKING,
+			Type:          client.ACCOUNTTYPE_CHECKING,
 		})
 		require.NoError(t, err)
 
-		err = accounts.updateAccountStatus(acc.AccountID, client.VALIDATED)
+		err = accounts.updateAccountStatus(acc.AccountID, client.ACCOUNTSTATUS_VALIDATED)
 		require.NoError(t, err)
 
 		params := map[string]string{
@@ -260,7 +261,7 @@ func TestRouter__CompleteAccountValidation(t *testing.T) {
 	acc, err := repo.CreateCustomerAccount(customerID, userID, &CreateAccountRequest{
 		AccountNumber: "123456",
 		RoutingNumber: "987654323",
-		Type:          client.CHECKING,
+		Type:          client.ACCOUNTTYPE_CHECKING,
 	})
 	require.NoError(t, err)
 
@@ -268,11 +269,11 @@ func TestRouter__CompleteAccountValidation(t *testing.T) {
 		acc, err := repo.CreateCustomerAccount(customerID, userID, &CreateAccountRequest{
 			AccountNumber: "123",
 			RoutingNumber: "987654320",
-			Type:          client.CHECKING,
+			Type:          client.ACCOUNTTYPE_CHECKING,
 		})
 		require.NoError(t, err)
 
-		err = repo.updateAccountStatus(acc.AccountID, client.VALIDATED)
+		err = repo.updateAccountStatus(acc.AccountID, client.ACCOUNTSTATUS_VALIDATED)
 		require.NoError(t, err)
 
 		// build request for test strategy
@@ -359,7 +360,7 @@ func TestRouter__CompleteAccountValidation(t *testing.T) {
 		acc, err := repo.CreateCustomerAccount(customerID, userID, &CreateAccountRequest{
 			AccountNumber:          "1234",
 			RoutingNumber:          "987654321",
-			Type:                   client.CHECKING,
+			Type:                   client.ACCOUNTTYPE_CHECKING,
 			encryptedAccountNumber: encrypted,
 		})
 		require.NoError(t, err)
@@ -369,7 +370,7 @@ func TestRouter__CompleteAccountValidation(t *testing.T) {
 			CustomerID: customerID,
 			FirstName:  "mary",
 			LastName:   "doe",
-			Type:       client.INDIVIDUAL,
+			Type:       client.CUSTOMERTYPE_INDIVIDUAL,
 		}
 		custErr := customerRepo.CreateCustomer(cust, organization)
 		if custErr != nil {
@@ -444,7 +445,7 @@ func TestRouter__CompleteAccountValidation(t *testing.T) {
 		acc, err := repo.CreateCustomerAccount(customerID, userID, &CreateAccountRequest{
 			AccountNumber:          "12345",
 			RoutingNumber:          "987654322",
-			Type:                   client.CHECKING,
+			Type:                   client.ACCOUNTTYPE_CHECKING,
 			encryptedAccountNumber: encrypted,
 		})
 		require.NoError(t, err)
@@ -475,7 +476,7 @@ func TestRouter__CompleteAccountValidation(t *testing.T) {
 			CustomerID: customerID,
 			FirstName:  "john",
 			LastName:   "doe",
-			Type:       client.INDIVIDUAL,
+			Type:       client.CUSTOMERTYPE_INDIVIDUAL,
 		}
 		custErr := customerRepo.CreateCustomer(cust, organization)
 		if custErr != nil {
@@ -513,7 +514,7 @@ func TestRouter__CompleteAccountValidation(t *testing.T) {
 		// check if account status was set to validated
 		updatedAccount, err := repo.getCustomerAccount(customerID, acc.AccountID)
 		require.NoError(t, err)
-		require.Equal(t, client.VALIDATED, updatedAccount.Status)
+		require.Equal(t, client.ACCOUNTSTATUS_VALIDATED, updatedAccount.Status)
 
 		// check if validation status was set to completed
 		validation, err = validations.GetValidation(validation.AccountID, validation.ValidationID)
diff --git a/pkg/customers/customer_search_test.go b/pkg/customers/customer_search_test.go
index 6a8e65b..49447af 100644
--- a/pkg/customers/customer_search_test.go
+++ b/pkg/customers/customer_search_test.go
@@ -202,28 +202,28 @@ func TestCustomerSearchEmpty(t *testing.T) {
 
 func TestGet20MostRecentlyCreatedCustomersByDefault(t *testing.T) {
 	scope := Setup(t)
-	scope.CreateCustomers(100, client.INDIVIDUAL)
+	scope.CreateCustomers(100, client.CUSTOMERTYPE_INDIVIDUAL)
 	customers, _ := scope.GetCustomers("")
 	scope.assert.Equal(20, len(customers))
 }
 
 func TestGet10MostRecentlyCreatedCustomersByDefault(t *testing.T) {
 	scope := Setup(t)
-	scope.CreateCustomers(10, client.INDIVIDUAL)
+	scope.CreateCustomers(10, client.CUSTOMERTYPE_INDIVIDUAL)
 	customers, _ := scope.GetCustomers("")
 	scope.assert.Equal(10, len(customers))
 }
 
 func TestGet50MostRecentlyCreatedCustomersWhenSpecifyingLimit(t *testing.T) {
 	scope := Setup(t)
-	scope.CreateCustomers(100, client.INDIVIDUAL)
+	scope.CreateCustomers(100, client.CUSTOMERTYPE_INDIVIDUAL)
 	customers, _ := scope.GetCustomers("?count=50")
 	scope.assert.Equal(50, len(customers))
 }
 
 func TestGet100MostRecentlyCreatedCustomersWhenSpecifyingMoreThanAvailable(t *testing.T) {
 	scope := Setup(t)
-	scope.CreateCustomers(100, client.INDIVIDUAL)
+	scope.CreateCustomers(100, client.CUSTOMERTYPE_INDIVIDUAL)
 	customers, _ := scope.GetCustomers("?count=120")
 	scope.assert.Equal(100, len(customers))
 }
@@ -231,11 +231,11 @@ func TestGet100MostRecentlyCreatedCustomersWhenSpecifyingMoreThanAvailable(t *te
 func TestSearchCustomersWithVerifiedStatus(t *testing.T) {
 	// Create two customers. 1 with Unknown STATUS and 1 with Verified
 	scope := Setup(t)
-	customer := scope.CreateCustomer("John", "Doe", "john.doe@email.com", client.INDIVIDUAL)
-	if err := scope.customerRepo.updateCustomerStatus(customer.CustomerID, client.VERIFIED, "test comment"); err != nil {
+	customer := scope.CreateCustomer("John", "Doe", "john.doe@email.com", client.CUSTOMERTYPE_INDIVIDUAL)
+	if err := scope.customerRepo.updateCustomerStatus(customer.CustomerID, client.CUSTOMERSTATUS_VERIFIED, "test comment"); err != nil {
 		print(err)
 	}
-	scope.CreateCustomer("Jane", "Doe", "jane.doe@email.com", client.INDIVIDUAL)
+	scope.CreateCustomer("Jane", "Doe", "jane.doe@email.com", client.CUSTOMERTYPE_INDIVIDUAL)
 
 	// Should have 1 Verified Status
 	verifiedCustomers, _ := scope.GetCustomers("?status=Verified&count=20")
@@ -258,8 +258,8 @@ func TestSearchCustomersByName(t *testing.T) {
 		logger: log.NewNopLogger(),
 		db:     database.CreateTestMySQLDB(t).DB,
 	}
-	_ = scope.CreateCustomer("Jane", "Doe", "jane.doe@gmail.com", client.INDIVIDUAL)
-	_ = scope.CreateCustomer("John", "Doe", "jane.doe@gmail.com", client.INDIVIDUAL)
+	_ = scope.CreateCustomer("Jane", "Doe", "jane.doe@gmail.com", client.CUSTOMERTYPE_INDIVIDUAL)
+	_ = scope.CreateCustomer("John", "Doe", "jane.doe@gmail.com", client.CUSTOMERTYPE_INDIVIDUAL)
 
 	customers, _ := scope.GetCustomers("?query=jane")
 	scope.assert.Equal(1, len(customers))
@@ -282,8 +282,8 @@ func TestSearchCustomersByName(t *testing.T) {
 
 func TestSearchCustomersByEmail(t *testing.T) {
 	scope := Setup(t)
-	_ = scope.CreateCustomer("Jane", "Doe", "jane.doe@gmail.com", client.INDIVIDUAL)
-	_ = scope.CreateCustomer("John", "Doe", "john.doe@gmail.com", client.INDIVIDUAL)
+	_ = scope.CreateCustomer("Jane", "Doe", "jane.doe@gmail.com", client.CUSTOMERTYPE_INDIVIDUAL)
+	_ = scope.CreateCustomer("John", "Doe", "john.doe@gmail.com", client.CUSTOMERTYPE_INDIVIDUAL)
 
 	customers, _ := scope.GetCustomers("?email=jane.doe@gmail.com")
 	scope.assert.Equal(1, len(customers))
@@ -301,8 +301,8 @@ func TestSearchCustomersByNameAndEmail(t *testing.T) {
 		logger: log.NewNopLogger(),
 		db:     database.CreateTestMySQLDB(t).DB,
 	}
-	_ = scope.CreateCustomer("Jane", "Doe", "jane.doe@gmail.com", client.INDIVIDUAL)
-	_ = scope.CreateCustomer("John", "Doe", "john.doe@gmail.com", client.INDIVIDUAL)
+	_ = scope.CreateCustomer("Jane", "Doe", "jane.doe@gmail.com", client.CUSTOMERTYPE_INDIVIDUAL)
+	_ = scope.CreateCustomer("John", "Doe", "john.doe@gmail.com", client.CUSTOMERTYPE_INDIVIDUAL)
 
 	customers, _ := scope.GetCustomers("?query=jane+doe&email=jane.doe@gmail.com")
 	scope.assert.Equal(1, len(customers))
@@ -328,7 +328,7 @@ func TestSearchCustomersByNameAndEmail(t *testing.T) {
 
 func TestSearchCustomersUsingPaging(t *testing.T) {
 	scope := Setup(t)
-	_ = scope.CreateCustomers(30, client.INDIVIDUAL)
+	_ = scope.CreateCustomers(30, client.CUSTOMERTYPE_INDIVIDUAL)
 
 	// Get first page of 10
 	customers, _ := scope.GetCustomers("?skip=0&count=10")
@@ -349,7 +349,7 @@ func TestSearchCustomersUsingPaging(t *testing.T) {
 
 func TestSearchCustomersUsingPagingFailure(t *testing.T) {
 	scope := Setup(t)
-	_ = scope.CreateCustomers(30, client.INDIVIDUAL)
+	_ = scope.CreateCustomers(30, client.CUSTOMERTYPE_INDIVIDUAL)
 
 	customers, _ := scope.GetCustomers("?skip=123abc")
 	scope.assert.Equal(0, len(customers))
@@ -363,8 +363,8 @@ func TestSearchCustomersUsingPagingFailure(t *testing.T) {
 
 func TestSearchCustomersByType(t *testing.T) {
 	scope := Setup(t)
-	_ = scope.CreateCustomers(10, client.INDIVIDUAL)
-	_ = scope.CreateCustomers(20, client.BUSINESS)
+	_ = scope.CreateCustomers(10, client.CUSTOMERTYPE_INDIVIDUAL)
+	_ = scope.CreateCustomers(20, client.CUSTOMERTYPE_BUSINESS)
 
 	individualCustomers, _ := scope.GetCustomers("?type=individual")
 	scope.assert.Equal(10, len(individualCustomers))
diff --git a/pkg/customers/customers_test.go b/pkg/customers/customers_test.go
index 6d5a009..5b3395a 100644
--- a/pkg/customers/customers_test.go
+++ b/pkg/customers/customers_test.go
@@ -270,7 +270,7 @@ func TestCustomers__searchCustomersError(t *testing.T) {
 }
 
 func TestCustomers__customerRequest(t *testing.T) {
-	req := &customerRequest{Type: client.INDIVIDUAL}
+	req := &customerRequest{Type: client.CUSTOMERTYPE_INDIVIDUAL}
 	if err := req.validate(); err == nil {
 		t.Error("expected error")
 	}
@@ -673,7 +673,7 @@ func TestCustomerRepository__updateCustomerStatus(t *testing.T) {
 	}
 
 	// update status
-	if err := repo.updateCustomerStatus(cust.CustomerID, client.VERIFIED, "test comment"); err != nil {
+	if err := repo.updateCustomerStatus(cust.CustomerID, client.CUSTOMERSTATUS_VERIFIED, "test comment"); err != nil {
 		t.Fatal(err)
 	}
 
@@ -682,7 +682,7 @@ func TestCustomerRepository__updateCustomerStatus(t *testing.T) {
 	if err != nil {
 		t.Fatal(err)
 	}
-	if customer.Status != client.VERIFIED {
+	if customer.Status != client.CUSTOMERSTATUS_VERIFIED {
 		t.Errorf("unexpected status: %s", customer.Status)
 	}
 }