@@ -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.
115115type 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
142142type phone struct {
@@ -203,8 +203,8 @@ func (rep *representative) validate() error {
203203
204204func (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 }
0 commit comments