[MM-49921] Cloud export compliance (#22189)
* Support for export compliance screening in cloud * i18n * Refactor error * Fix --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
@@ -131,7 +131,13 @@ func changeSubscription(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
changedSub, err := c.App.Cloud().ChangeSubscription(userId, currentSubscription.ID, subscriptionChange)
|
changedSub, err := c.App.Cloud().ChangeSubscription(userId, currentSubscription.ID, subscriptionChange)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.Err = model.NewAppError("Api4.changeSubscription", "api.cloud.app_error", nil, "", http.StatusInternalServerError).Wrap(err)
|
appErr := model.NewAppError("Api4.changeSubscription", "api.cloud.app_error", nil, "", http.StatusInternalServerError).Wrap(err)
|
||||||
|
if err.Error() == "compliance-failed" {
|
||||||
|
c.Logger.Error("Compliance check failed", mlog.Err(err))
|
||||||
|
appErr.StatusCode = http.StatusUnprocessableEntity
|
||||||
|
}
|
||||||
|
|
||||||
|
c.Err = appErr
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -177,6 +177,7 @@ type Subscription struct {
|
|||||||
TrialEndAt int64 `json:"trial_end_at"`
|
TrialEndAt int64 `json:"trial_end_at"`
|
||||||
DelinquentSince *int64 `json:"delinquent_since"`
|
DelinquentSince *int64 `json:"delinquent_since"`
|
||||||
OriginallyLicensedSeats int `json:"originally_licensed_seats"`
|
OriginallyLicensedSeats int `json:"originally_licensed_seats"`
|
||||||
|
ComplianceBlocked string `json:"compliance_blocked"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Subscription History model represents true up event in a yearly subscription
|
// Subscription History model represents true up event in a yearly subscription
|
||||||
@@ -266,6 +267,7 @@ type SubscriptionChange struct {
|
|||||||
ProductID string `json:"product_id"`
|
ProductID string `json:"product_id"`
|
||||||
Seats int `json:"seats"`
|
Seats int `json:"seats"`
|
||||||
DowngradeFeedback *DowngradeFeedback `json:"downgrade_feedback"`
|
DowngradeFeedback *DowngradeFeedback `json:"downgrade_feedback"`
|
||||||
|
ShippingAddress *Address `json:"shipping_address"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO remove BoardsLimits.
|
// TODO remove BoardsLimits.
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user