Files
mostlymatter/einterfaces/cloud.go
Said Atrahouch b9501bc535 Mm 47648 check license expandable (#21770)
* [MM-47648] Handler for check if a subscription is expandable

* Mock cloud regenerate

* PR Webapp test purpose only

* [MM-47648] Refactor and tests for expand stats for a subscription

* Fix typos

* style fix

* has to be revert

* CWS URL to Spinwick

* new spinwick url

* target portal test

* Generate token instead of send licenseId

* Rename

* Rename methods

* Revert public key and cws url

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-12-27 12:08:11 +01:00

49 строки
2.4 KiB
Go

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
package einterfaces
import (
"github.com/mattermost/mattermost-server/v6/model"
)
type CloudInterface interface {
GetCloudProduct(userID string, productID string) (*model.Product, error)
GetCloudProducts(userID string, includeLegacyProducts bool) ([]*model.Product, error)
GetSelfHostedProducts(userID string) ([]*model.Product, error)
GetCloudLimits(userID string) (*model.ProductLimits, error)
CreateCustomerPayment(userID string) (*model.StripeSetupIntent, error)
ConfirmCustomerPayment(userID string, confirmRequest *model.ConfirmPaymentMethodRequest) error
GetCloudCustomer(userID string) (*model.CloudCustomer, error)
GetLicenseExpandStatus(userID string, token string) (*model.SubscriptionExpandStatus, error)
UpdateCloudCustomer(userID string, customerInfo *model.CloudCustomerInfo) (*model.CloudCustomer, error)
UpdateCloudCustomerAddress(userID string, address *model.Address) (*model.CloudCustomer, error)
GetSubscription(userID string) (*model.Subscription, error)
GetInvoicesForSubscription(userID string) ([]*model.Invoice, error)
GetInvoicePDF(userID, invoiceID string) ([]byte, string, error)
ChangeSubscription(userID, subscriptionID string, subscriptionChange *model.SubscriptionChange) (*model.Subscription, error)
RequestCloudTrial(userID, subscriptionID, newValidBusinessEmail string) (*model.Subscription, error)
ValidateBusinessEmail(userID, email string) error
// GetLicenseRenewalStatus checks on the portal whether it is possible to use token to renew a license
GetLicenseRenewalStatus(userID, token string) error
InvalidateCaches() error
// hosted customer methods
SelfHostedSignupAvailable() error
BootstrapSelfHostedSignup(req model.BootstrapSelfHostedSignupRequest) (*model.BootstrapSelfHostedSignupResponse, error)
CreateCustomerSelfHostedSignup(req model.SelfHostedCustomerForm, requesterEmail string) (*model.SelfHostedSignupCustomerResponse, error)
ConfirmSelfHostedSignup(req model.SelfHostedConfirmPaymentMethodRequest, requesterEmail string) (*model.SelfHostedSignupConfirmResponse, error)
ConfirmSelfHostedSignupLicenseApplication() error
GetSelfHostedInvoices() ([]*model.Invoice, error)
GetSelfHostedInvoicePDF(invoiceID string) ([]byte, string, error)
CreateOrUpdateSubscriptionHistoryEvent(userID string, userCount int) (*model.SubscriptionHistory, error)
HandleLicenseChange() error
}