Skip to content
This repository was archived by the owner on Aug 26, 2022. It is now read-only.

Commit c09790a

Browse files
committed
Formatting and make check fixes
1 parent aac36c9 commit c09790a

File tree

2 files changed

+33
-33
lines changed

2 files changed

+33
-33
lines changed

pkg/customers/customers.go

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -113,30 +113,30 @@ func respondWithCustomer(logger log.Logger, w http.ResponseWriter, customerID, o
113113
// TODO(adam): What GDPR implications does this information have? IIRC if any EU citizen uses
114114
// this software we have to fully comply.
115115
type customerRequest struct {
116-
CustomerID string `json:"-"`
117-
FirstName string `json:"firstName"`
118-
MiddleName string `json:"middleName"`
119-
LastName string `json:"lastName"`
120-
NickName string `json:"nickName"`
121-
Suffix string `json:"suffix"`
122-
Type client.CustomerType `json:"type"`
123-
BusinessName string `json:"businessName"`
124-
DoingBusinessAs string `json:"doingBusinessAs"`
125-
BusinessType client.BusinessType `json:"businessType"`
126-
EIN string `json:"EIN"`
127-
DUNS string `json:"DUNS"`
128-
SICCode client.SicCode `json:"sicCode"`
129-
NAICSCode client.NaicsCode `json:"naicsCode"`
130-
BirthDate model.YYYYMMDD `json:"birthDate"`
131-
Status client.CustomerStatus `json:"-"`
132-
Email string `json:"email"`
133-
Website string `json:"website"`
134-
DateBusinessEstablished string `json:"dateBusinessEstablished"`
135-
SSN string `json:"SSN"`
136-
Phones []phone `json:"phones"`
137-
Addresses []address `json:"addresses"`
138-
Representatives []representative `json:"representatives"`
139-
Metadata map[string]string `json:"metadata"`
116+
CustomerID string `json:"-"`
117+
FirstName string `json:"firstName"`
118+
MiddleName string `json:"middleName"`
119+
LastName string `json:"lastName"`
120+
NickName string `json:"nickName"`
121+
Suffix string `json:"suffix"`
122+
Type client.CustomerType `json:"type"`
123+
BusinessName string `json:"businessName"`
124+
DoingBusinessAs string `json:"doingBusinessAs"`
125+
BusinessType client.BusinessType `json:"businessType"`
126+
EIN string `json:"EIN"`
127+
DUNS string `json:"DUNS"`
128+
SICCode client.SicCode `json:"sicCode"`
129+
NAICSCode client.NaicsCode `json:"naicsCode"`
130+
BirthDate model.YYYYMMDD `json:"birthDate"`
131+
Status client.CustomerStatus `json:"-"`
132+
Email string `json:"email"`
133+
Website string `json:"website"`
134+
DateBusinessEstablished string `json:"dateBusinessEstablished"`
135+
SSN string `json:"SSN"`
136+
Phones []phone `json:"phones"`
137+
Addresses []address `json:"addresses"`
138+
Representatives []representative `json:"representatives"`
139+
Metadata map[string]string `json:"metadata"`
140140
}
141141

142142
type phone struct {
@@ -203,8 +203,8 @@ func (rep *representative) validate() error {
203203

204204
func (req customerRequest) validate() error {
205205
isIndividualOrSoleProprietor := req.Type == client.CUSTOMERTYPE_INDIVIDUAL || req.BusinessType == client.BUSINESSTYPE_INDIVIDUAL_SOLE_PROPRIETOR_OR_SINGLE_MEMBER_LLC
206-
if isIndividualOrSoleProprietor && (req.FirstName == "" || req.LastName == ""){
207-
return errors.New("invalid customer fields: empty name field(s)")
206+
if isIndividualOrSoleProprietor && (req.FirstName == "" || req.LastName == "") {
207+
return errors.New("invalid customer fields: empty name field(s)")
208208
} else if req.Type == client.CUSTOMERTYPE_BUSINESS && req.BusinessName == "" {
209209
return errors.New("invalid customer fields: empty business name")
210210
}

pkg/customers/customers_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -453,21 +453,21 @@ func TestCustomers__businessCustomerRequest(t *testing.T) {
453453
}
454454
req.Representatives = append(req.Representatives, representative{
455455
FirstName: "John",
456-
LastName: "Doe",
456+
LastName: "Doe",
457457
Phones: []phone{
458458
{
459459
Number: "123.456.7890",
460-
Type: "mobile",
460+
Type: "mobile",
461461
},
462462
},
463463
Addresses: []address{
464464
{
465-
Address1: "123 Main St",
466-
City: "some city",
467-
State: "IL",
465+
Address1: "123 Main St",
466+
City: "some city",
467+
State: "IL",
468468
PostalCode: "60606",
469-
Country: "US",
470-
Type: "primary",
469+
Country: "US",
470+
Type: "primary",
471471
},
472472
},
473473
})

0 commit comments

Comments
 (0)