[MM-50534] - Renew email adds portal link when not eligible for self-serve renewal (#22350)

* [MM-50534] - Renew email adds portal link when not eligible for self-serve renewal

* fix translations

* make more checks

* improve endpoint to make checks

* use new checks

* fix translations

* fix lint

* add meaningful names

* rename struct

* rename endpoint
Этот коммит содержится в:
Allan Guwatudde
2023-03-03 18:33:18 +03:00
коммит произвёл GitHub
родитель 9c7aab24f5
Коммит 1f5a6e439e
12 изменённых файлов: 91 добавлений и 69 удалений

Просмотреть файл

@@ -8235,17 +8235,17 @@ func (c *Client4) GetCloudCustomer() (*CloudCustomer, *Response, error) {
return cloudCustomer, BuildResponse(r), nil
}
func (c *Client4) GetExpandStats(licenseId string) (*SubscriptionExpandStatus, *Response, error) {
r, err := c.DoAPIGet(fmt.Sprintf("%s%s?licenseID=%s", c.cloudRoute(), "/subscription/expand", licenseId), "")
func (c *Client4) GetSubscriptionStatus(licenseId string) (*SubscriptionLicenseSelfServeStatusResponse, *Response, error) {
r, err := c.DoAPIGet(fmt.Sprintf("%s%s?licenseID=%s", c.cloudRoute(), "/subscription/self-serve-status", licenseId), "")
if err != nil {
return nil, BuildResponse(r), err
}
defer closeBody(r)
var subscriptionExpandable *SubscriptionExpandStatus
json.NewDecoder(r.Body).Decode(&subscriptionExpandable)
var status *SubscriptionLicenseSelfServeStatusResponse
json.NewDecoder(r.Body).Decode(&status)
return subscriptionExpandable, BuildResponse(r), nil
return status, BuildResponse(r), nil
}
func (c *Client4) GetSubscription() (*Subscription, *Response, error) {

Просмотреть файл

@@ -125,8 +125,9 @@ type ValidateBusinessEmailResponse struct {
IsValid bool `json:"is_valid"`
}
type SubscriptionExpandStatus struct {
type SubscriptionLicenseSelfServeStatusResponse struct {
IsExpandable bool `json:"is_expandable"`
IsRenewable bool `json:"is_renewable"`
}
// CloudCustomerInfo represents editable info of a customer.