organization

package
v0.0.0-...-d39f515 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2023 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotStripeCustomer = errors.New("not Stripe customer")
)

Functions

func CreateStripeBillingPortalSession

func CreateStripeBillingPortalSession(dp *depot.Depot, id uint64) (*stripe.BillingPortalSession, error)

func CreateStripeCheckoutSession

func CreateStripeCheckoutSession(dp *depot.Depot, id uint64, payload *CreateStripeCheckoutSessionPayload) (*stripe.CheckoutSession, error)

func Delete

func Delete(dp *depot.Depot, id uint64, payload *DeletionPayload) error

func SetGoogleOauthToken

func SetGoogleOauthToken(dp *depot.Depot, id uint64, payload *SetGoogleOauthTokenPayload) error

Types

type CreateStripeCheckoutSessionData

type CreateStripeCheckoutSessionData struct {
	OrganizationPlanId           *uint64
	OrganizationStripeCustomerId *string
	UserEmail                    string
}

type CreateStripeCheckoutSessionPayload

type CreateStripeCheckoutSessionPayload struct {
	PlanName           *string `json:"planName"`
	SubscriptionPeriod *string `json:"subscriptionPeriod"`
}

type DeletionPayload

type DeletionPayload struct {
	Details *string `json:"details"`
	Reason  *string `json:"reason"`
}

type Organization

type Organization struct {
	CreatedAt          time.Time                             `json:"createdAt"`
	HasGoogleOauth     bool                                  `json:"hasGoogleOauth"`
	Id                 uint64                                `json:"id"`
	IsOnTrial          bool                                  `json:"isOnTrial"`
	Name               string                                `json:"name"`
	Plan               *plan.Plan                            `gorm:"embedded;embeddedPrefix:plan__" json:"plan"`
	StripeCustomerId   *string                               `json:"stripeCustomerId"`
	SubscriptionPeriod *model.OrganizationSubscriptionPeriod `json:"subscriptionPeriod"`
	TrialEndsAt        *time.Time                            `json:"trialEndsAt"`
	UpdatedAt          time.Time                             `json:"updatedAt"`
}

func ClearGoogleAuth

func ClearGoogleAuth(dp *depot.Depot, organizationId uint64) (*Organization, error)

func Read

func Read(dp *depot.Depot, organizationId uint64) (*Organization, error)

func Update

func Update(dp *depot.Depot, id uint64, payload *UpdatePayload) (*Organization, error)

type SetGoogleOauthTokenPayload

type SetGoogleOauthTokenPayload struct {
	Code *string `json:"code"`
}

type UpdatePayload

type UpdatePayload struct {
	Name *string `json:"name"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL