accountclosuresvc

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StateStrings

func StateStrings() []string

StateStrings returns a slice of all String values of the enum

Types

type Option

type Option func(*Service)

func WithBeforeDelete

func WithBeforeDelete(beforeDelete func(context.Context, postgres.DBTX, int32) error) Option

type Result

type Result struct {
	Slug                        slug.Slug
	State                       State
	RequestedAt                 time.Time
	CompletedAt                 *time.Time
	OwnershipRequired           []slug.Slug
	OrganizationRemovalRequired []slug.Slug
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func (*Service) Complete

func (s *Service) Complete(ctx context.Context, requestSlug slug.Slug) (bool, error)

Complete is idempotent. A pending result is not evidence that external processing stopped; the worker retries without a retention-time shortcut.

func (*Service) Request

func (s *Service) Request(ctx context.Context, user slug.Slug) (Result, error)

Request acts only for the authenticated subject. Acceptance, access revocation, and durable retry admission commit together or leave the account unchanged.

type State

type State int
const (
	StatePending           State = iota // pending
	StateCompleted                      // completed
	StateOwnershipRequired              // ownership_required
	StateFailed                         // failed
)

func StateString

func StateString(s string) (State, error)

StateString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func StateValues

func StateValues() []State

StateValues returns all values of the enum

func (State) IsAState

func (i State) IsAState() bool

IsAState returns "true" if the value is listed in the enum definition. "false" otherwise

func (State) String

func (i State) String() string

Jump to

Keyboard shortcuts

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