approval

package
v0.7.6-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPolicyNotFound                 = errors.New("policy not found")
	ErrDependencyApprovalStepNotFound = errors.New("unable to resolve approval step dependency")
	ErrApprovalStepConditionNotFound  = errors.New("unable to resolve designated condition")
	ErrNilResourceInAppeal            = errors.New("unable to resolve resource from the appeal")
	ErrInvalidConditionField          = errors.New("invalid condition field")

	ErrAppealStatusCanceled           = errors.New("appeal already canceled")
	ErrAppealStatusApproved           = errors.New("appeal already approved")
	ErrAppealStatusRejected           = errors.New("appeal already rejected")
	ErrAppealStatusBlocked            = errors.New("approval is blocked")
	ErrAppealStatusUnrecognized       = errors.New("unrecognized appeal status")
	ErrAppealDuplicate                = errors.New("appeal with the same resource and role already exists")
	ErrAppealInvalidExtensionDuration = errors.New("invalid appeal extension duration")
	ErrAppealFoundActiveGrant         = errors.New("user still have an active grant")
	ErrGrantNotEligibleForExtension   = errors.New("existing grant is not eligible for extension")
	ErrCannotCreateAppealForOtherUser = errors.New("creating appeal for other individual user (account_type=\"user\") is not allowed")

	ErrApprovalDependencyIsBlocked = errors.New("found previous approval step that is still in blocked")
	ErrApprovalDependencyIsPending = errors.New("found previous approval step that is still in pending")
	ErrApprovalStatusApproved      = errors.New("approval already approved")
	ErrApprovalStatusRejected      = errors.New("approval already rejected")
	ErrApprovalStatusSkipped       = errors.New("approval already skipped")
	ErrApprovalStatusUnrecognized  = errors.New("unrecognized approval status")
	ErrApprovalNotFound            = errors.New("approval not found")
	ErrUnableToAddApprover         = errors.New("unable to add a new approver")
	ErrUnableToDeleteApprover      = errors.New("unable to remove approver")

	ErrActionForbidden    = errors.New("user is not allowed to make action on this approval step")
	ErrActionInvalidValue = errors.New("invalid action value")
)

Functions

This section is empty.

Types

type Service

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

func NewService

func NewService(deps ServiceDeps) *Service

func (*Service) AddApprover

func (s *Service) AddApprover(ctx context.Context, approvalID, email string) error

func (*Service) BulkInsert

func (s *Service) BulkInsert(ctx context.Context, approvals []*domain.Approval) error

func (*Service) DeleteApprover

func (s *Service) DeleteApprover(ctx context.Context, approvalID, email string) error

func (*Service) GetApprovalsTotalCount added in v0.7.5

func (s *Service) GetApprovalsTotalCount(ctx context.Context, filters *domain.ListApprovalsFilter) (int64, error)

func (*Service) ListApprovals

func (s *Service) ListApprovals(ctx context.Context, filters *domain.ListApprovalsFilter) ([]*domain.Approval, error)

type ServiceDeps

type ServiceDeps struct {
	Repository    repository
	PolicyService policyService
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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