purchasing

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package purchasing owns the governed Purchase Request approval policy.

Index

Constants

View Source
const (
	ApprovalPolicyID            = "purchase-request-approval-v1"
	WorkflowApprovalSubmitGrant = "requests.purchase_request_approval"
	ApprovalAction              = "Approve"
	PurchaseRequest             = "Purchase Request"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApprovalStore

type ApprovalStore interface {
	AuthorizationRevisions(context.Context) (policyRevision, membershipRevision contract.Revision, err error)
	UserRoles(context.Context, string, contract.PrincipalID) (roles []string, active bool, err error)
	UsersWithRoles(context.Context, string, []string, int) ([]UserRoles, error)
	Subject(context.Context, *doctype.Registry, contract.SubjectRef) (*doctype.Document, string, error)
}

ApprovalStore supplies live subject and membership data. Implementations keep SQL and dialect behavior at the persistence boundary.

type RequestAuthorizer

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

RequestAuthorizer combines the baseline direct-task policy with the single registered Purchase Request approval policy. Other governed requests fail closed until their owning domain supplies a policy.

func NewRequestAuthorizer

func NewRequestAuthorizer(direct requests.Authorizer, store ApprovalStore, registry *doctype.Registry, policies flow.StatusPolicyReader) (*RequestAuthorizer, error)

func (*RequestAuthorizer) Management

func (*RequestAuthorizer) Response

func (*RequestAuthorizer) Submission

func (*RequestAuthorizer) Visibility

func (*RequestAuthorizer) WorkflowSubmission

WorkflowSubmission authorizes only the registered Purchase Request approval policy for a trusted workflow service with an exact service grant. Public/user submission continues through Submission and still requires a human actor.

type UserRoles

type UserRoles struct {
	Principal contract.PrincipalID
	Roles     []string
}

UserRoles is the current, database-backed tenant membership snapshot used while resolving or rechecking an approval participant.

Directories

Path Synopsis
Package engineadapter wires the purchasing domain into Engine's generic tenant-service extension points.
Package engineadapter wires the purchasing domain into Engine's generic tenant-service extension points.
Package sqlstore implements the tenant-backed data reads for purchasing approval policy.
Package sqlstore implements the tenant-backed data reads for purchasing approval policy.

Jump to

Keyboard shortcuts

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