From 0d0ab5187671afa6948879dac40c04bf82542a2b Mon Sep 17 00:00:00 2001 From: Carlos Tadeu Panato Junior Date: Mon, 20 Apr 2020 14:20:35 +0200 Subject: [PATCH] license: dropping PhoneNumber field from the license (#14307) Per request of the bix team and checking the code this field is not used in any place and also is one information that is not needed at all. --- app/license.go | 1 - model/license.go | 9 ++++----- model/license_test.go | 10 ++++------ utils/license.go | 1 - 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/app/license.go b/app/license.go index 023bba8f35..1e162e2543 100644 --- a/app/license.go +++ b/app/license.go @@ -204,7 +204,6 @@ func (a *App) GetSanitizedClientLicense() map[string]string { delete(sanitizedLicense, "Id") delete(sanitizedLicense, "Name") delete(sanitizedLicense, "Email") - delete(sanitizedLicense, "PhoneNumber") delete(sanitizedLicense, "IssuedAt") delete(sanitizedLicense, "StartsAt") delete(sanitizedLicense, "ExpiresAt") diff --git a/model/license.go b/model/license.go index dfccd667f2..16466e5340 100644 --- a/model/license.go +++ b/model/license.go @@ -32,11 +32,10 @@ type License struct { } type Customer struct { - Id string `json:"id"` - Name string `json:"name"` - Email string `json:"email"` - Company string `json:"company"` - PhoneNumber string `json:"phone_number"` + Id string `json:"id"` + Name string `json:"name"` + Email string `json:"email"` + Company string `json:"company"` } type Features struct { diff --git a/model/license_test.go b/model/license_test.go index 638a5ea347..e5a0caaac5 100644 --- a/model/license_test.go +++ b/model/license_test.go @@ -136,11 +136,10 @@ func TestLicenseToFromJson(t *testing.T) { StartsAt: GetMillis(), ExpiresAt: GetMillis(), Customer: &Customer{ - Id: NewId(), - Name: NewId(), - Email: NewId(), - Company: NewId(), - PhoneNumber: NewId(), + Id: NewId(), + Name: NewId(), + Email: NewId(), + Company: NewId(), }, Features: &f, } @@ -159,7 +158,6 @@ func TestLicenseToFromJson(t *testing.T) { CheckString(t, l1.Customer.Name, l.Customer.Name) CheckString(t, l1.Customer.Email, l.Customer.Email) CheckString(t, l1.Customer.Company, l.Customer.Company) - CheckString(t, l1.Customer.PhoneNumber, l.Customer.PhoneNumber) f1 := l1.Features diff --git a/utils/license.go b/utils/license.go index 4ce3f2b790..4646e7f58e 100644 --- a/utils/license.go +++ b/utils/license.go @@ -151,7 +151,6 @@ func GetClientLicense(l *model.License) map[string]string { props["Name"] = l.Customer.Name props["Email"] = l.Customer.Email props["Company"] = l.Customer.Company - props["PhoneNumber"] = l.Customer.PhoneNumber props["EmailNotificationContents"] = strconv.FormatBool(*l.Features.EmailNotificationContents) props["MessageExport"] = strconv.FormatBool(*l.Features.MessageExport) props["CustomPermissionsSchemes"] = strconv.FormatBool(*l.Features.CustomPermissionsSchemes)