Replase product skus with their full names.

Этот коммит содержится в:
Conor Macpherson
2022-12-06 13:03:00 -05:00
родитель 47b8125659
Коммит 82d9f25807
2 изменённых файлов: 10 добавлений и 6 удалений

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

@@ -7,7 +7,6 @@ import (
"bytes"
"encoding/binary"
"encoding/json"
"fmt"
"io"
"net/http"
"time"
@@ -144,8 +143,7 @@ func changeSubscription(c *Context, w http.ResponseWriter, r *http.Request) {
c.Logger.Error("Error finding the new cloud product", mlog.Err(err))
}
starterSku := fmt.Sprintf("%s-%s", model.SubscriptionFamilyCloud, model.ProductSkuStarter)
if product.SKU == starterSku {
if product.SKU == string(model.SkuCloudStarter) {
w.Write(json)
return
}

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

@@ -43,9 +43,15 @@ const (
type ProductSku string
const (
ProductSkuStarter = ProductSku("starter")
ProductSkuProfessional = ProductSku("professional")
ProductSkuEnterprise = ProductSku("enterprise")
SkuStarterGov = ProductSku("starter-gov")
SkuProfessionalGov = ProductSku("professional-gov")
SkuEnterpriseGov = ProductSku("enterprise-gov")
SkuStarter = ProductSku("starter")
SkuProfessional = ProductSku("professional")
SkuEnterprise = ProductSku("enterprise")
SkuCloudStarter = ProductSku("cloud-starter")
SkuCloudProfessional = ProductSku("cloud-professional")
SkuCloudEnterprise = ProductSku("cloud-enterprise")
)
// Product model represents a product on the cloud system.