MM-43084 update product limits through webhook and websocket (#20076)

* Define interfaces for updating subscriptions and product limits from CWS webhook.
Этот коммит содержится в:
Nathaniel Allred
2022-05-09 08:05:50 -05:00
коммит произвёл GitHub
родитель c7fe5e9aab
Коммит 6f87eb67fc
15 изменённых файлов: 203 добавлений и 0 удалений

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

@@ -10,6 +10,7 @@ const (
EventTypeFailedPaymentNoCard = "failed-payment-no-card"
EventTypeSendAdminWelcomeEmail = "send-admin-welcome-email"
EventTypeSendUpgradeConfirmationEmail = "send-upgrade-confirmation-email"
EventTypeSubscriptionChanged = "subscription-changed"
EventTypeTrialWillEnd = "trial-will-end"
EventTypeTrialEnded = "trial-ended"
)
@@ -166,6 +167,8 @@ type CWSWebhookPayload struct {
Event string `json:"event"`
FailedPayment *FailedPayment `json:"failed_payment"`
CloudWorkspaceOwner *CloudWorkspaceOwner `json:"cloud_workspace_owner"`
ProductLimits *ProductLimits `json:"product_limits"`
Subscription *Subscription `json:"subscription"`
SubscriptionTrialEndUnixTimeStamp int64 `json:"trial_end_time_stamp"`
}

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

@@ -71,6 +71,7 @@ const (
WebsocketWarnMetricStatusReceived = "warn_metric_status_received"
WebsocketWarnMetricStatusRemoved = "warn_metric_status_removed"
WebsocketEventCloudPaymentStatusUpdated = "cloud_payment_status_updated"
WebsocketEventCloudSubscriptionChanged = "cloud_subscription_changed"
WebsocketEventThreadUpdated = "thread_updated"
WebsocketEventThreadFollowChanged = "thread_follow_changed"
WebsocketEventThreadReadChanged = "thread_read_changed"