memberinvitations

package
v0.0.0-...-5106b98 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type CreateParams

type CreateParams struct {
	OrganizationSlug  slug.Slug
	InvitationSlug    slug.Slug
	Email             string
	RoleSlug          slug.Slug
	InvitedByUserSlug *slug.Slug
	TokenHash         string
	ExpiresAt         time.Time
}

type Invitation

type Invitation struct {
	Slug              slug.Slug
	OrganizationSlug  slug.Slug
	Email             string
	RoleSlug          slug.Slug
	Status            model.MemberInvitationStatus
	InvitedByUserSlug *slug.Slug
	AcceptedUserSlug  *slug.Slug
	ExpiresAt         time.Time
	LastSentAt        time.Time
	AcceptedAt        *time.Time
	DeclinedAt        *time.Time
	RevokedAt         *time.Time
	ExpiredAt         *time.Time
	CreatedAt         time.Time
	UpdatedAt         time.Time
}

type MarkAcceptedParams

type MarkAcceptedParams struct {
	OrganizationSlug slug.Slug
	InvitationSlug   slug.Slug
	AcceptedUserSlug slug.Slug
	AcceptedAt       time.Time
}

type MarkDeclinedParams

type MarkDeclinedParams struct {
	OrganizationSlug slug.Slug
	InvitationSlug   slug.Slug
	DeclinedAt       time.Time
}

type MarkExpiredParams

type MarkExpiredParams struct {
	OrganizationSlug slug.Slug
	InvitationSlug   slug.Slug
	ExpiredAt        time.Time
}

type MarkRevokedParams

type MarkRevokedParams struct {
	OrganizationSlug slug.Slug
	InvitationSlug   slug.Slug
	RevokedAt        time.Time
}

type RefreshTokenParams

type RefreshTokenParams struct {
	OrganizationSlug slug.Slug
	InvitationSlug   slug.Slug
	TokenHash        string
	ExpiresAt        time.Time
	LastSentAt       time.Time
}

type Repository

type Repository interface {
	Create(ctx context.Context, tx postgres.DBTX, params CreateParams) (*Invitation, error)
	Find(ctx context.Context, tx postgres.DBTX, orgSlug, invitationSlug slug.Slug) (*Invitation, error)
	FindByTokenHash(ctx context.Context, tx postgres.DBTX, tokenHash string) (*Invitation, error)
	FindPendingByEmail(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, email string) (*Invitation, error)
	ListByOrganization(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug slug.Slug,
		req model.ListRequest,
	) ([]*Invitation, error)
	ExpirePendingByOrganization(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, expiredAt time.Time) ([]*Invitation, error)
	ListPendingByEmail(ctx context.Context, tx postgres.DBTX, email string, asOf time.Time) ([]*Invitation, error)
	RefreshToken(ctx context.Context, tx postgres.DBTX, params RefreshTokenParams) (*Invitation, error)
	MarkAccepted(ctx context.Context, tx postgres.DBTX, params MarkAcceptedParams) (*Invitation, error)
	MarkDeclined(ctx context.Context, tx postgres.DBTX, params MarkDeclinedParams) (*Invitation, error)
	MarkRevoked(ctx context.Context, tx postgres.DBTX, params MarkRevokedParams) (*Invitation, error)
	MarkExpired(ctx context.Context, tx postgres.DBTX, params MarkExpiredParams) (*Invitation, error)
}

func NewRepository

func NewRepository() Repository

Jump to

Keyboard shortcuts

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