Files
plane/monitor/lib/api/constants.go
Nikhil 213fd167f6 [WEB-3030] feat: business plan changes (#2395)
* chore: add business plan changes

* chore: monitor updates for business plan

* chore: license verification

* chore: add validation for license cancellation

* chore: proration preview endpoint

* chore:  add exception handling

* fix: license updates

* chore: add last payment failed date and count

* fix: invoice plan

* add current price amount

* feat: new add seats UI

* update price

* proration preview logic

* fix: invoicing endpoint

* add manage seats button to pro and bussiness card

---------

Co-authored-by: Prateek Shourya <prateekshourya29@gmail.com>
2025-02-12 17:26:27 +05:30

43 lines
1.5 KiB
Go

package prime_api
type ErrorCode int
type APIError struct {
Error string
Success bool
}
const (
NO_ERROR ErrorCode = iota
UNABLE_TO_POST_SERVICE_STATUS
UNABLE_TO_GET_FEATURE_FLAGS
UNABLE_TO_ACTIVATE_WORKSPACE
UNABLE_TO_PARSE_FEATURE_FLAGS
UNABLE_TO_SYNC_WORKSPACE
UNABLE_TO_UPDATE_SEATS
UNABLE_TO_FETCH_WORKSPACE_SUBSCRIPTION
UNABLE_TO_RETRIEVE_PLANS
UNABLE_TO_PARSE_PLANS
UNABLE_TO_DEACTIVATE_LICENSE
)
var errorCodeMap = map[ErrorCode]string{
NO_ERROR: "",
UNABLE_TO_POST_SERVICE_STATUS: "Unable to post service status",
UNABLE_TO_GET_FEATURE_FLAGS: "Unable to get feature flags",
UNABLE_TO_PARSE_FEATURE_FLAGS: "Unable to parse feature flags",
UNABLE_TO_ACTIVATE_WORKSPACE: "Unable to activate workspace, please check the logs",
UNABLE_TO_SYNC_WORKSPACE: "Unable to sync workspace, please check the logs",
UNABLE_TO_UPDATE_SEATS: "Unable to update seats for the license subscription",
UNABLE_TO_FETCH_WORKSPACE_SUBSCRIPTION: "Unable to fetch workspace subscription",
UNABLE_TO_RETRIEVE_PLANS: "Unable to retrieve plans",
UNABLE_TO_PARSE_PLANS: "Unable to parse plans",
UNABLE_TO_DEACTIVATE_LICENSE: "Unable to activate license",
}
// Converting the Error Code type to confirm to the stringer interface to be
// used in error messages and print statements, ;)
func (code ErrorCode) String() string {
return errorCodeMap[code]
}