approvalrule

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package approvalrule implements functionality related to Phobos approval rules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateApprovalRuleInput

type CreateApprovalRuleInput struct {
	Scope             models.ScopeType
	OrgID             *string
	ProjectID         *string
	Name              string
	Description       string
	UserIDs           []string
	ServiceAccountIDs []string
	TeamIDs           []string
	ApprovalsRequired int
}

CreateApprovalRuleInput is the input for creating a approval rule

type DeleteApprovalRuleInput

type DeleteApprovalRuleInput struct {
	Version *int
	ID      string
}

DeleteApprovalRuleInput is the input for deleting a approval rule

type GetApprovalRulesInput

type GetApprovalRulesInput struct {
	// Sort specifies the field to sort on and direction
	Sort *db.ApprovalRuleSortableField
	// PaginationOptions supports cursor based pagination
	PaginationOptions *pagination.Options
	// OrganizationID filters the approval rules by the specified organization
	OrganizationID *string
	// ProjectID filters the approval rules by the specified project
	ProjectID *string
	// ApprovalRuleScopes will filter the approval rules that are scope to specific level
	ApprovalRuleScopes []models.ScopeType
}

GetApprovalRulesInput is the input for querying a list of approval rules

type Service

type Service interface {
	GetApprovalRuleByID(ctx context.Context, id string) (*models.ApprovalRule, error)
	GetApprovalRuleByPRN(ctx context.Context, prn string) (*models.ApprovalRule, error)
	GetApprovalRulesByIDs(ctx context.Context, idList []string) ([]*models.ApprovalRule, error)
	GetApprovalRules(ctx context.Context, input *GetApprovalRulesInput) (*db.ApprovalRulesResult, error)
	CreateApprovalRule(ctx context.Context, input *CreateApprovalRuleInput) (*models.ApprovalRule, error)
	UpdateApprovalRule(ctx context.Context, input *UpdateApprovalRuleInput) (*models.ApprovalRule, error)
	DeleteApprovalRule(ctx context.Context, input *DeleteApprovalRuleInput) error
}

Service implements all approval rule related functionality

func NewService

func NewService(
	logger logger.Logger,
	dbClient *db.Client,
	limitChecker limits.LimitChecker,
	activityService activityevent.Service,
) Service

NewService returns an instance of Service

type UpdateApprovalRuleInput

type UpdateApprovalRuleInput struct {
	Version           *int
	Description       *string
	ID                string
	UserIDs           []string
	ServiceAccountIDs []string
	TeamIDs           []string
}

UpdateApprovalRuleInput is the input for updating a approval rule For now, a approval rule cannot move between orgs or into or out of an org.

Jump to

Keyboard shortcuts

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