mirror of
https://github.com/makeplane/plane.git
synced 2026-07-13 22:09:12 +02:00
* 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>
34 lines
640 B
Go
34 lines
640 B
Go
package handlers
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
prime_api "github.com/makeplane/plane-ee/monitor/lib/api"
|
|
)
|
|
|
|
type InstanceHandler struct {
|
|
api prime_api.IPrimeMonitorApi
|
|
}
|
|
|
|
func NewInstanceHandler(api prime_api.IPrimeMonitorApi) *InstanceHandler {
|
|
return &InstanceHandler{api: api}
|
|
}
|
|
|
|
func (h *InstanceHandler) Activate() error {
|
|
err := h.api.ActivateInstance()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to activate instance: %s", err.Error)
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (h *InstanceHandler) Deactivate() error {
|
|
err := h.api.DeactivateInstance()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to deactivate instance: %s", err.Error)
|
|
}
|
|
|
|
return nil
|
|
}
|