stores

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AgreementStatusDraft      = "draft"
	AgreementStatusSent       = "sent"
	AgreementStatusInProgress = "in_progress"
	AgreementStatusCompleted  = "completed"
	AgreementStatusVoided     = "voided"
	AgreementStatusDeclined   = "declined"
	AgreementStatusExpired    = "expired"
)
View Source
const (
	RecipientRoleSigner = "signer"
	RecipientRoleCC     = "cc"
)
View Source
const (
	FieldTypeSignature  = "signature"
	FieldTypeName       = "name"
	FieldTypeDateSigned = "date_signed"
	FieldTypeText       = "text"
	FieldTypeCheckbox   = "checkbox"
	FieldTypeInitials   = "initials"
)
View Source
const (
	SigningTokenStatusActive  = "active"
	SigningTokenStatusRevoked = "revoked"
	SigningTokenStatusExpired = "expired"
)
View Source
const (
	ArtifactStageExecuted    = "executed"
	ArtifactStageCertificate = "certificate"
)
View Source
const (
	JobRunStatusPending   = "pending"
	JobRunStatusRetrying  = "retrying"
	JobRunStatusSucceeded = "succeeded"
	JobRunStatusFailed    = "failed"
)
View Source
const (
	GoogleImportRunStatusQueued    = "queued"
	GoogleImportRunStatusRunning   = "running"
	GoogleImportRunStatusSucceeded = "succeeded"
	GoogleImportRunStatusFailed    = "failed"
)
View Source
const (
	OutboxMessageStatusPending    = txoutbox.OutboxStatusPending
	OutboxMessageStatusProcessing = txoutbox.OutboxStatusProcessing
	OutboxMessageStatusRetrying   = txoutbox.OutboxStatusRetrying
	OutboxMessageStatusSucceeded  = txoutbox.OutboxStatusSucceeded
	OutboxMessageStatusFailed     = txoutbox.OutboxStatusFailed
)
View Source
const (
	SourceTypeUpload      = "upload"
	SourceTypeGoogleDrive = "google_drive"
)
View Source
const (
	MappingSpecStatusDraft     = "draft"
	MappingSpecStatusPublished = "published"
)
View Source
const (
	IntegrationSyncRunStatusPending   = "pending"
	IntegrationSyncRunStatusRunning   = "running"
	IntegrationSyncRunStatusCompleted = "completed"
	IntegrationSyncRunStatusFailed    = "failed"
)
View Source
const (
	IntegrationConflictStatusPending  = "pending"
	IntegrationConflictStatusResolved = "resolved"
	IntegrationConflictStatusIgnored  = "ignored"
)
View Source
const (
	PlacementSourceAuto   = "auto"
	PlacementSourceManual = "manual"
)
View Source
const (
	PlacementRunStatusCompleted       = "completed"
	PlacementRunStatusPartial         = "partial"
	PlacementRunStatusBudgetExhausted = "budget_exhausted"
	PlacementRunStatusTimedOut        = "timed_out"
	PlacementRunStatusFailed          = "failed"
)

Variables

This section is empty.

Functions

func ConfigureSQLiteConnection

func ConfigureSQLiteConnection(ctx context.Context, db *sql.DB) error

ConfigureSQLiteConnection applies pragmatic defaults for local concurrency.

func MinimizeAuditMetadata

func MinimizeAuditMetadata(input map[string]any) map[string]any

MinimizeAuditMetadata strips non-essential PII fields and truncates retained identity metadata.

func RegisterMigrations

func RegisterMigrations(client *persistence.Client) error

RegisterMigrations registers e-sign phase-1 dialect-aware migrations.

func ResolveSQLiteDSN

func ResolveSQLiteDSN() string

ResolveSQLiteDSN returns the preferred DSN for the e-sign example store.

func WithTxHooks

func WithTxHooks(ctx context.Context, txManager TransactionManager, fn func(tx TxStore, hooks *TxHooks) error) error

WithTxHooks executes fn in a write transaction and runs queued post-commit hooks only when commit succeeds.

Types

type AgreementArtifactRecord

type AgreementArtifactRecord struct {
	AgreementID          string
	TenantID             string
	OrgID                string
	ExecutedObjectKey    string
	ExecutedSHA256       string
	CertificateObjectKey string
	CertificateSHA256    string
	CorrelationID        string
	CreatedAt            time.Time
	UpdatedAt            time.Time
}

AgreementArtifactRecord stores immutable agreement-level executed/certificate artifact pointers.

type AgreementArtifactStore

type AgreementArtifactStore interface {
	SaveAgreementArtifacts(ctx context.Context, scope Scope, record AgreementArtifactRecord) (AgreementArtifactRecord, error)
	GetAgreementArtifacts(ctx context.Context, scope Scope, agreementID string) (AgreementArtifactRecord, error)
}

AgreementArtifactStore defines immutable persistence for executed/certificate agreement artifacts.

type AgreementDraftPatch

type AgreementDraftPatch struct {
	Title      *string
	Message    *string
	DocumentID *string
}

type AgreementMutationService

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

AgreementMutationService adds service-layer write guards around AgreementStore operations.

func NewAgreementMutationService

func NewAgreementMutationService(agreements AgreementStore) AgreementMutationService

func (AgreementMutationService) UpdateDraft

func (s AgreementMutationService) UpdateDraft(ctx context.Context, scope Scope, agreementID string, patch AgreementDraftPatch, expectedVersion int64) (AgreementRecord, error)

func (AgreementMutationService) UpsertRecipientDraft

func (s AgreementMutationService) UpsertRecipientDraft(ctx context.Context, scope Scope, agreementID string, patch RecipientDraftPatch, expectedVersion int64) (RecipientRecord, error)

type AgreementQuery

type AgreementQuery struct {
	Status   string
	Limit    int
	Offset   int
	SortDesc bool
}

type AgreementRecord

type AgreementRecord struct {
	ID                     string
	TenantID               string
	OrgID                  string
	DocumentID             string
	SourceType             string
	SourceGoogleFileID     string
	SourceGoogleDocURL     string
	SourceModifiedTime     *time.Time
	SourceExportedAt       *time.Time
	SourceExportedByUserID string
	SourceMimeType         string
	SourceIngestionMode    string
	Status                 string
	Title                  string
	Message                string
	Version                int64
	SentAt                 *time.Time
	CompletedAt            *time.Time
	VoidedAt               *time.Time
	DeclinedAt             *time.Time
	ExpiredAt              *time.Time
	CreatedByUserID        string
	UpdatedByUserID        string
	CreatedAt              time.Time
	UpdatedAt              time.Time
}

AgreementRecord captures draft/send lifecycle state with optimistic lock versioning.

type AgreementStore

type AgreementStore interface {
	CreateDraft(ctx context.Context, scope Scope, record AgreementRecord) (AgreementRecord, error)
	GetAgreement(ctx context.Context, scope Scope, id string) (AgreementRecord, error)
	ListAgreements(ctx context.Context, scope Scope, query AgreementQuery) ([]AgreementRecord, error)
	UpdateDraft(ctx context.Context, scope Scope, id string, patch AgreementDraftPatch, expectedVersion int64) (AgreementRecord, error)
	Transition(ctx context.Context, scope Scope, id string, input AgreementTransitionInput) (AgreementRecord, error)
	UpsertParticipantDraft(ctx context.Context, scope Scope, agreementID string, patch ParticipantDraftPatch, expectedVersion int64) (ParticipantRecord, error)
	DeleteParticipantDraft(ctx context.Context, scope Scope, agreementID, participantID string) error
	ListParticipants(ctx context.Context, scope Scope, agreementID string) ([]ParticipantRecord, error)
	UpsertRecipientDraft(ctx context.Context, scope Scope, agreementID string, patch RecipientDraftPatch, expectedVersion int64) (RecipientRecord, error)
	DeleteRecipientDraft(ctx context.Context, scope Scope, agreementID, recipientID string) error
	ListRecipients(ctx context.Context, scope Scope, agreementID string) ([]RecipientRecord, error)
	TouchRecipientView(ctx context.Context, scope Scope, agreementID, recipientID string, viewedAt time.Time) (RecipientRecord, error)
	CompleteRecipient(ctx context.Context, scope Scope, agreementID, recipientID string, completedAt time.Time, expectedVersion int64) (RecipientRecord, error)
	DeclineRecipient(ctx context.Context, scope Scope, agreementID, recipientID, reason string, declinedAt time.Time, expectedVersion int64) (RecipientRecord, error)
	UpsertFieldDefinitionDraft(ctx context.Context, scope Scope, agreementID string, patch FieldDefinitionDraftPatch) (FieldDefinitionRecord, error)
	DeleteFieldDefinitionDraft(ctx context.Context, scope Scope, agreementID, fieldDefinitionID string) error
	ListFieldDefinitions(ctx context.Context, scope Scope, agreementID string) ([]FieldDefinitionRecord, error)
	UpsertFieldInstanceDraft(ctx context.Context, scope Scope, agreementID string, patch FieldInstanceDraftPatch) (FieldInstanceRecord, error)
	DeleteFieldInstanceDraft(ctx context.Context, scope Scope, agreementID, fieldInstanceID string) error
	ListFieldInstances(ctx context.Context, scope Scope, agreementID string) ([]FieldInstanceRecord, error)
	UpsertFieldDraft(ctx context.Context, scope Scope, agreementID string, patch FieldDraftPatch) (FieldRecord, error)
	DeleteFieldDraft(ctx context.Context, scope Scope, agreementID, fieldID string) error
	ListFields(ctx context.Context, scope Scope, agreementID string) ([]FieldRecord, error)
}

AgreementStore defines agreement persistence with immutable-after-send and optimistic lock guards.

type AgreementTransitionInput

type AgreementTransitionInput struct {
	ToStatus        string
	ExpectedVersion int64
}

type AuditEventQuery

type AuditEventQuery struct {
	Limit    int
	Offset   int
	SortDesc bool
}

type AuditEventRecord

type AuditEventRecord struct {
	ID           string
	TenantID     string
	OrgID        string
	AgreementID  string
	EventType    string
	ActorType    string
	ActorID      string
	IPAddress    string
	UserAgent    string
	MetadataJSON string
	CreatedAt    time.Time
}

AuditEventRecord represents append-only lifecycle and security events.

type AuditEventStore

type AuditEventStore interface {
	Append(ctx context.Context, scope Scope, event AuditEventRecord) (AuditEventRecord, error)
	ListForAgreement(ctx context.Context, scope Scope, agreementID string, query AuditEventQuery) ([]AuditEventRecord, error)
}

AuditEventStore defines append-only audit event persistence.

type DocumentQuery

type DocumentQuery struct {
	TitleContains string
	Limit         int
	Offset        int
}

type DocumentRecord

type DocumentRecord struct {
	ID                     string
	TenantID               string
	OrgID                  string
	Title                  string
	SourceObjectKey        string
	SourceSHA256           string
	SourceType             string
	SourceGoogleFileID     string
	SourceGoogleDocURL     string
	SourceModifiedTime     *time.Time
	SourceExportedAt       *time.Time
	SourceExportedByUserID string
	SourceMimeType         string
	SourceIngestionMode    string
	SizeBytes              int64
	PageCount              int
	CreatedAt              time.Time
	UpdatedAt              time.Time
}

DocumentRecord captures immutable source PDF metadata.

type DocumentStore

type DocumentStore interface {
	Create(ctx context.Context, scope Scope, record DocumentRecord) (DocumentRecord, error)
	Get(ctx context.Context, scope Scope, id string) (DocumentRecord, error)
	List(ctx context.Context, scope Scope, query DocumentQuery) ([]DocumentRecord, error)
}

DocumentStore defines document persistence with explicit tenant/org scope inputs.

type DraftPatch

type DraftPatch struct {
	WizardStateJSON *string
	Title           *string
	CurrentStep     *int
	DocumentID      *string
	ExpiresAt       *time.Time
	UpdatedAt       *time.Time
}

type DraftQuery

type DraftQuery struct {
	CreatedByUserID string
	WizardID        string
	Limit           int
	Cursor          string
	SortDesc        bool
}

type DraftRecord

type DraftRecord struct {
	ID              string
	WizardID        string
	TenantID        string
	OrgID           string
	CreatedByUserID string
	DocumentID      string
	Title           string
	CurrentStep     int
	WizardStateJSON string
	Revision        int64
	CreatedAt       time.Time
	UpdatedAt       time.Time
	ExpiresAt       time.Time
}

DraftRecord stores six-step agreement wizard progress for cross-session recovery.

type DraftStore

type DraftStore interface {
	CreateDraftSession(ctx context.Context, scope Scope, record DraftRecord) (DraftRecord, bool, error)
	GetDraftSession(ctx context.Context, scope Scope, id string) (DraftRecord, error)
	ListDraftSessions(ctx context.Context, scope Scope, query DraftQuery) ([]DraftRecord, string, error)
	UpdateDraftSession(ctx context.Context, scope Scope, id string, patch DraftPatch, expectedRevision int64) (DraftRecord, error)
	DeleteDraftSession(ctx context.Context, scope Scope, id string) error
	DeleteExpiredDraftSessions(ctx context.Context, before time.Time) (int, error)
}

DraftStore defines six-step agreement wizard draft persistence with revision preconditions.

type DraftUpgradeIssue

type DraftUpgradeIssue struct {
	Field   string
	Message string
}

DraftUpgradeIssue captures unmet v2 invariants discovered during upgrade.

type DraftUpgradeReport

type DraftUpgradeReport struct {
	AgreementID string
	Upgraded    bool
	Actions     []string
	Issues      []DraftUpgradeIssue
}

DraftUpgradeReport captures normalization actions and residual issues.

func UpgradeDraftAgreementToV2

func UpgradeDraftAgreementToV2(ctx context.Context, agreements AgreementStore, scope Scope, agreementID string) (DraftUpgradeReport, error)

UpgradeDraftAgreementToV2 normalizes draft records to v2 participant/field invariants.

func UpgradeDraftAgreementsToV2

func UpgradeDraftAgreementsToV2(ctx context.Context, agreements AgreementStore, scope Scope, agreementIDs []string) ([]DraftUpgradeReport, error)

UpgradeDraftAgreementsToV2 upgrades a scoped batch of draft agreements.

type EmailLogRecord

type EmailLogRecord struct {
	ID                string
	TenantID          string
	OrgID             string
	AgreementID       string
	RecipientID       string
	TemplateCode      string
	ProviderMessageID string
	Status            string
	FailureReason     string
	AttemptCount      int
	MaxAttempts       int
	CorrelationID     string
	NextRetryAt       *time.Time
	SentAt            *time.Time
	CreatedAt         time.Time
	UpdatedAt         time.Time
}

EmailLogRecord captures outbound email attempts and provider outcomes.

type EmailLogStore

type EmailLogStore interface {
	CreateEmailLog(ctx context.Context, scope Scope, record EmailLogRecord) (EmailLogRecord, error)
	UpdateEmailLog(ctx context.Context, scope Scope, id string, patch EmailLogRecord) (EmailLogRecord, error)
	ListEmailLogs(ctx context.Context, scope Scope, agreementID string) ([]EmailLogRecord, error)
}

EmailLogStore defines persistence for outbound email execution state and retry metadata.

type ExternalFieldRef

type ExternalFieldRef struct {
	Object          string
	Field           string
	Type            string
	Required        bool
	ConstraintsJSON string
}

ExternalFieldRef is the canonical normalized field descriptor for an external provider schema.

type ExternalSchema

type ExternalSchema struct {
	ObjectType string
	Version    string
	Fields     []ExternalFieldRef
}

ExternalSchema captures a provider-agnostic external object schema contract.

type FieldDefinitionDraftPatch

type FieldDefinitionDraftPatch struct {
	ID             string
	ParticipantID  *string
	Type           *string
	Required       *bool
	ValidationJSON *string
}

type FieldDefinitionRecord

type FieldDefinitionRecord struct {
	ID             string
	TenantID       string
	OrgID          string
	AgreementID    string
	ParticipantID  string
	Type           string
	Required       bool
	ValidationJSON string
	CreatedAt      time.Time
	UpdatedAt      time.Time
}

FieldDefinitionRecord is the canonical v2 logical field model.

type FieldDraftPatch

type FieldDraftPatch struct {
	ID          string
	RecipientID *string
	Type        *string
	PageNumber  *int
	PosX        *float64
	PosY        *float64
	Width       *float64
	Height      *float64
	Required    *bool
}

type FieldInstanceDraftPatch

type FieldInstanceDraftPatch struct {
	ID                string
	FieldDefinitionID *string
	PageNumber        *int
	X                 *float64
	Y                 *float64
	Width             *float64
	Height            *float64
	TabIndex          *int
	Label             *string
	AppearanceJSON    *string
	PlacementSource   *string
	ResolverID        *string
	Confidence        *float64
	PlacementRunID    *string
	ManualOverride    *bool
}

type FieldInstanceRecord

type FieldInstanceRecord struct {
	ID                string
	TenantID          string
	OrgID             string
	AgreementID       string
	FieldDefinitionID string
	PageNumber        int
	X                 float64
	Y                 float64
	Width             float64
	Height            float64
	TabIndex          int
	Label             string
	AppearanceJSON    string
	PlacementSource   string
	ResolverID        string
	Confidence        float64
	PlacementRunID    string
	ManualOverride    bool
	CreatedAt         time.Time
	UpdatedAt         time.Time
}

FieldInstanceRecord stores canonical v2 placement data for a field definition.

type FieldRecord

type FieldRecord struct {
	ID                string
	FieldDefinitionID string
	TenantID          string
	OrgID             string
	AgreementID       string
	RecipientID       string
	Type              string
	PageNumber        int
	PosX              float64
	PosY              float64
	Width             float64
	Height            float64
	Required          bool
	CreatedAt         time.Time
	UpdatedAt         time.Time
}

FieldRecord stores e-sign field placements and assignment.

type FieldValueRecord

type FieldValueRecord struct {
	ID                  string
	TenantID            string
	OrgID               string
	AgreementID         string
	RecipientID         string
	FieldID             string
	ValueText           string
	ValueBool           *bool
	SignatureArtifactID string
	Version             int64
	CreatedAt           time.Time
	UpdatedAt           time.Time
}

FieldValueRecord stores signer-provided values for fields.

type FixtureSet

type FixtureSet struct {
	DocumentID              string
	AgreementID             string
	RecipientID             string
	ParticipantID           string
	FieldDefinitionID       string
	FieldInstanceID         string
	SigningTokenID          string
	FieldID                 string
	FieldValueID            string
	SignatureArtifactID     string
	AuditEventID            string
	EmailLogID              string
	IntegrationCredentialID string
}

FixtureSet identifies seeded phase-1 records used by integration tests.

func SeedCoreFixtures

func SeedCoreFixtures(ctx context.Context, db *bun.DB, scope Scope) (FixtureSet, error)

SeedCoreFixtures inserts one scope-bound record for each phase-1 core table.

type GoogleImportRunFailureInput

type GoogleImportRunFailureInput struct {
	ErrorCode        string
	ErrorMessage     string
	ErrorDetailsJSON string
	CompletedAt      time.Time
}

GoogleImportRunFailureInput captures terminal failure payload for an import run.

type GoogleImportRunInput

type GoogleImportRunInput struct {
	UserID            string
	GoogleFileID      string
	SourceVersionHint string
	DedupeKey         string
	DocumentTitle     string
	AgreementTitle    string
	CreatedByUserID   string
	CorrelationID     string
	RequestedAt       time.Time
}

GoogleImportRunInput captures dedupe-aware async Google import run submission.

type GoogleImportRunQuery

type GoogleImportRunQuery struct {
	UserID   string
	Limit    int
	Cursor   string
	SortDesc bool
}

GoogleImportRunQuery controls scoped import-run listing and pagination.

type GoogleImportRunRecord

type GoogleImportRunRecord struct {
	ID                string
	TenantID          string
	OrgID             string
	UserID            string
	GoogleFileID      string
	SourceVersionHint string
	DedupeKey         string
	DocumentTitle     string
	AgreementTitle    string
	CreatedByUserID   string
	CorrelationID     string
	Status            string
	DocumentID        string
	AgreementID       string
	SourceMimeType    string
	IngestionMode     string
	ErrorCode         string
	ErrorMessage      string
	ErrorDetailsJSON  string
	CreatedAt         time.Time
	UpdatedAt         time.Time
	StartedAt         *time.Time
	CompletedAt       *time.Time
}

GoogleImportRunRecord stores async Google Drive import execution state and result payload.

type GoogleImportRunStore

type GoogleImportRunStore interface {
	BeginGoogleImportRun(ctx context.Context, scope Scope, input GoogleImportRunInput) (GoogleImportRunRecord, bool, error)
	MarkGoogleImportRunRunning(ctx context.Context, scope Scope, id string, startedAt time.Time) (GoogleImportRunRecord, error)
	MarkGoogleImportRunSucceeded(ctx context.Context, scope Scope, id string, input GoogleImportRunSuccessInput) (GoogleImportRunRecord, error)
	MarkGoogleImportRunFailed(ctx context.Context, scope Scope, id string, input GoogleImportRunFailureInput) (GoogleImportRunRecord, error)
	GetGoogleImportRun(ctx context.Context, scope Scope, id string) (GoogleImportRunRecord, error)
	ListGoogleImportRuns(ctx context.Context, scope Scope, query GoogleImportRunQuery) ([]GoogleImportRunRecord, string, error)
}

GoogleImportRunStore defines async Google import lifecycle persistence with scoped idempotent dedupe.

type GoogleImportRunSuccessInput

type GoogleImportRunSuccessInput struct {
	DocumentID     string
	AgreementID    string
	SourceMimeType string
	IngestionMode  string
	CompletedAt    time.Time
}

GoogleImportRunSuccessInput captures terminal success payload for an import run.

type InMemoryStore

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

InMemoryStore is a phase-1 repository implementation with scope-safe query helpers.

func NewInMemoryStore

func NewInMemoryStore() *InMemoryStore

func (*InMemoryStore) Append

func (s *InMemoryStore) Append(ctx context.Context, scope Scope, event AuditEventRecord) (AuditEventRecord, error)

func (*InMemoryStore) AppendIntegrationChangeEvent

func (s *InMemoryStore) AppendIntegrationChangeEvent(ctx context.Context, scope Scope, record IntegrationChangeEventRecord) (IntegrationChangeEventRecord, error)

func (*InMemoryStore) BeginGoogleImportRun

func (s *InMemoryStore) BeginGoogleImportRun(ctx context.Context, scope Scope, input GoogleImportRunInput) (GoogleImportRunRecord, bool, error)

func (*InMemoryStore) BeginJobRun

func (s *InMemoryStore) BeginJobRun(ctx context.Context, scope Scope, input JobRunInput) (JobRunRecord, bool, error)

func (*InMemoryStore) ClaimIntegrationMutation

func (s *InMemoryStore) ClaimIntegrationMutation(ctx context.Context, scope Scope, idempotencyKey string, firstSeenAt time.Time) (bool, error)

func (*InMemoryStore) ClaimOutboxMessages

func (s *InMemoryStore) ClaimOutboxMessages(ctx context.Context, scope Scope, input OutboxClaimInput) ([]OutboxMessageRecord, error)

func (*InMemoryStore) CompleteRecipient

func (s *InMemoryStore) CompleteRecipient(ctx context.Context, scope Scope, agreementID, recipientID string, completedAt time.Time, expectedVersion int64) (RecipientRecord, error)

func (*InMemoryStore) Create

func (s *InMemoryStore) Create(ctx context.Context, scope Scope, record DocumentRecord) (DocumentRecord, error)

func (*InMemoryStore) CreateDraft

func (s *InMemoryStore) CreateDraft(ctx context.Context, scope Scope, record AgreementRecord) (AgreementRecord, error)

func (*InMemoryStore) CreateDraftSession

func (s *InMemoryStore) CreateDraftSession(ctx context.Context, scope Scope, record DraftRecord) (DraftRecord, bool, error)

func (*InMemoryStore) CreateEmailLog

func (s *InMemoryStore) CreateEmailLog(ctx context.Context, scope Scope, record EmailLogRecord) (EmailLogRecord, error)

func (*InMemoryStore) CreateIntegrationConflict

func (s *InMemoryStore) CreateIntegrationConflict(ctx context.Context, scope Scope, record IntegrationConflictRecord) (IntegrationConflictRecord, error)

func (*InMemoryStore) CreateIntegrationSyncRun

func (s *InMemoryStore) CreateIntegrationSyncRun(ctx context.Context, scope Scope, record IntegrationSyncRunRecord) (IntegrationSyncRunRecord, error)

func (*InMemoryStore) CreateSignatureArtifact

func (s *InMemoryStore) CreateSignatureArtifact(ctx context.Context, scope Scope, record SignatureArtifactRecord) (SignatureArtifactRecord, error)

func (*InMemoryStore) CreateSigningToken

func (s *InMemoryStore) CreateSigningToken(ctx context.Context, scope Scope, record SigningTokenRecord) (SigningTokenRecord, error)

func (*InMemoryStore) DeclineRecipient

func (s *InMemoryStore) DeclineRecipient(ctx context.Context, scope Scope, agreementID, recipientID, reason string, declinedAt time.Time, expectedVersion int64) (RecipientRecord, error)

func (*InMemoryStore) DeleteAuditEvent

func (s *InMemoryStore) DeleteAuditEvent(ctx context.Context, scope Scope, id string) error

DeleteAuditEvent always rejects writes because audit_events is append-only.

func (*InMemoryStore) DeleteDraftSession

func (s *InMemoryStore) DeleteDraftSession(ctx context.Context, scope Scope, id string) error

func (*InMemoryStore) DeleteExpiredDraftSessions

func (s *InMemoryStore) DeleteExpiredDraftSessions(ctx context.Context, before time.Time) (int, error)

func (*InMemoryStore) DeleteFieldDefinitionDraft

func (s *InMemoryStore) DeleteFieldDefinitionDraft(ctx context.Context, scope Scope, agreementID, fieldDefinitionID string) error

func (*InMemoryStore) DeleteFieldDraft

func (s *InMemoryStore) DeleteFieldDraft(ctx context.Context, scope Scope, agreementID, fieldID string) error

func (*InMemoryStore) DeleteFieldInstanceDraft

func (s *InMemoryStore) DeleteFieldInstanceDraft(ctx context.Context, scope Scope, agreementID, fieldInstanceID string) error

func (*InMemoryStore) DeleteIntegrationCredential

func (s *InMemoryStore) DeleteIntegrationCredential(ctx context.Context, scope Scope, provider, userID string) error

func (*InMemoryStore) DeleteParticipantDraft

func (s *InMemoryStore) DeleteParticipantDraft(ctx context.Context, scope Scope, agreementID, participantID string) error

func (*InMemoryStore) DeleteRecipientDraft

func (s *InMemoryStore) DeleteRecipientDraft(ctx context.Context, scope Scope, agreementID, recipientID string) error

func (*InMemoryStore) DeleteSignerProfile added in v0.26.0

func (s *InMemoryStore) DeleteSignerProfile(ctx context.Context, scope Scope, subject, key string) error

func (*InMemoryStore) EnqueueOutboxMessage

func (s *InMemoryStore) EnqueueOutboxMessage(ctx context.Context, scope Scope, record OutboxMessageRecord) (OutboxMessageRecord, error)

func (*InMemoryStore) Get

func (s *InMemoryStore) Get(ctx context.Context, scope Scope, id string) (DocumentRecord, error)

func (*InMemoryStore) GetAgreement

func (s *InMemoryStore) GetAgreement(ctx context.Context, scope Scope, id string) (AgreementRecord, error)

func (*InMemoryStore) GetAgreementArtifacts

func (s *InMemoryStore) GetAgreementArtifacts(ctx context.Context, scope Scope, agreementID string) (AgreementArtifactRecord, error)

func (*InMemoryStore) GetDraftSession

func (s *InMemoryStore) GetDraftSession(ctx context.Context, scope Scope, id string) (DraftRecord, error)

func (*InMemoryStore) GetGoogleImportRun

func (s *InMemoryStore) GetGoogleImportRun(ctx context.Context, scope Scope, id string) (GoogleImportRunRecord, error)

func (*InMemoryStore) GetIntegrationBindingByExternal

func (s *InMemoryStore) GetIntegrationBindingByExternal(ctx context.Context, scope Scope, provider, entityKind, externalID string) (IntegrationBindingRecord, error)

func (*InMemoryStore) GetIntegrationConflict

func (s *InMemoryStore) GetIntegrationConflict(ctx context.Context, scope Scope, id string) (IntegrationConflictRecord, error)

func (*InMemoryStore) GetIntegrationCredential

func (s *InMemoryStore) GetIntegrationCredential(ctx context.Context, scope Scope, provider, userID string) (IntegrationCredentialRecord, error)

func (*InMemoryStore) GetIntegrationSyncRun

func (s *InMemoryStore) GetIntegrationSyncRun(ctx context.Context, scope Scope, id string) (IntegrationSyncRunRecord, error)

func (*InMemoryStore) GetJobRunByDedupe

func (s *InMemoryStore) GetJobRunByDedupe(ctx context.Context, scope Scope, jobName, dedupeKey string) (JobRunRecord, error)

func (*InMemoryStore) GetMappingSpec

func (s *InMemoryStore) GetMappingSpec(ctx context.Context, scope Scope, id string) (MappingSpecRecord, error)

func (*InMemoryStore) GetPlacementRun

func (s *InMemoryStore) GetPlacementRun(ctx context.Context, scope Scope, agreementID, runID string) (PlacementRunRecord, error)

func (*InMemoryStore) GetSignatureArtifact

func (s *InMemoryStore) GetSignatureArtifact(ctx context.Context, scope Scope, id string) (SignatureArtifactRecord, error)

func (*InMemoryStore) GetSignerProfile added in v0.26.0

func (s *InMemoryStore) GetSignerProfile(ctx context.Context, scope Scope, subject, key string, now time.Time) (SignerProfileRecord, error)

func (*InMemoryStore) GetSigningTokenByHash

func (s *InMemoryStore) GetSigningTokenByHash(ctx context.Context, scope Scope, tokenHash string) (SigningTokenRecord, error)

func (*InMemoryStore) List

func (s *InMemoryStore) List(ctx context.Context, scope Scope, query DocumentQuery) ([]DocumentRecord, error)

func (*InMemoryStore) ListAgreements

func (s *InMemoryStore) ListAgreements(ctx context.Context, scope Scope, query AgreementQuery) ([]AgreementRecord, error)

func (*InMemoryStore) ListDraftSessions

func (s *InMemoryStore) ListDraftSessions(ctx context.Context, scope Scope, query DraftQuery) ([]DraftRecord, string, error)

func (*InMemoryStore) ListEmailLogs

func (s *InMemoryStore) ListEmailLogs(ctx context.Context, scope Scope, agreementID string) ([]EmailLogRecord, error)

func (*InMemoryStore) ListFieldDefinitions

func (s *InMemoryStore) ListFieldDefinitions(ctx context.Context, scope Scope, agreementID string) ([]FieldDefinitionRecord, error)

func (*InMemoryStore) ListFieldInstances

func (s *InMemoryStore) ListFieldInstances(ctx context.Context, scope Scope, agreementID string) ([]FieldInstanceRecord, error)

func (*InMemoryStore) ListFieldValuesByRecipient

func (s *InMemoryStore) ListFieldValuesByRecipient(ctx context.Context, scope Scope, agreementID, recipientID string) ([]FieldValueRecord, error)

func (*InMemoryStore) ListFields

func (s *InMemoryStore) ListFields(ctx context.Context, scope Scope, agreementID string) ([]FieldRecord, error)

func (*InMemoryStore) ListForAgreement

func (s *InMemoryStore) ListForAgreement(ctx context.Context, scope Scope, agreementID string, query AuditEventQuery) ([]AuditEventRecord, error)

func (*InMemoryStore) ListGoogleImportRuns

func (s *InMemoryStore) ListGoogleImportRuns(ctx context.Context, scope Scope, query GoogleImportRunQuery) ([]GoogleImportRunRecord, string, error)

func (*InMemoryStore) ListIntegrationBindings

func (s *InMemoryStore) ListIntegrationBindings(ctx context.Context, scope Scope, provider, entityKind, internalID string) ([]IntegrationBindingRecord, error)

func (*InMemoryStore) ListIntegrationChangeEvents

func (s *InMemoryStore) ListIntegrationChangeEvents(ctx context.Context, scope Scope, agreementID string) ([]IntegrationChangeEventRecord, error)

func (*InMemoryStore) ListIntegrationCheckpoints

func (s *InMemoryStore) ListIntegrationCheckpoints(ctx context.Context, scope Scope, runID string) ([]IntegrationCheckpointRecord, error)

func (*InMemoryStore) ListIntegrationConflicts

func (s *InMemoryStore) ListIntegrationConflicts(ctx context.Context, scope Scope, runID, status string) ([]IntegrationConflictRecord, error)

func (*InMemoryStore) ListIntegrationCredentials

func (s *InMemoryStore) ListIntegrationCredentials(ctx context.Context, scope Scope, provider string, baseUserIDPrefix string) ([]IntegrationCredentialRecord, error)

func (*InMemoryStore) ListIntegrationSyncRuns

func (s *InMemoryStore) ListIntegrationSyncRuns(ctx context.Context, scope Scope, provider string) ([]IntegrationSyncRunRecord, error)

func (*InMemoryStore) ListJobRuns

func (s *InMemoryStore) ListJobRuns(ctx context.Context, scope Scope, agreementID string) ([]JobRunRecord, error)

func (*InMemoryStore) ListMappingSpecs

func (s *InMemoryStore) ListMappingSpecs(ctx context.Context, scope Scope, provider string) ([]MappingSpecRecord, error)

func (*InMemoryStore) ListOutboxMessages

func (s *InMemoryStore) ListOutboxMessages(ctx context.Context, scope Scope, query OutboxQuery) ([]OutboxMessageRecord, error)

func (*InMemoryStore) ListParticipants

func (s *InMemoryStore) ListParticipants(ctx context.Context, scope Scope, agreementID string) ([]ParticipantRecord, error)

func (*InMemoryStore) ListPlacementRuns

func (s *InMemoryStore) ListPlacementRuns(ctx context.Context, scope Scope, agreementID string) ([]PlacementRunRecord, error)

func (*InMemoryStore) ListRecipients

func (s *InMemoryStore) ListRecipients(ctx context.Context, scope Scope, agreementID string) ([]RecipientRecord, error)

func (*InMemoryStore) MarkGoogleImportRunFailed

func (s *InMemoryStore) MarkGoogleImportRunFailed(ctx context.Context, scope Scope, id string, input GoogleImportRunFailureInput) (GoogleImportRunRecord, error)

func (*InMemoryStore) MarkGoogleImportRunRunning

func (s *InMemoryStore) MarkGoogleImportRunRunning(ctx context.Context, scope Scope, id string, startedAt time.Time) (GoogleImportRunRecord, error)

func (*InMemoryStore) MarkGoogleImportRunSucceeded

func (s *InMemoryStore) MarkGoogleImportRunSucceeded(ctx context.Context, scope Scope, id string, input GoogleImportRunSuccessInput) (GoogleImportRunRecord, error)

func (*InMemoryStore) MarkJobRunFailed

func (s *InMemoryStore) MarkJobRunFailed(ctx context.Context, scope Scope, id, failureReason string, nextRetryAt *time.Time, failedAt time.Time) (JobRunRecord, error)

func (*InMemoryStore) MarkJobRunSucceeded

func (s *InMemoryStore) MarkJobRunSucceeded(ctx context.Context, scope Scope, id string, completedAt time.Time) (JobRunRecord, error)

func (*InMemoryStore) MarkOutboxMessageFailed

func (s *InMemoryStore) MarkOutboxMessageFailed(ctx context.Context, scope Scope, id, failureReason string, nextAttemptAt *time.Time, failedAt time.Time) (OutboxMessageRecord, error)

func (*InMemoryStore) MarkOutboxMessageSucceeded

func (s *InMemoryStore) MarkOutboxMessageSucceeded(ctx context.Context, scope Scope, id string, publishedAt time.Time) (OutboxMessageRecord, error)

func (*InMemoryStore) PublishMappingSpec

func (s *InMemoryStore) PublishMappingSpec(ctx context.Context, scope Scope, id string, expectedVersion int64, publishedAt time.Time) (MappingSpecRecord, error)

func (*InMemoryStore) ResolveIntegrationConflict

func (s *InMemoryStore) ResolveIntegrationConflict(ctx context.Context, scope Scope, id, status, resolutionJSON, resolvedByUserID string, resolvedAt time.Time, expectedVersion int64) (IntegrationConflictRecord, error)

func (*InMemoryStore) RevokeActiveSigningTokens

func (s *InMemoryStore) RevokeActiveSigningTokens(ctx context.Context, scope Scope, agreementID, recipientID string, revokedAt time.Time) (int, error)

func (*InMemoryStore) SaveAgreementArtifacts

func (s *InMemoryStore) SaveAgreementArtifacts(ctx context.Context, scope Scope, record AgreementArtifactRecord) (AgreementArtifactRecord, error)

func (*InMemoryStore) TouchRecipientView

func (s *InMemoryStore) TouchRecipientView(ctx context.Context, scope Scope, agreementID, recipientID string, viewedAt time.Time) (RecipientRecord, error)

func (*InMemoryStore) Transition

func (s *InMemoryStore) Transition(ctx context.Context, scope Scope, id string, input AgreementTransitionInput) (AgreementRecord, error)

func (*InMemoryStore) UpdateAuditEvent

func (s *InMemoryStore) UpdateAuditEvent(ctx context.Context, scope Scope, id string, _ AuditEventRecord) error

UpdateAuditEvent always rejects writes because audit_events is append-only.

func (*InMemoryStore) UpdateDraft

func (s *InMemoryStore) UpdateDraft(ctx context.Context, scope Scope, id string, patch AgreementDraftPatch, expectedVersion int64) (AgreementRecord, error)

func (*InMemoryStore) UpdateDraftSession

func (s *InMemoryStore) UpdateDraftSession(ctx context.Context, scope Scope, id string, patch DraftPatch, expectedRevision int64) (DraftRecord, error)

func (*InMemoryStore) UpdateEmailLog

func (s *InMemoryStore) UpdateEmailLog(ctx context.Context, scope Scope, id string, patch EmailLogRecord) (EmailLogRecord, error)

func (*InMemoryStore) UpdateIntegrationSyncRunStatus

func (s *InMemoryStore) UpdateIntegrationSyncRunStatus(ctx context.Context, scope Scope, id, status, lastError, cursor string, completedAt *time.Time, expectedVersion int64) (IntegrationSyncRunRecord, error)

func (*InMemoryStore) UpsertFieldDefinitionDraft

func (s *InMemoryStore) UpsertFieldDefinitionDraft(ctx context.Context, scope Scope, agreementID string, patch FieldDefinitionDraftPatch) (FieldDefinitionRecord, error)

func (*InMemoryStore) UpsertFieldDraft

func (s *InMemoryStore) UpsertFieldDraft(ctx context.Context, scope Scope, agreementID string, patch FieldDraftPatch) (FieldRecord, error)

func (*InMemoryStore) UpsertFieldInstanceDraft

func (s *InMemoryStore) UpsertFieldInstanceDraft(ctx context.Context, scope Scope, agreementID string, patch FieldInstanceDraftPatch) (FieldInstanceRecord, error)

func (*InMemoryStore) UpsertFieldValue

func (s *InMemoryStore) UpsertFieldValue(ctx context.Context, scope Scope, value FieldValueRecord, expectedVersion int64) (FieldValueRecord, error)

func (*InMemoryStore) UpsertIntegrationBinding

func (s *InMemoryStore) UpsertIntegrationBinding(ctx context.Context, scope Scope, record IntegrationBindingRecord) (IntegrationBindingRecord, error)

func (*InMemoryStore) UpsertIntegrationCheckpoint

func (s *InMemoryStore) UpsertIntegrationCheckpoint(ctx context.Context, scope Scope, record IntegrationCheckpointRecord) (IntegrationCheckpointRecord, error)

func (*InMemoryStore) UpsertIntegrationCredential

func (s *InMemoryStore) UpsertIntegrationCredential(ctx context.Context, scope Scope, record IntegrationCredentialRecord) (IntegrationCredentialRecord, error)

func (*InMemoryStore) UpsertMappingSpec

func (s *InMemoryStore) UpsertMappingSpec(ctx context.Context, scope Scope, record MappingSpecRecord) (MappingSpecRecord, error)

func (*InMemoryStore) UpsertParticipantDraft

func (s *InMemoryStore) UpsertParticipantDraft(ctx context.Context, scope Scope, agreementID string, patch ParticipantDraftPatch, expectedVersion int64) (ParticipantRecord, error)

func (*InMemoryStore) UpsertPlacementRun

func (s *InMemoryStore) UpsertPlacementRun(ctx context.Context, scope Scope, record PlacementRunRecord) (PlacementRunRecord, error)

func (*InMemoryStore) UpsertRecipientDraft

func (s *InMemoryStore) UpsertRecipientDraft(ctx context.Context, scope Scope, agreementID string, patch RecipientDraftPatch, expectedVersion int64) (RecipientRecord, error)

func (*InMemoryStore) UpsertSignerProfile added in v0.26.0

func (s *InMemoryStore) UpsertSignerProfile(ctx context.Context, scope Scope, record SignerProfileRecord) (SignerProfileRecord, error)

func (*InMemoryStore) WithTx

func (s *InMemoryStore) WithTx(ctx context.Context, fn func(tx TxStore) error) error

WithTx executes fn within a transactional scope. InMemoryStore provides snapshot-based atomic commit semantics: all tx writes are applied on a cloned store and committed only on success.

type IntegrationBindingRecord

type IntegrationBindingRecord struct {
	ID             string
	TenantID       string
	OrgID          string
	Provider       string
	EntityKind     string
	ExternalID     string
	InternalID     string
	ProvenanceJSON string
	Version        int64
	CreatedAt      time.Time
	UpdatedAt      time.Time
}

IntegrationBindingRecord stores external-to-internal identity bindings with provenance.

type IntegrationChangeEventRecord

type IntegrationChangeEventRecord struct {
	ID             string
	TenantID       string
	OrgID          string
	AgreementID    string
	Provider       string
	EventType      string
	SourceEventID  string
	IdempotencyKey string
	PayloadJSON    string
	EmittedAt      time.Time
	CreatedAt      time.Time
}

IntegrationChangeEventRecord stores normalized outbound change envelopes.

type IntegrationCheckpointRecord

type IntegrationCheckpointRecord struct {
	ID            string
	TenantID      string
	OrgID         string
	RunID         string
	CheckpointKey string
	Cursor        string
	PayloadJSON   string
	Version       int64
	CreatedAt     time.Time
	UpdatedAt     time.Time
}

IntegrationCheckpointRecord stores resumable checkpoint markers for a sync run.

type IntegrationConflictRecord

type IntegrationConflictRecord struct {
	ID               string
	TenantID         string
	OrgID            string
	RunID            string
	BindingID        string
	Provider         string
	EntityKind       string
	ExternalID       string
	InternalID       string
	Status           string
	Reason           string
	PayloadJSON      string
	ResolutionJSON   string
	ResolvedByUserID string
	ResolvedAt       *time.Time
	Version          int64
	CreatedAt        time.Time
	UpdatedAt        time.Time
}

IntegrationConflictRecord stores explicit integration conflicts requiring operator action.

type IntegrationCredentialRecord

type IntegrationCredentialRecord struct {
	ID                    string
	TenantID              string
	OrgID                 string
	UserID                string
	Provider              string
	EncryptedAccessToken  string
	EncryptedRefreshToken string
	Scopes                []string
	ExpiresAt             *time.Time
	ProfileJSON           string     // OAuth profile data, e.g. {"email": "user@example.com"}
	LastUsedAt            *time.Time // Last API call using this credential
	CreatedAt             time.Time
	UpdatedAt             time.Time
}

IntegrationCredentialRecord stores encrypted provider credentials by scope and user.

type IntegrationCredentialStore

type IntegrationCredentialStore interface {
	UpsertIntegrationCredential(ctx context.Context, scope Scope, record IntegrationCredentialRecord) (IntegrationCredentialRecord, error)
	GetIntegrationCredential(ctx context.Context, scope Scope, provider, userID string) (IntegrationCredentialRecord, error)
	DeleteIntegrationCredential(ctx context.Context, scope Scope, provider, userID string) error
	// ListIntegrationCredentials returns all credentials for a provider, optionally filtered by base user ID prefix.
	// The baseUserIDPrefix filters credentials whose UserID starts with the given prefix (supports scoped user IDs).
	ListIntegrationCredentials(ctx context.Context, scope Scope, provider string, baseUserIDPrefix string) ([]IntegrationCredentialRecord, error)
}

IntegrationCredentialStore defines encrypted provider credential persistence by scope/user.

type IntegrationFoundationStore

type IntegrationFoundationStore interface {
	UpsertMappingSpec(ctx context.Context, scope Scope, record MappingSpecRecord) (MappingSpecRecord, error)
	GetMappingSpec(ctx context.Context, scope Scope, id string) (MappingSpecRecord, error)
	ListMappingSpecs(ctx context.Context, scope Scope, provider string) ([]MappingSpecRecord, error)
	PublishMappingSpec(ctx context.Context, scope Scope, id string, expectedVersion int64, publishedAt time.Time) (MappingSpecRecord, error)

	UpsertIntegrationBinding(ctx context.Context, scope Scope, record IntegrationBindingRecord) (IntegrationBindingRecord, error)
	GetIntegrationBindingByExternal(ctx context.Context, scope Scope, provider, entityKind, externalID string) (IntegrationBindingRecord, error)
	ListIntegrationBindings(ctx context.Context, scope Scope, provider, entityKind, internalID string) ([]IntegrationBindingRecord, error)

	CreateIntegrationSyncRun(ctx context.Context, scope Scope, record IntegrationSyncRunRecord) (IntegrationSyncRunRecord, error)
	UpdateIntegrationSyncRunStatus(ctx context.Context, scope Scope, id, status, lastError, cursor string, completedAt *time.Time, expectedVersion int64) (IntegrationSyncRunRecord, error)
	GetIntegrationSyncRun(ctx context.Context, scope Scope, id string) (IntegrationSyncRunRecord, error)
	ListIntegrationSyncRuns(ctx context.Context, scope Scope, provider string) ([]IntegrationSyncRunRecord, error)

	UpsertIntegrationCheckpoint(ctx context.Context, scope Scope, record IntegrationCheckpointRecord) (IntegrationCheckpointRecord, error)
	ListIntegrationCheckpoints(ctx context.Context, scope Scope, runID string) ([]IntegrationCheckpointRecord, error)

	CreateIntegrationConflict(ctx context.Context, scope Scope, record IntegrationConflictRecord) (IntegrationConflictRecord, error)
	GetIntegrationConflict(ctx context.Context, scope Scope, id string) (IntegrationConflictRecord, error)
	ListIntegrationConflicts(ctx context.Context, scope Scope, runID, status string) ([]IntegrationConflictRecord, error)
	ResolveIntegrationConflict(ctx context.Context, scope Scope, id, status, resolutionJSON, resolvedByUserID string, resolvedAt time.Time, expectedVersion int64) (IntegrationConflictRecord, error)

	AppendIntegrationChangeEvent(ctx context.Context, scope Scope, record IntegrationChangeEventRecord) (IntegrationChangeEventRecord, error)
	ListIntegrationChangeEvents(ctx context.Context, scope Scope, agreementID string) ([]IntegrationChangeEventRecord, error)

	ClaimIntegrationMutation(ctx context.Context, scope Scope, idempotencyKey string, firstSeenAt time.Time) (bool, error)
}

IntegrationFoundationStore defines provider-agnostic integration mapping/sync/conflict/event persistence.

type IntegrationSyncRunRecord

type IntegrationSyncRunRecord struct {
	ID              string
	TenantID        string
	OrgID           string
	Provider        string
	Direction       string
	MappingSpecID   string
	Status          string
	Cursor          string
	LastError       string
	AttemptCount    int
	Version         int64
	StartedAt       time.Time
	CompletedAt     *time.Time
	CreatedByUserID string
	CreatedAt       time.Time
	UpdatedAt       time.Time
}

IntegrationSyncRunRecord stores sync run lifecycle and resumable progress metadata.

type IssuedSigningToken

type IssuedSigningToken struct {
	Token  string
	Record SigningTokenRecord
}

IssuedSigningToken contains the opaque token value and persisted metadata.

type JobRunInput

type JobRunInput struct {
	JobName       string
	DedupeKey     string
	AgreementID   string
	RecipientID   string
	CorrelationID string
	MaxAttempts   int
	AttemptedAt   time.Time
}

JobRunInput captures parameters for dedupe-aware async job execution.

type JobRunRecord

type JobRunRecord struct {
	ID            string
	TenantID      string
	OrgID         string
	JobName       string
	DedupeKey     string
	AgreementID   string
	RecipientID   string
	CorrelationID string
	Status        string
	AttemptCount  int
	MaxAttempts   int
	LastError     string
	NextRetryAt   *time.Time
	CreatedAt     time.Time
	UpdatedAt     time.Time
}

JobRunRecord stores async execution state with dedupe and retry metadata.

type JobRunStore

type JobRunStore interface {
	BeginJobRun(ctx context.Context, scope Scope, input JobRunInput) (JobRunRecord, bool, error)
	MarkJobRunSucceeded(ctx context.Context, scope Scope, id string, completedAt time.Time) (JobRunRecord, error)
	MarkJobRunFailed(ctx context.Context, scope Scope, id, failureReason string, nextRetryAt *time.Time, failedAt time.Time) (JobRunRecord, error)
	GetJobRunByDedupe(ctx context.Context, scope Scope, jobName, dedupeKey string) (JobRunRecord, error)
	ListJobRuns(ctx context.Context, scope Scope, agreementID string) ([]JobRunRecord, error)
}

JobRunStore defines dedupe-aware async execution tracking for retryable jobs.

type MappingRule

type MappingRule struct {
	SourceObject string
	SourceField  string
	TargetEntity string
	TargetPath   string
	Required     bool
	DefaultValue string
	Transform    string
}

MappingRule maps an external source field to an internal e-sign target attribute.

type MappingSpecRecord

type MappingSpecRecord struct {
	ID              string
	TenantID        string
	OrgID           string
	Provider        string
	Name            string
	Version         int64
	Status          string
	ExternalSchema  ExternalSchema
	Rules           []MappingRule
	CompiledJSON    string
	CompiledHash    string
	PublishedAt     *time.Time
	CreatedByUserID string
	UpdatedByUserID string
	CreatedAt       time.Time
	UpdatedAt       time.Time
}

MappingSpecRecord stores a versioned provider-agnostic mapping contract.

type ObjectStorageSecurityPolicy

type ObjectStorageSecurityPolicy struct {
	RequireEncryption bool
	AllowedAlgorithms map[string]struct{}
}

ObjectStorageSecurityPolicy enforces encryption requirements for e-sign artifacts.

func DefaultObjectStorageSecurityPolicy

func DefaultObjectStorageSecurityPolicy() ObjectStorageSecurityPolicy

func (ObjectStorageSecurityPolicy) ValidateObjectWrite

func (p ObjectStorageSecurityPolicy) ValidateObjectWrite(objectKey, encryptionAlgorithm string) error

type OutboxClaimInput

type OutboxClaimInput = txoutbox.ClaimInput

OutboxClaimInput controls batched outbox claiming.

type OutboxDispatchInput

type OutboxDispatchInput = txoutbox.DispatchInput

OutboxDispatchInput controls outbox dispatch behavior.

type OutboxDispatchResult

type OutboxDispatchResult = txoutbox.DispatchResult

OutboxDispatchResult captures batch dispatch outcomes.

func DispatchOutboxBatch

func DispatchOutboxBatch(ctx context.Context, store OutboxStore, scope Scope, publisher OutboxPublisher, input OutboxDispatchInput) (OutboxDispatchResult, error)

DispatchOutboxBatch claims pending outbox messages and publishes them.

type OutboxMessageRecord

type OutboxMessageRecord = txoutbox.Message

OutboxMessageRecord stores durable side-effect events for post-commit dispatch.

type OutboxPublisher

type OutboxPublisher = txoutbox.Publisher

OutboxPublisher publishes outbox messages to external systems.

type OutboxQuery

type OutboxQuery = txoutbox.Query

type OutboxStore

type OutboxStore interface {
	txoutbox.Store[Scope]
}

OutboxStore defines durable post-commit side-effect message persistence.

type ParticipantDraftPatch

type ParticipantDraftPatch struct {
	ID           string
	Email        *string
	Name         *string
	Role         *string
	SigningStage *int
}

type ParticipantRecord

type ParticipantRecord struct {
	ID            string
	TenantID      string
	OrgID         string
	AgreementID   string
	Email         string
	Name          string
	Role          string
	SigningStage  int
	FirstViewAt   *time.Time
	LastViewAt    *time.Time
	DeclinedAt    *time.Time
	DeclineReason string
	CompletedAt   *time.Time
	Version       int64
	CreatedAt     time.Time
	UpdatedAt     time.Time
}

ParticipantRecord is the canonical v2 signer/cc routing entity.

type PlacementResolverScore

type PlacementResolverScore struct {
	ResolverID string
	Accuracy   float64
	Cost       float64
	Latency    float64
	Score      float64
	Supported  bool
	Reason     string
}

PlacementResolverScore stores per-resolver ranking metadata for a placement run.

type PlacementRunRecord

type PlacementRunRecord struct {
	ID                      string
	TenantID                string
	OrgID                   string
	AgreementID             string
	Status                  string
	ReasonCode              string
	ResolverOrder           []string
	ExecutedResolvers       []string
	ResolverScores          []PlacementResolverScore
	Suggestions             []PlacementSuggestionRecord
	SelectedSuggestionIDs   []string
	UnresolvedDefinitionIDs []string
	SelectedSource          string
	PolicyJSON              string
	MaxBudget               float64
	BudgetUsed              float64
	MaxTimeMS               int64
	ElapsedMS               int64
	ManualOverrideCount     int
	CreatedByUserID         string
	Version                 int64
	CreatedAt               time.Time
	UpdatedAt               time.Time
	CompletedAt             *time.Time
}

PlacementRunRecord stores placement-run execution and audit metadata.

type PlacementRunStore

type PlacementRunStore interface {
	UpsertPlacementRun(ctx context.Context, scope Scope, record PlacementRunRecord) (PlacementRunRecord, error)
	GetPlacementRun(ctx context.Context, scope Scope, agreementID, runID string) (PlacementRunRecord, error)
	ListPlacementRuns(ctx context.Context, scope Scope, agreementID string) ([]PlacementRunRecord, error)
}

PlacementRunStore defines placement-run persistence and retrieval contracts.

type PlacementSuggestionRecord

type PlacementSuggestionRecord struct {
	ID                string
	FieldDefinitionID string
	ResolverID        string
	Confidence        float64
	PageNumber        int
	X                 float64
	Y                 float64
	Width             float64
	Height            float64
	Label             string
	MetadataJSON      string
}

PlacementSuggestionRecord stores one suggestion emitted during a placement run.

type PostCommitHook

type PostCommitHook = txoutbox.PostCommitHook

PostCommitHook defines work executed only after a successful transaction commit.

type RecipientDraftPatch

type RecipientDraftPatch struct {
	ID           string
	Email        *string
	Name         *string
	Role         *string
	SigningOrder *int
}

type RecipientRecord

type RecipientRecord struct {
	ID          string
	TenantID    string
	OrgID       string
	AgreementID string
	Email       string
	Name        string
	Role        string

	SigningOrder  int
	FirstViewAt   *time.Time
	LastViewAt    *time.Time
	DeclinedAt    *time.Time
	DeclineReason string
	CompletedAt   *time.Time
	Version       int64
	CreatedAt     time.Time
	UpdatedAt     time.Time
}

RecipientRecord captures recipient routing and lifecycle telemetry.

type RetentionLifecycleCheck

type RetentionLifecycleCheck struct {
	CheckedAt        time.Time
	ArtifactDueCount int
	LogDueCount      int
	PIIDueCount      int
}

RetentionLifecycleCheck summarizes a periodic retention sweep evaluation.

type RetentionPolicy

type RetentionPolicy struct {
	ArtifactTTL    time.Duration
	LogTTL         time.Duration
	PIIMetadataTTL time.Duration
}

RetentionPolicy configures artifact, log, and PII metadata lifecycle controls.

func DefaultRetentionPolicy

func DefaultRetentionPolicy() RetentionPolicy

func (RetentionPolicy) EvaluateLifecycleCheck

func (p RetentionPolicy) EvaluateLifecycleCheck(now time.Time, artifactCreatedAt, logCreatedAt, piiCreatedAt []time.Time) RetentionLifecycleCheck

EvaluateLifecycleCheck counts records that should be purged for a periodic sweep.

func (RetentionPolicy) ShouldPurgeArtifact

func (p RetentionPolicy) ShouldPurgeArtifact(createdAt, now time.Time) bool

func (RetentionPolicy) ShouldPurgeLog

func (p RetentionPolicy) ShouldPurgeLog(createdAt, now time.Time) bool

func (RetentionPolicy) ShouldPurgePIIMetadata

func (p RetentionPolicy) ShouldPurgePIIMetadata(createdAt, now time.Time) bool

func (RetentionPolicy) Validate

func (p RetentionPolicy) Validate() error

type SQLiteStore

type SQLiteStore struct {
	*InMemoryStore
	// contains filtered or unexported fields
}

SQLiteStore persists e-sign domain data in SQLite while reusing InMemoryStore logic.

func NewSQLiteStore

func NewSQLiteStore(dsn string) (*SQLiteStore, error)

NewSQLiteStore creates a SQLite-backed e-sign store.

func (*SQLiteStore) Append

func (s *SQLiteStore) Append(ctx context.Context, scope Scope, event AuditEventRecord) (AuditEventRecord, error)

func (*SQLiteStore) AppendIntegrationChangeEvent

func (s *SQLiteStore) AppendIntegrationChangeEvent(ctx context.Context, scope Scope, record IntegrationChangeEventRecord) (IntegrationChangeEventRecord, error)

func (*SQLiteStore) BeginGoogleImportRun

func (s *SQLiteStore) BeginGoogleImportRun(ctx context.Context, scope Scope, input GoogleImportRunInput) (GoogleImportRunRecord, bool, error)

func (*SQLiteStore) BeginJobRun

func (s *SQLiteStore) BeginJobRun(ctx context.Context, scope Scope, input JobRunInput) (JobRunRecord, bool, error)

func (*SQLiteStore) ClaimIntegrationMutation

func (s *SQLiteStore) ClaimIntegrationMutation(ctx context.Context, scope Scope, idempotencyKey string, firstSeenAt time.Time) (bool, error)

func (*SQLiteStore) ClaimOutboxMessages

func (s *SQLiteStore) ClaimOutboxMessages(ctx context.Context, scope Scope, input OutboxClaimInput) ([]OutboxMessageRecord, error)

func (*SQLiteStore) Close

func (s *SQLiteStore) Close() error

Close closes the underlying SQLite connection.

func (*SQLiteStore) CompleteRecipient

func (s *SQLiteStore) CompleteRecipient(ctx context.Context, scope Scope, agreementID, recipientID string, completedAt time.Time, expectedVersion int64) (RecipientRecord, error)

func (*SQLiteStore) Create

func (s *SQLiteStore) Create(ctx context.Context, scope Scope, record DocumentRecord) (DocumentRecord, error)

func (*SQLiteStore) CreateDraft

func (s *SQLiteStore) CreateDraft(ctx context.Context, scope Scope, record AgreementRecord) (AgreementRecord, error)

func (*SQLiteStore) CreateDraftSession

func (s *SQLiteStore) CreateDraftSession(ctx context.Context, scope Scope, record DraftRecord) (DraftRecord, bool, error)

func (*SQLiteStore) CreateEmailLog

func (s *SQLiteStore) CreateEmailLog(ctx context.Context, scope Scope, record EmailLogRecord) (EmailLogRecord, error)

func (*SQLiteStore) CreateIntegrationConflict

func (s *SQLiteStore) CreateIntegrationConflict(ctx context.Context, scope Scope, record IntegrationConflictRecord) (IntegrationConflictRecord, error)

func (*SQLiteStore) CreateIntegrationSyncRun

func (s *SQLiteStore) CreateIntegrationSyncRun(ctx context.Context, scope Scope, record IntegrationSyncRunRecord) (IntegrationSyncRunRecord, error)

func (*SQLiteStore) CreateSignatureArtifact

func (s *SQLiteStore) CreateSignatureArtifact(ctx context.Context, scope Scope, record SignatureArtifactRecord) (SignatureArtifactRecord, error)

func (*SQLiteStore) CreateSigningToken

func (s *SQLiteStore) CreateSigningToken(ctx context.Context, scope Scope, record SigningTokenRecord) (SigningTokenRecord, error)

func (*SQLiteStore) DeclineRecipient

func (s *SQLiteStore) DeclineRecipient(ctx context.Context, scope Scope, agreementID, recipientID, reason string, declinedAt time.Time, expectedVersion int64) (RecipientRecord, error)

func (*SQLiteStore) DeleteDraftSession

func (s *SQLiteStore) DeleteDraftSession(ctx context.Context, scope Scope, id string) error

func (*SQLiteStore) DeleteExpiredDraftSessions

func (s *SQLiteStore) DeleteExpiredDraftSessions(ctx context.Context, before time.Time) (int, error)

func (*SQLiteStore) DeleteFieldDefinitionDraft

func (s *SQLiteStore) DeleteFieldDefinitionDraft(ctx context.Context, scope Scope, agreementID, fieldDefinitionID string) error

func (*SQLiteStore) DeleteFieldDraft

func (s *SQLiteStore) DeleteFieldDraft(ctx context.Context, scope Scope, agreementID, fieldID string) error

func (*SQLiteStore) DeleteFieldInstanceDraft

func (s *SQLiteStore) DeleteFieldInstanceDraft(ctx context.Context, scope Scope, agreementID, fieldInstanceID string) error

func (*SQLiteStore) DeleteIntegrationCredential

func (s *SQLiteStore) DeleteIntegrationCredential(ctx context.Context, scope Scope, provider, userID string) error

func (*SQLiteStore) DeleteParticipantDraft

func (s *SQLiteStore) DeleteParticipantDraft(ctx context.Context, scope Scope, agreementID, participantID string) error

func (*SQLiteStore) DeleteRecipientDraft

func (s *SQLiteStore) DeleteRecipientDraft(ctx context.Context, scope Scope, agreementID, recipientID string) error

func (*SQLiteStore) DeleteSignerProfile added in v0.26.0

func (s *SQLiteStore) DeleteSignerProfile(ctx context.Context, scope Scope, subject, key string) error

func (*SQLiteStore) EnqueueOutboxMessage

func (s *SQLiteStore) EnqueueOutboxMessage(ctx context.Context, scope Scope, record OutboxMessageRecord) (OutboxMessageRecord, error)

func (*SQLiteStore) Flush

func (s *SQLiteStore) Flush(ctx context.Context) error

Flush persists pending in-memory mutations to SQLite.

func (*SQLiteStore) ListIntegrationCredentials

func (s *SQLiteStore) ListIntegrationCredentials(ctx context.Context, scope Scope, provider string, baseUserIDPrefix string) ([]IntegrationCredentialRecord, error)

func (*SQLiteStore) MarkGoogleImportRunFailed

func (s *SQLiteStore) MarkGoogleImportRunFailed(ctx context.Context, scope Scope, id string, input GoogleImportRunFailureInput) (GoogleImportRunRecord, error)

func (*SQLiteStore) MarkGoogleImportRunRunning

func (s *SQLiteStore) MarkGoogleImportRunRunning(ctx context.Context, scope Scope, id string, startedAt time.Time) (GoogleImportRunRecord, error)

func (*SQLiteStore) MarkGoogleImportRunSucceeded

func (s *SQLiteStore) MarkGoogleImportRunSucceeded(ctx context.Context, scope Scope, id string, input GoogleImportRunSuccessInput) (GoogleImportRunRecord, error)

func (*SQLiteStore) MarkJobRunFailed

func (s *SQLiteStore) MarkJobRunFailed(ctx context.Context, scope Scope, id, failureReason string, nextRetryAt *time.Time, failedAt time.Time) (JobRunRecord, error)

func (*SQLiteStore) MarkJobRunSucceeded

func (s *SQLiteStore) MarkJobRunSucceeded(ctx context.Context, scope Scope, id string, completedAt time.Time) (JobRunRecord, error)

func (*SQLiteStore) MarkOutboxMessageFailed

func (s *SQLiteStore) MarkOutboxMessageFailed(ctx context.Context, scope Scope, id, failureReason string, nextAttemptAt *time.Time, failedAt time.Time) (OutboxMessageRecord, error)

func (*SQLiteStore) MarkOutboxMessageSucceeded

func (s *SQLiteStore) MarkOutboxMessageSucceeded(ctx context.Context, scope Scope, id string, publishedAt time.Time) (OutboxMessageRecord, error)

func (*SQLiteStore) PublishMappingSpec

func (s *SQLiteStore) PublishMappingSpec(ctx context.Context, scope Scope, id string, expectedVersion int64, publishedAt time.Time) (MappingSpecRecord, error)

func (*SQLiteStore) ResolveIntegrationConflict

func (s *SQLiteStore) ResolveIntegrationConflict(ctx context.Context, scope Scope, id, status, resolutionJSON, resolvedByUserID string, resolvedAt time.Time, expectedVersion int64) (IntegrationConflictRecord, error)

func (*SQLiteStore) RevokeActiveSigningTokens

func (s *SQLiteStore) RevokeActiveSigningTokens(ctx context.Context, scope Scope, agreementID, recipientID string, revokedAt time.Time) (int, error)

func (*SQLiteStore) SaveAgreementArtifacts

func (s *SQLiteStore) SaveAgreementArtifacts(ctx context.Context, scope Scope, record AgreementArtifactRecord) (AgreementArtifactRecord, error)

func (*SQLiteStore) TouchRecipientView

func (s *SQLiteStore) TouchRecipientView(ctx context.Context, scope Scope, agreementID, recipientID string, viewedAt time.Time) (RecipientRecord, error)

func (*SQLiteStore) Transition

func (s *SQLiteStore) Transition(ctx context.Context, scope Scope, id string, input AgreementTransitionInput) (AgreementRecord, error)

func (*SQLiteStore) UpdateDraft

func (s *SQLiteStore) UpdateDraft(ctx context.Context, scope Scope, id string, patch AgreementDraftPatch, expectedVersion int64) (AgreementRecord, error)

func (*SQLiteStore) UpdateDraftSession

func (s *SQLiteStore) UpdateDraftSession(ctx context.Context, scope Scope, id string, patch DraftPatch, expectedRevision int64) (DraftRecord, error)

func (*SQLiteStore) UpdateEmailLog

func (s *SQLiteStore) UpdateEmailLog(ctx context.Context, scope Scope, id string, patch EmailLogRecord) (EmailLogRecord, error)

func (*SQLiteStore) UpdateIntegrationSyncRunStatus

func (s *SQLiteStore) UpdateIntegrationSyncRunStatus(ctx context.Context, scope Scope, id, status, lastError, cursor string, completedAt *time.Time, expectedVersion int64) (IntegrationSyncRunRecord, error)

func (*SQLiteStore) UpsertFieldDefinitionDraft

func (s *SQLiteStore) UpsertFieldDefinitionDraft(ctx context.Context, scope Scope, agreementID string, patch FieldDefinitionDraftPatch) (FieldDefinitionRecord, error)

func (*SQLiteStore) UpsertFieldDraft

func (s *SQLiteStore) UpsertFieldDraft(ctx context.Context, scope Scope, agreementID string, patch FieldDraftPatch) (FieldRecord, error)

func (*SQLiteStore) UpsertFieldInstanceDraft

func (s *SQLiteStore) UpsertFieldInstanceDraft(ctx context.Context, scope Scope, agreementID string, patch FieldInstanceDraftPatch) (FieldInstanceRecord, error)

func (*SQLiteStore) UpsertFieldValue

func (s *SQLiteStore) UpsertFieldValue(ctx context.Context, scope Scope, value FieldValueRecord, expectedVersion int64) (FieldValueRecord, error)

func (*SQLiteStore) UpsertIntegrationBinding

func (s *SQLiteStore) UpsertIntegrationBinding(ctx context.Context, scope Scope, record IntegrationBindingRecord) (IntegrationBindingRecord, error)

func (*SQLiteStore) UpsertIntegrationCheckpoint

func (s *SQLiteStore) UpsertIntegrationCheckpoint(ctx context.Context, scope Scope, record IntegrationCheckpointRecord) (IntegrationCheckpointRecord, error)

func (*SQLiteStore) UpsertIntegrationCredential

func (s *SQLiteStore) UpsertIntegrationCredential(ctx context.Context, scope Scope, record IntegrationCredentialRecord) (IntegrationCredentialRecord, error)

func (*SQLiteStore) UpsertMappingSpec

func (s *SQLiteStore) UpsertMappingSpec(ctx context.Context, scope Scope, record MappingSpecRecord) (MappingSpecRecord, error)

func (*SQLiteStore) UpsertParticipantDraft

func (s *SQLiteStore) UpsertParticipantDraft(ctx context.Context, scope Scope, agreementID string, patch ParticipantDraftPatch, expectedVersion int64) (ParticipantRecord, error)

func (*SQLiteStore) UpsertPlacementRun

func (s *SQLiteStore) UpsertPlacementRun(ctx context.Context, scope Scope, record PlacementRunRecord) (PlacementRunRecord, error)

func (*SQLiteStore) UpsertRecipientDraft

func (s *SQLiteStore) UpsertRecipientDraft(ctx context.Context, scope Scope, agreementID string, patch RecipientDraftPatch, expectedVersion int64) (RecipientRecord, error)

func (*SQLiteStore) UpsertSignerProfile added in v0.26.0

func (s *SQLiteStore) UpsertSignerProfile(ctx context.Context, scope Scope, record SignerProfileRecord) (SignerProfileRecord, error)

func (*SQLiteStore) WithBatch

func (s *SQLiteStore) WithBatch(ctx context.Context, fn func() error) (err error)

WithBatch defers SQLite persistence until fn returns; changes are still applied in memory immediately.

func (*SQLiteStore) WithTx

func (s *SQLiteStore) WithTx(ctx context.Context, fn func(tx TxStore) error) error

WithTx executes fn within an atomic transactional scope and persists once on commit.

type Scope

type Scope struct {
	TenantID string
	OrgID    string
}

Scope captures tenant and organization context required by e-sign stores.

type SignatureArtifactRecord

type SignatureArtifactRecord struct {
	ID          string
	TenantID    string
	OrgID       string
	AgreementID string
	RecipientID string
	Type        string
	ObjectKey   string
	SHA256      string
	CreatedAt   time.Time
}

SignatureArtifactRecord stores uploaded signature artifacts.

type SignatureArtifactStore

type SignatureArtifactStore interface {
	CreateSignatureArtifact(ctx context.Context, scope Scope, record SignatureArtifactRecord) (SignatureArtifactRecord, error)
	GetSignatureArtifact(ctx context.Context, scope Scope, id string) (SignatureArtifactRecord, error)
}

SignatureArtifactStore defines persistence for signer signature artifacts.

type SignerProfileRecord added in v0.26.0

type SignerProfileRecord struct {
	ID                    string
	TenantID              string
	OrgID                 string
	Subject               string
	Key                   string
	FullName              string
	Initials              string
	TypedSignature        string
	DrawnSignatureDataURL string
	DrawnInitialsDataURL  string
	Remember              bool
	CreatedAt             time.Time
	UpdatedAt             time.Time
	ExpiresAt             time.Time
}

SignerProfileRecord stores signer profile fields for cross-agreement reuse.

type SignerProfileStore added in v0.26.0

type SignerProfileStore interface {
	UpsertSignerProfile(ctx context.Context, scope Scope, record SignerProfileRecord) (SignerProfileRecord, error)
	GetSignerProfile(ctx context.Context, scope Scope, subject, key string, now time.Time) (SignerProfileRecord, error)
	DeleteSignerProfile(ctx context.Context, scope Scope, subject, key string) error
}

SignerProfileStore defines persistence for signer profile preference snapshots.

type SigningStore

type SigningStore interface {
	UpsertFieldValue(ctx context.Context, scope Scope, value FieldValueRecord, expectedVersion int64) (FieldValueRecord, error)
	ListFieldValuesByRecipient(ctx context.Context, scope Scope, agreementID, recipientID string) ([]FieldValueRecord, error)
}

SigningStore defines field value persistence with scope and optimistic lock requirements.

type SigningTokenRecord

type SigningTokenRecord struct {
	ID          string
	TenantID    string
	OrgID       string
	AgreementID string
	RecipientID string
	TokenHash   string
	Status      string
	ExpiresAt   time.Time
	RevokedAt   *time.Time
	CreatedAt   time.Time
}

SigningTokenRecord stores only hashed signer tokens.

type SigningTokenStore

type SigningTokenStore interface {
	CreateSigningToken(ctx context.Context, scope Scope, record SigningTokenRecord) (SigningTokenRecord, error)
	GetSigningTokenByHash(ctx context.Context, scope Scope, tokenHash string) (SigningTokenRecord, error)
	RevokeActiveSigningTokens(ctx context.Context, scope Scope, agreementID, recipientID string, revokedAt time.Time) (int, error)
}

SigningTokenStore defines persistence for hashed signer tokens.

type Store

type Store interface {
	TxStore
	TransactionManager
}

Store is the root persistence contract used by e-sign services.

type TokenService

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

TokenService issues and validates signer tokens with hash-only persistence.

func NewTokenService

func NewTokenService(store SigningTokenStore, opts ...TokenServiceOption) TokenService

func (TokenService) ForTx

func (s TokenService) ForTx(tx TxStore) TokenService

ForTx returns a copy of the token service bound to the provided tx store. The returned service does not open nested transactions.

func (TokenService) Issue

func (s TokenService) Issue(ctx context.Context, scope Scope, agreementID, recipientID string) (IssuedSigningToken, error)

func (TokenService) Revoke

func (s TokenService) Revoke(ctx context.Context, scope Scope, agreementID, recipientID string) error

func (TokenService) Rotate

func (s TokenService) Rotate(ctx context.Context, scope Scope, agreementID, recipientID string) (IssuedSigningToken, error)

func (TokenService) Validate

func (s TokenService) Validate(ctx context.Context, scope Scope, rawToken string) (SigningTokenRecord, error)

type TokenServiceOption

type TokenServiceOption func(*TokenService)

TokenServiceOption customizes token service behavior.

func WithTokenClock

func WithTokenClock(now func() time.Time) TokenServiceOption

func WithTokenEntropySource

func WithTokenEntropySource(source io.Reader) TokenServiceOption

func WithTokenPepper

func WithTokenPepper(pepper string) TokenServiceOption

func WithTokenTTL

func WithTokenTTL(ttl time.Duration) TokenServiceOption

type TransactionManager

type TransactionManager interface {
	WithTx(ctx context.Context, fn func(tx TxStore) error) error
}

TransactionManager defines transaction lifecycle coordination. Backend semantics (rollback/isolation guarantees) are implementation specific.

type TxHooks

type TxHooks = txoutbox.Hooks

TxHooks tracks post-commit hooks collected during a transaction callback.

Jump to

Keyboard shortcuts

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