entityops

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: Apache-2.0 Imports: 74 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InputKeyActionPlanExternalContents = "external_contents"
	InputKeyActionPlanExternalFileID   = "external_file_id"
	InputKeyActionPlanManagementMode   = "management_mode"
	InputKeyActionPlanName             = "name"
)

Integration mapping input keys for ActionPlan

View Source
const (
	InputKeyAssetAccessModelID               = "access_model_id"
	InputKeyAssetAccessModelName             = "access_model_name"
	InputKeyAssetAssetDataClassificationID   = "asset_data_classification_id"
	InputKeyAssetAssetDataClassificationName = "asset_data_classification_name"
	InputKeyAssetAssetSubtypeID              = "asset_subtype_id"
	InputKeyAssetAssetSubtypeName            = "asset_subtype_name"
	InputKeyAssetAssetType                   = "asset_type"
	InputKeyAssetCategories                  = "categories"
	InputKeyAssetContainsPii                 = "contains_pii"
	InputKeyAssetCostCenter                  = "cost_center"
	InputKeyAssetCriticalityID               = "criticality_id"
	InputKeyAssetCriticalityName             = "criticality_name"
	InputKeyAssetDescription                 = "description"
	InputKeyAssetDisplayName                 = "display_name"
	InputKeyAssetEncryptionStatusID          = "encryption_status_id"
	InputKeyAssetEncryptionStatusName        = "encryption_status_name"
	InputKeyAssetEnvironmentID               = "environment_id"
	InputKeyAssetEnvironmentName             = "environment_name"
	InputKeyAssetEstimatedMonthlyCost        = "estimated_monthly_cost"
	InputKeyAssetIdentifier                  = "identifier"
	InputKeyAssetIntegrationID               = "integration_id"
	InputKeyAssetInternalNotes               = "internal_notes"
	InputKeyAssetInternalOwner               = "internal_owner"
	InputKeyAssetInternalOwnerGroupID        = "internal_owner_group_id"
	InputKeyAssetInternalOwnerUserID         = "internal_owner_user_id"
	InputKeyAssetName                        = "name"
	InputKeyAssetObservedAt                  = "observed_at"
	InputKeyAssetOwnerID                     = "owner_id"
	InputKeyAssetPhysicalLocation            = "physical_location"
	InputKeyAssetPurchaseDate                = "purchase_date"
	InputKeyAssetRegion                      = "region"
	InputKeyAssetScopeID                     = "scope_id"
	InputKeyAssetScopeName                   = "scope_name"
	InputKeyAssetSecurityTierID              = "security_tier_id"
	InputKeyAssetSecurityTierName            = "security_tier_name"
	InputKeyAssetSourceIdentifier            = "source_identifier"
	InputKeyAssetSourceType                  = "source_type"
	InputKeyAssetSystemInternalID            = "system_internal_id"
	InputKeyAssetTags                        = "tags"
	InputKeyAssetWebsite                     = "website"
)

Integration mapping input keys for Asset

View Source
const (
	InputKeyCheckResultDetails          = "details"
	InputKeyCheckResultExternalURI      = "external_uri"
	InputKeyCheckResultIntegrationID    = "integration_id"
	InputKeyCheckResultLastObservedAt   = "last_observed_at"
	InputKeyCheckResultParentExternalID = "parent_external_id"
	InputKeyCheckResultSource           = "source"
	InputKeyCheckResultStatus           = "status"
	InputKeyCheckResultTags             = "tags"
)

Integration mapping input keys for CheckResult

View Source
const (
	InputKeyContactAddress       = "address"
	InputKeyContactCompany       = "company"
	InputKeyContactEmail         = "email"
	InputKeyContactExternalID    = "external_id"
	InputKeyContactFullName      = "full_name"
	InputKeyContactIntegrationID = "integration_id"
	InputKeyContactObservedAt    = "observed_at"
	InputKeyContactPhoneNumber   = "phone_number"
	InputKeyContactStatus        = "status"
	InputKeyContactTags          = "tags"
	InputKeyContactTitle         = "title"
)

Integration mapping input keys for Contact

View Source
const (
	InputKeyDirectoryAccountAccountType         = "account_type"
	InputKeyDirectoryAccountAddedAt             = "added_at"
	InputKeyDirectoryAccountAvatarRemoteURL     = "avatar_remote_url"
	InputKeyDirectoryAccountAvatarUpdatedAt     = "avatar_updated_at"
	InputKeyDirectoryAccountCanonicalEmail      = "canonical_email"
	InputKeyDirectoryAccountDepartment          = "department"
	InputKeyDirectoryAccountDirectoryInstanceID = "directory_instance_id"
	InputKeyDirectoryAccountDirectoryName       = "directory_name"
	InputKeyDirectoryAccountDirectorySyncRunID  = "directory_sync_run_id"
	InputKeyDirectoryAccountDisplayName         = "display_name"
	InputKeyDirectoryAccountEmailAliases        = "email_aliases"
	InputKeyDirectoryAccountEnvironmentID       = "environment_id"
	InputKeyDirectoryAccountEnvironmentName     = "environment_name"
	InputKeyDirectoryAccountExternalID          = "external_id"
	InputKeyDirectoryAccountFamilyName          = "family_name"
	InputKeyDirectoryAccountFirstSeenAt         = "first_seen_at"
	InputKeyDirectoryAccountGivenName           = "given_name"
	InputKeyDirectoryAccountIdentityHolderID    = "identity_holder_id"
	InputKeyDirectoryAccountIntegrationID       = "integration_id"
	InputKeyDirectoryAccountJobTitle            = "job_title"
	InputKeyDirectoryAccountLastLoginAt         = "last_login_at"
	InputKeyDirectoryAccountLastSeenAt          = "last_seen_at"
	InputKeyDirectoryAccountLastSeenIP          = "last_seen_ip"
	InputKeyDirectoryAccountMetadata            = "metadata"
	InputKeyDirectoryAccountMfaState            = "mfa_state"
	InputKeyDirectoryAccountObservedAt          = "observed_at"
	InputKeyDirectoryAccountOrganizationUnit    = "organization_unit"
	InputKeyDirectoryAccountOwnerID             = "owner_id"
	InputKeyDirectoryAccountPhoneNumber         = "phone_number"
	InputKeyDirectoryAccountPlatformID          = "platform_id"
	InputKeyDirectoryAccountPrimarySource       = "primary_source"
	InputKeyDirectoryAccountProfile             = "profile"
	InputKeyDirectoryAccountProfileHash         = "profile_hash"
	InputKeyDirectoryAccountRemovedAt           = "removed_at"
	InputKeyDirectoryAccountScopeID             = "scope_id"
	InputKeyDirectoryAccountScopeName           = "scope_name"
	InputKeyDirectoryAccountSecondaryKey        = "secondary_key"
	InputKeyDirectoryAccountSourceVersion       = "source_version"
	InputKeyDirectoryAccountStatus              = "status"
	InputKeyDirectoryAccountTags                = "tags"
)

Integration mapping input keys for DirectoryAccount

View Source
const (
	InputKeyDirectoryGroupAddedAt                = "added_at"
	InputKeyDirectoryGroupClassification         = "classification"
	InputKeyDirectoryGroupDirectoryInstanceID    = "directory_instance_id"
	InputKeyDirectoryGroupDirectoryName          = "directory_name"
	InputKeyDirectoryGroupDirectorySyncRunID     = "directory_sync_run_id"
	InputKeyDirectoryGroupDisplayName            = "display_name"
	InputKeyDirectoryGroupEmail                  = "email"
	InputKeyDirectoryGroupEnvironmentID          = "environment_id"
	InputKeyDirectoryGroupEnvironmentName        = "environment_name"
	InputKeyDirectoryGroupExternalID             = "external_id"
	InputKeyDirectoryGroupExternalSharingAllowed = "external_sharing_allowed"
	InputKeyDirectoryGroupFirstSeenAt            = "first_seen_at"
	InputKeyDirectoryGroupIntegrationID          = "integration_id"
	InputKeyDirectoryGroupLastSeenAt             = "last_seen_at"
	InputKeyDirectoryGroupMemberCount            = "member_count"
	InputKeyDirectoryGroupMetadata               = "metadata"
	InputKeyDirectoryGroupObservedAt             = "observed_at"
	InputKeyDirectoryGroupPlatformID             = "platform_id"
	InputKeyDirectoryGroupProfile                = "profile"
	InputKeyDirectoryGroupProfileHash            = "profile_hash"
	InputKeyDirectoryGroupRemovedAt              = "removed_at"
	InputKeyDirectoryGroupScopeID                = "scope_id"
	InputKeyDirectoryGroupScopeName              = "scope_name"
	InputKeyDirectoryGroupSourceVersion          = "source_version"
	InputKeyDirectoryGroupStatus                 = "status"
	InputKeyDirectoryGroupTags                   = "tags"
)

Integration mapping input keys for DirectoryGroup

View Source
const (
	InputKeyDirectoryMembershipAddedAt             = "added_at"
	InputKeyDirectoryMembershipDirectoryAccountID  = "directory_account_id"
	InputKeyDirectoryMembershipDirectoryGroupID    = "directory_group_id"
	InputKeyDirectoryMembershipDirectoryInstanceID = "directory_instance_id"
	InputKeyDirectoryMembershipDirectoryName       = "directory_name"
	InputKeyDirectoryMembershipDirectorySyncRunID  = "directory_sync_run_id"
	InputKeyDirectoryMembershipEnvironmentID       = "environment_id"
	InputKeyDirectoryMembershipEnvironmentName     = "environment_name"
	InputKeyDirectoryMembershipFirstSeenAt         = "first_seen_at"
	InputKeyDirectoryMembershipIntegrationID       = "integration_id"
	InputKeyDirectoryMembershipLastConfirmedRunID  = "last_confirmed_run_id"
	InputKeyDirectoryMembershipLastSeenAt          = "last_seen_at"
	InputKeyDirectoryMembershipMetadata            = "metadata"
	InputKeyDirectoryMembershipObservedAt          = "observed_at"
	InputKeyDirectoryMembershipPlatformID          = "platform_id"
	InputKeyDirectoryMembershipRemovedAt           = "removed_at"
	InputKeyDirectoryMembershipRole                = "role"
	InputKeyDirectoryMembershipScopeID             = "scope_id"
	InputKeyDirectoryMembershipScopeName           = "scope_name"
	InputKeyDirectoryMembershipSource              = "source"
)

Integration mapping input keys for DirectoryMembership

View Source
const (
	InputKeyEntityAliases                               = "aliases"
	InputKeyEntityAnnualSpend                           = "annual_spend"
	InputKeyEntityApprovedForUse                        = "approved_for_use"
	InputKeyEntityAutoRenews                            = "auto_renews"
	InputKeyEntityBillingModel                          = "billing_model"
	InputKeyEntityContractEndDate                       = "contract_end_date"
	InputKeyEntityContractRenewalAt                     = "contract_renewal_at"
	InputKeyEntityContractStartDate                     = "contract_start_date"
	InputKeyEntityDescription                           = "description"
	InputKeyEntityDisplayName                           = "display_name"
	InputKeyEntityDomains                               = "domains"
	InputKeyEntityEntityRelationshipStateID             = "entity_relationship_state_id"
	InputKeyEntityEntityRelationshipStateName           = "entity_relationship_state_name"
	InputKeyEntityEntitySecurityQuestionnaireStatusID   = "entity_security_questionnaire_status_id"
	InputKeyEntityEntitySecurityQuestionnaireStatusName = "entity_security_questionnaire_status_name"
	InputKeyEntityEntitySourceTypeID                    = "entity_source_type_id"
	InputKeyEntityEntitySourceTypeName                  = "entity_source_type_name"
	InputKeyEntityEnvironmentID                         = "environment_id"
	InputKeyEntityEnvironmentName                       = "environment_name"
	InputKeyEntityExternalID                            = "external_id"
	InputKeyEntityHasSoc2                               = "has_soc2"
	InputKeyEntityInternalNotes                         = "internal_notes"
	InputKeyEntityInternalOwner                         = "internal_owner"
	InputKeyEntityInternalOwnerGroupID                  = "internal_owner_group_id"
	InputKeyEntityInternalOwnerUserID                   = "internal_owner_user_id"
	InputKeyEntityLastReviewedAt                        = "last_reviewed_at"
	InputKeyEntityLinks                                 = "links"
	InputKeyEntityLogoRemoteURL                         = "logo_remote_url"
	InputKeyEntityMfaEnforced                           = "mfa_enforced"
	InputKeyEntityMfaSupported                          = "mfa_supported"
	InputKeyEntityName                                  = "name"
	InputKeyEntityNextReviewAt                          = "next_review_at"
	InputKeyEntityObservedAt                            = "observed_at"
	InputKeyEntityOwnerID                               = "owner_id"
	InputKeyEntityProvidedServices                      = "provided_services"
	InputKeyEntityRenewalRisk                           = "renewal_risk"
	InputKeyEntityReviewFrequency                       = "review_frequency"
	InputKeyEntityReviewedBy                            = "reviewed_by"
	InputKeyEntityReviewedByGroupID                     = "reviewed_by_group_id"
	InputKeyEntityReviewedByUserID                      = "reviewed_by_user_id"
	InputKeyEntityRiskRating                            = "risk_rating"
	InputKeyEntityRiskScore                             = "risk_score"
	InputKeyEntityScopeID                               = "scope_id"
	InputKeyEntityScopeName                             = "scope_name"
	InputKeyEntitySoc2PeriodEnd                         = "soc2_period_end"
	InputKeyEntitySpendCurrency                         = "spend_currency"
	InputKeyEntitySsoEnforced                           = "sso_enforced"
	InputKeyEntityStatus                                = "status"
	InputKeyEntityStatusPageURL                         = "status_page_url"
	InputKeyEntitySystemInternalID                      = "system_internal_id"
	InputKeyEntityTags                                  = "tags"
	InputKeyEntityTerminationNoticeDays                 = "termination_notice_days"
	InputKeyEntityTier                                  = "tier"
	InputKeyEntityVendorMetadata                        = "vendor_metadata"
)

Integration mapping input keys for Entity

View Source
const (
	InputKeyFindingAssessmentID       = "assessment_id"
	InputKeyFindingAssignedTo         = "assigned_to"
	InputKeyFindingAssignedToGroupID  = "assigned_to_group_id"
	InputKeyFindingAssignedToUserID   = "assigned_to_user_id"
	InputKeyFindingBlocksProduction   = "blocks_production"
	InputKeyFindingCategories         = "categories"
	InputKeyFindingCategory           = "category"
	InputKeyFindingDescription        = "description"
	InputKeyFindingDisplayName        = "display_name"
	InputKeyFindingEnvironmentID      = "environment_id"
	InputKeyFindingEnvironmentName    = "environment_name"
	InputKeyFindingEventTime          = "event_time"
	InputKeyFindingExploitability     = "exploitability"
	InputKeyFindingExternalID         = "external_id"
	InputKeyFindingExternalOwnerID    = "external_owner_id"
	InputKeyFindingExternalURI        = "external_uri"
	InputKeyFindingFindingClass       = "finding_class"
	InputKeyFindingFindingStatusID    = "finding_status_id"
	InputKeyFindingFindingStatusName  = "finding_status_name"
	InputKeyFindingImpact             = "impact"
	InputKeyFindingInternalNotes      = "internal_notes"
	InputKeyFindingMetadata           = "metadata"
	InputKeyFindingNumericSeverity    = "numeric_severity"
	InputKeyFindingOpen               = "open"
	InputKeyFindingOwnerID            = "owner_id"
	InputKeyFindingPriority           = "priority"
	InputKeyFindingProduction         = "production"
	InputKeyFindingPublic             = "public"
	InputKeyFindingRawPayload         = "raw_payload"
	InputKeyFindingRecommendation     = "recommendation"
	InputKeyFindingRecommendedActions = "recommended_actions"
	InputKeyFindingReferences         = "references"
	InputKeyFindingRemediationSLA     = "remediation_sla"
	InputKeyFindingReportedAt         = "reported_at"
	InputKeyFindingResourceName       = "resource_name"
	InputKeyFindingReviewedBy         = "reviewed_by"
	InputKeyFindingReviewedByGroupID  = "reviewed_by_group_id"
	InputKeyFindingReviewedByUserID   = "reviewed_by_user_id"
	InputKeyFindingScopeID            = "scope_id"
	InputKeyFindingScopeName          = "scope_name"
	InputKeyFindingScore              = "score"
	InputKeyFindingSeverity           = "severity"
	InputKeyFindingSource             = "source"
	InputKeyFindingSourceUpdatedAt    = "source_updated_at"
	InputKeyFindingState              = "state"
	InputKeyFindingStepsToReproduce   = "steps_to_reproduce"
	InputKeyFindingSystemInternalID   = "system_internal_id"
	InputKeyFindingTags               = "tags"
	InputKeyFindingTargetDetails      = "target_details"
	InputKeyFindingTargets            = "targets"
	InputKeyFindingValidated          = "validated"
	InputKeyFindingVector             = "vector"
)

Integration mapping input keys for Finding

View Source
const (
	InputKeyInternalPolicyApprovalRequired                = "approval_required"
	InputKeyInternalPolicyApproverID                      = "approver_id"
	InputKeyInternalPolicyControlSuggestions              = "control_suggestions"
	InputKeyInternalPolicyDelegateID                      = "delegate_id"
	InputKeyInternalPolicyDetails                         = "details"
	InputKeyInternalPolicyDetailsJSON                     = "details_json"
	InputKeyInternalPolicyDismissedControlSuggestions     = "dismissed_control_suggestions"
	InputKeyInternalPolicyDismissedImprovementSuggestions = "dismissed_improvement_suggestions"
	InputKeyInternalPolicyDismissedTagSuggestions         = "dismissed_tag_suggestions"
	InputKeyInternalPolicyEnvironmentID                   = "environment_id"
	InputKeyInternalPolicyEnvironmentName                 = "environment_name"
	InputKeyInternalPolicyExternalContents                = "external_contents"
	InputKeyInternalPolicyExternalFileID                  = "external_file_id"
	InputKeyInternalPolicyExternalUUID                    = "external_uuid"
	InputKeyInternalPolicyImprovementSuggestions          = "improvement_suggestions"
	InputKeyInternalPolicyInternalNotes                   = "internal_notes"
	InputKeyInternalPolicyInternalPolicyKindID            = "internal_policy_kind_id"
	InputKeyInternalPolicyInternalPolicyKindName          = "internal_policy_kind_name"
	InputKeyInternalPolicyManagementMode                  = "management_mode"
	InputKeyInternalPolicyName                            = "name"
	InputKeyInternalPolicyReviewDue                       = "review_due"
	InputKeyInternalPolicyReviewFrequency                 = "review_frequency"
	InputKeyInternalPolicyRevision                        = "revision"
	InputKeyInternalPolicyScopeID                         = "scope_id"
	InputKeyInternalPolicyScopeName                       = "scope_name"
	InputKeyInternalPolicyStatus                          = "status"
	InputKeyInternalPolicySystemInternalID                = "system_internal_id"
	InputKeyInternalPolicyTagSuggestions                  = "tag_suggestions"
	InputKeyInternalPolicyTags                            = "tags"
	InputKeyInternalPolicyURL                             = "url"
)

Integration mapping input keys for InternalPolicy

View Source
const (
	InputKeyProcedureExternalContents = "external_contents"
	InputKeyProcedureExternalFileID   = "external_file_id"
	InputKeyProcedureManagementMode   = "management_mode"
	InputKeyProcedureName             = "name"
)

Integration mapping input keys for Procedure

View Source
const (
	InputKeyRiskBusinessCosts     = "business_costs"
	InputKeyRiskBusinessCostsJSON = "business_costs_json"
	InputKeyRiskDetails           = "details"
	InputKeyRiskDetailsJSON       = "details_json"
	InputKeyRiskDueDate           = "due_date"
	InputKeyRiskEnvironmentID     = "environment_id"
	InputKeyRiskEnvironmentName   = "environment_name"
	InputKeyRiskExternalID        = "external_id"
	InputKeyRiskExternalUUID      = "external_uuid"
	InputKeyRiskImpact            = "impact"
	InputKeyRiskIntegrationID     = "integration_id"
	InputKeyRiskLastReviewedAt    = "last_reviewed_at"
	InputKeyRiskLikelihood        = "likelihood"
	InputKeyRiskMitigatedAt       = "mitigated_at"
	InputKeyRiskMitigation        = "mitigation"
	InputKeyRiskMitigationJSON    = "mitigation_json"
	InputKeyRiskName              = "name"
	InputKeyRiskNextReviewDueAt   = "next_review_due_at"
	InputKeyRiskObservedAt        = "observed_at"
	InputKeyRiskOwnerID           = "owner_id"
	InputKeyRiskResidualScore     = "residual_score"
	InputKeyRiskReviewFrequency   = "review_frequency"
	InputKeyRiskReviewRequired    = "review_required"
	InputKeyRiskRiskCategoryID    = "risk_category_id"
	InputKeyRiskRiskCategoryName  = "risk_category_name"
	InputKeyRiskRiskDecision      = "risk_decision"
	InputKeyRiskRiskKindID        = "risk_kind_id"
	InputKeyRiskRiskKindName      = "risk_kind_name"
	InputKeyRiskScopeID           = "scope_id"
	InputKeyRiskScopeName         = "scope_name"
	InputKeyRiskScore             = "score"
	InputKeyRiskStatus            = "status"
	InputKeyRiskTags              = "tags"
)

Integration mapping input keys for Risk

View Source
const (
	InputKeyVulnerabilityAssignedTo              = "assigned_to"
	InputKeyVulnerabilityAssignedToGroupID       = "assigned_to_group_id"
	InputKeyVulnerabilityAssignedToUserID        = "assigned_to_user_id"
	InputKeyVulnerabilityAutoDismissedAt         = "auto_dismissed_at"
	InputKeyVulnerabilityBlocking                = "blocking"
	InputKeyVulnerabilityCategory                = "category"
	InputKeyVulnerabilityCveID                   = "cve_id"
	InputKeyVulnerabilityCweIds                  = "cwe_ids"
	InputKeyVulnerabilityDependencyScope         = "dependency_scope"
	InputKeyVulnerabilityDescription             = "description"
	InputKeyVulnerabilityDiscoveredAt            = "discovered_at"
	InputKeyVulnerabilityDismissedAt             = "dismissed_at"
	InputKeyVulnerabilityDismissedComment        = "dismissed_comment"
	InputKeyVulnerabilityDismissedReason         = "dismissed_reason"
	InputKeyVulnerabilityDisplayName             = "display_name"
	InputKeyVulnerabilityEnvironmentID           = "environment_id"
	InputKeyVulnerabilityEnvironmentName         = "environment_name"
	InputKeyVulnerabilityExploitability          = "exploitability"
	InputKeyVulnerabilityExternalID              = "external_id"
	InputKeyVulnerabilityExternalOwnerID         = "external_owner_id"
	InputKeyVulnerabilityExternalURI             = "external_uri"
	InputKeyVulnerabilityFirstPatchedVersion     = "first_patched_version"
	InputKeyVulnerabilityFixAvailable            = "fix_available"
	InputKeyVulnerabilityFixedAt                 = "fixed_at"
	InputKeyVulnerabilityImpact                  = "impact"
	InputKeyVulnerabilityImpacts                 = "impacts"
	InputKeyVulnerabilityInternalNotes           = "internal_notes"
	InputKeyVulnerabilityManifestPath            = "manifest_path"
	InputKeyVulnerabilityMetadata                = "metadata"
	InputKeyVulnerabilityOpen                    = "open"
	InputKeyVulnerabilityOwnerID                 = "owner_id"
	InputKeyVulnerabilityPackageEcosystem        = "package_ecosystem"
	InputKeyVulnerabilityPackageName             = "package_name"
	InputKeyVulnerabilityPriority                = "priority"
	InputKeyVulnerabilityProduction              = "production"
	InputKeyVulnerabilityPublic                  = "public"
	InputKeyVulnerabilityPublishedAt             = "published_at"
	InputKeyVulnerabilityRawPayload              = "raw_payload"
	InputKeyVulnerabilityReferences              = "references"
	InputKeyVulnerabilityRemediationSLA          = "remediation_sla"
	InputKeyVulnerabilityReviewedBy              = "reviewed_by"
	InputKeyVulnerabilityReviewedByGroupID       = "reviewed_by_group_id"
	InputKeyVulnerabilityReviewedByUserID        = "reviewed_by_user_id"
	InputKeyVulnerabilityScopeID                 = "scope_id"
	InputKeyVulnerabilityScopeName               = "scope_name"
	InputKeyVulnerabilityScore                   = "score"
	InputKeyVulnerabilitySeverity                = "severity"
	InputKeyVulnerabilitySource                  = "source"
	InputKeyVulnerabilitySourceUpdatedAt         = "source_updated_at"
	InputKeyVulnerabilitySummary                 = "summary"
	InputKeyVulnerabilitySystemInternalID        = "system_internal_id"
	InputKeyVulnerabilityTags                    = "tags"
	InputKeyVulnerabilityValidated               = "validated"
	InputKeyVulnerabilityVector                  = "vector"
	InputKeyVulnerabilityVulnerabilityStatusID   = "vulnerability_status_id"
	InputKeyVulnerabilityVulnerabilityStatusName = "vulnerability_status_name"
	InputKeyVulnerabilityVulnerableVersionRange  = "vulnerable_version_range"
)

Integration mapping input keys for Vulnerability

View Source
const (
	// MutationPropertyEntityID is the standard mutation metadata key used for entity identifiers
	MutationPropertyEntityID = "ID"
	// MutationPropertyOperation is the mutation metadata key used for the operation type
	MutationPropertyOperation = "operation"
	// MutationPropertyMutationType is the mutation metadata key used for the ent schema type
	MutationPropertyMutationType = "mutation_type"
)
View Source
const (
	// FieldSchema is the log field key for the schema name
	FieldSchema = "schema"
)
View Source
const OpSoftDelete = "OpSoftDelete"

OpSoftDelete is the soft-delete operation, classified at emit when the entx soft-delete mixin rewrites a delete into an update

Variables

View Source
var (
	// ErrSchemaNotFound indicates the schema name could not be resolved
	ErrSchemaNotFound = errors.New("entityops: schema not found")
	// ErrCreateFailed indicates an entity creation failed
	ErrCreateFailed = errors.New("entityops: create failed")
	// ErrUpdateFailed indicates an entity update failed
	ErrUpdateFailed = errors.New("entityops: update failed")
	// ErrQueryFailed indicates an entity query failed
	ErrQueryFailed = errors.New("entityops: query failed")
	// ErrLoadFailed indicates an entity load failed
	ErrLoadFailed = errors.New("entityops: load failed")
	// ErrLinkFailed indicates an edge link operation failed
	ErrLinkFailed = errors.New("entityops: link failed")
	// ErrEdgeNotFound indicates the named edge does not exist or is not linkable on the source schema
	ErrEdgeNotFound = errors.New("entityops: edge not found")
	// ErrDecodeFailed indicates input JSON decoding failed
	ErrDecodeFailed = errors.New("entityops: decode failed")
	// ErrMarshalFailed indicates entity JSON marshaling failed
	ErrMarshalFailed = errors.New("entityops: marshal failed")
	// ErrEmitFailed indicates a gala event emission failed
	ErrEmitFailed = errors.New("entityops: emit failed")
	// ErrPersistFailed indicates a generic persistence failure
	ErrPersistFailed = errors.New("entityops: persist failed")
	// ErrValidationFailed indicates the input did not satisfy schema constraints
	ErrValidationFailed = errors.New("entityops: validation failed")
	// ErrUpsertConflict indicates an upsert matched more than one existing record
	ErrUpsertConflict = errors.New("entityops: upsert conflict")
	// ErrUpsertKeyMissing indicates the payload omitted the schema's lookup key value
	ErrUpsertKeyMissing = errors.New("entityops: upsert key missing")
	// ErrUpsertUnsupported indicates the schema does not support catalog-driven upserts
	ErrUpsertUnsupported = errors.New("entityops: upsert unsupported")
	// ErrFieldNotFound indicates a field name could not be resolved on the schema
	ErrFieldNotFound = errors.New("entityops: field not found")
	// ErrValueCoercion indicates a raw value could not be coerced to the field's type
	ErrValueCoercion = errors.New("entityops: value coercion failed")
	// ErrListenerRegistrationFailed indicates a gala listener could not be registered
	ErrListenerRegistrationFailed = errors.New("entityops: listener registration failed")
	// ErrMutationListenerInvalid indicates a listener is missing its schema or handler
	ErrMutationListenerInvalid = errors.New("entityops: invalid mutation listener")
	// ErrNotifySpecInvalid indicates a notify spec is missing recipients or content
	ErrNotifySpecInvalid = errors.New("entityops: notify spec requires recipients, type, topic, and title and body templates")
	// ErrMutationSchemaMismatch indicates a payload was delivered to a listener for another schema
	ErrMutationSchemaMismatch = errors.New("entityops: mutation schema mismatch")
	// ErrClientResolveFailed indicates the ent client could not be resolved from the injector
	ErrClientResolveFailed = errors.New("entityops: client resolve failed")
	// ErrQueryUnsupported indicates the schema does not support org-scoped queries
	ErrQueryUnsupported = errors.New("entityops: query unsupported")
	// ErrEvaluationFailed indicates a CEL expression evaluation failed
	ErrEvaluationFailed = errors.New("entityops: evaluation failed")
	// ErrKeyMatchUnsupported indicates the schema does not support key-based target queries
	ErrKeyMatchUnsupported = errors.New("entityops: key match unsupported")
	// ErrInvalidKeyField indicates a key match referenced a field that is not an indexable key on the schema
	ErrInvalidKeyField = errors.New("entityops: invalid key field")
	// ErrEvaluatorBuildFailed indicates the typed CEL evaluator for a schema projection could not be built
	ErrEvaluatorBuildFailed = errors.New("entityops: evaluator build failed")
	// ErrIngestUnsupported indicates the schema has no generated ingest capability
	ErrIngestUnsupported = errors.New("entityops: ingest unsupported")
	// ErrIngestMisconfigured indicates a schema ingest capability was wired incorrectly at startup:
	// bound without persistence, bound twice, or registered without its resolver or binding
	ErrIngestMisconfigured = errors.New("entityops: ingest misconfigured")
	// ErrIngestIntegrationResolveFailed indicates the durable command's integration could not be resolved
	ErrIngestIntegrationResolveFailed = errors.New("entityops: ingest integration resolve failed")
)
View Source
var (
	// OpCreate is the create mutation operation
	OpCreate = ent.OpCreate.String()
	// OpUpdate is the bulk update mutation operation
	OpUpdate = ent.OpUpdate.String()
	// OpUpdateOne is the single-row update mutation operation
	OpUpdateOne = ent.OpUpdateOne.String()
	// OpDelete is the bulk hard-delete mutation operation
	OpDelete = ent.OpDelete.String()
	// OpDeleteOne is the single-row hard-delete mutation operation
	OpDeleteOne = ent.OpDeleteOne.String()
)

mutation operation vocabulary for listener registration and payload matching

View Source
var (
	SchemaAPIToken = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "APIToken",
			Snake: "api_token",
			Lower: "apitoken",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "api_token", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.APIToken.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaActionPlan = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "ActionPlan",
			Snake:            "action_plan",
			Lower:            "actionplan",
			WorkflowEligible: true,
		},
		ProjectionType: reflect.TypeFor[ActionPlanProjection](),
		MentionSpec:    &MentionSpec{Schema: "ActionPlan", NameField: "name", DetailsField: "details", DetailsJSONField: "details_json", OwnerField: "owner_id"},
		ApprovalSpec:   &ApprovalSpec{Schema: "ActionPlan", StatusField: "status", ApproverField: "approver_id"},
		Create: func(ctx context.Context, client *generated.Client, input json.RawMessage) (string, error) {
			ref := SchemaRef{Schema: "action_plan", Operation: refOpCreate}

			decoded, err := jsonx.Decode[generated.CreateActionPlanInput](input)
			if err != nil {
				return "", logError(ctx, ref, ErrDecodeFailed, err)
			}

			entity, err := client.ActionPlan.Create().SetInput(decoded).Save(ctx)
			if err != nil {
				return "", logPersistError(ctx, ref, ErrCreateFailed, err)
			}

			return entity.ID, nil
		},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "action_plan", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateActionPlanInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			if err := client.ActionPlan.UpdateOneID(entityID).SetInput(decoded).Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "action_plan", Operation: refOpQuery}

			entities, err := client.ActionPlan.Query().
				Where(actionplan.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "action_plan", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.ActionPlan.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.ActionPlan.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "action_plan", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
		Ingest: &IngestCapability{
			Topic: gala.NamespacedTopic[IngestRequest](IngestTopics, "action_plan.ingest.requested"),
			prepare: func(ctx context.Context, _ *generated.Integration, payload json.RawMessage) (json.RawMessage, error) {
				ref := SchemaRef{Schema: "action_plan", Operation: refOpCreate}

				input, err := jsonx.Decode[generated.CreateActionPlanInput](payload)
				if err != nil {
					return nil, logError(ctx, ref, ErrDecodeFailed, err)
				}

				prepared, err := json.Marshal(input)
				if err != nil {
					return nil, logError(ctx, ref, ErrMarshalFailed, err)
				}

				return prepared, nil
			},
		},
	}
	SchemaAssessment = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "Assessment",
			Snake:            "assessment",
			Lower:            "assessment",
			WorkflowEligible: true,
		},
		ProjectionType: reflect.TypeFor[AssessmentProjection](),
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "assessment", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateAssessmentInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			if err := client.Assessment.UpdateOneID(entityID).SetInput(decoded).Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "assessment", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Assessment.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.Assessment.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "assessment", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
	}
	SchemaAssessmentResponse = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "AssessmentResponse",
			Snake:            "assessment_response",
			Lower:            "assessmentresponse",
			WorkflowEligible: true,
		},
		ProjectionType: reflect.TypeFor[AssessmentResponseProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "assessment_response", Operation: refOpQuery}

			entities, err := client.AssessmentResponse.Query().
				Where(assessmentresponse.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "assessment_response", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.AssessmentResponse.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.AssessmentResponse.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "assessment_response", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
	}
	SchemaAsset = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Asset",
			Snake: "asset",
			Lower: "asset",
		},
		ProjectionType: reflect.TypeFor[AssetProjection](),
		Create: func(ctx context.Context, client *generated.Client, input json.RawMessage) (string, error) {
			ref := SchemaRef{Schema: "asset", Operation: refOpCreate}

			decoded, err := jsonx.Decode[generated.CreateAssetInput](input)
			if err != nil {
				return "", logError(ctx, ref, ErrDecodeFailed, err)
			}

			entity, err := client.Asset.Create().SetInput(decoded).Save(ctx)
			if err != nil {
				return "", logPersistError(ctx, ref, ErrCreateFailed, err)
			}

			return entity.ID, nil
		},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "asset", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateAssetInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			if err := client.Asset.UpdateOneID(entityID).SetInput(decoded).Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "asset", Operation: refOpQuery}

			entities, err := client.Asset.Query().
				Where(asset.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "asset", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Asset.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		Ingest: &IngestCapability{
			Topic: gala.NamespacedTopic[IngestRequest](IngestTopics, "asset.ingest.requested"),
			prepare: func(ctx context.Context, integration *generated.Integration, payload json.RawMessage) (json.RawMessage, error) {
				ref := SchemaRef{Schema: "asset", Operation: refOpCreate}

				input, err := jsonx.Decode[generated.CreateAssetInput](payload)
				if err != nil {
					return nil, logError(ctx, ref, ErrDecodeFailed, err)
				}

				if integration != nil {
					if input.OwnerID == nil && integration.OwnerID != "" {
						input.OwnerID = &integration.OwnerID
					}
					if input.IntegrationID == nil && integration.ID != "" {
						input.IntegrationID = &integration.ID
					}
				}

				prepared, err := json.Marshal(input)
				if err != nil {
					return nil, logError(ctx, ref, ErrMarshalFailed, err)
				}

				return prepared, nil
			},
		},
	}
	SchemaCampaign = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "Campaign",
			Snake:            "campaign",
			Lower:            "campaign",
			WorkflowEligible: true,
		},
		ProjectionType: reflect.TypeFor[CampaignProjection](),
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "campaign", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateCampaignInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			if err := client.Campaign.UpdateOneID(entityID).SetInput(decoded).Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "campaign", Operation: refOpQuery}

			entities, err := client.Campaign.Query().
				Where(campaign.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "campaign", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Campaign.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.Campaign.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "campaign", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
	}
	SchemaCampaignTarget = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "CampaignTarget",
			Snake:            "campaign_target",
			Lower:            "campaigntarget",
			WorkflowEligible: true,
		},
		ProjectionType: reflect.TypeFor[CampaignTargetProjection](),
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "campaign_target", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateCampaignTargetInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			if err := client.CampaignTarget.UpdateOneID(entityID).SetInput(decoded).Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "campaign_target", Operation: refOpQuery}

			entities, err := client.CampaignTarget.Query().
				Where(campaigntarget.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "campaign_target", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.CampaignTarget.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.CampaignTarget.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "campaign_target", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
	}
	SchemaCheckResult = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "CheckResult",
			Snake: "check_result",
			Lower: "checkresult",
		},
		ProjectionType: reflect.TypeFor[CheckResultProjection](),
		Create: func(ctx context.Context, client *generated.Client, input json.RawMessage) (string, error) {
			ref := SchemaRef{Schema: "check_result", Operation: refOpCreate}

			decoded, err := jsonx.Decode[generated.CreateCheckResultInput](input)
			if err != nil {
				return "", logError(ctx, ref, ErrDecodeFailed, err)
			}

			entity, err := client.CheckResult.Create().SetInput(decoded).Save(ctx)
			if err != nil {
				return "", logPersistError(ctx, ref, ErrCreateFailed, err)
			}

			return entity.ID, nil
		},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "check_result", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateCheckResultInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			if err := client.CheckResult.UpdateOneID(entityID).SetInput(decoded).Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "check_result", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.CheckResult.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		Ingest: &IngestCapability{
			Topic: gala.NamespacedTopic[IngestRequest](IngestTopics, "check_result.ingest.requested"),
			prepare: func(ctx context.Context, integration *generated.Integration, payload json.RawMessage) (json.RawMessage, error) {
				ref := SchemaRef{Schema: "check_result", Operation: refOpCreate}

				input, err := jsonx.Decode[generated.CreateCheckResultInput](payload)
				if err != nil {
					return nil, logError(ctx, ref, ErrDecodeFailed, err)
				}

				if integration != nil {
					if input.IntegrationID == nil && integration.ID != "" {
						input.IntegrationID = &integration.ID
					}
				}

				prepared, err := json.Marshal(input)
				if err != nil {
					return nil, logError(ctx, ref, ErrMarshalFailed, err)
				}

				return prepared, nil
			},
		},
	}
	SchemaContact = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Contact",
			Snake: "contact",
			Lower: "contact",
		},
		ProjectionType: reflect.TypeFor[ContactProjection](),
		Create: func(ctx context.Context, client *generated.Client, input json.RawMessage) (string, error) {
			ref := SchemaRef{Schema: "contact", Operation: refOpCreate}

			decoded, err := jsonx.Decode[generated.CreateContactInput](input)
			if err != nil {
				return "", logError(ctx, ref, ErrDecodeFailed, err)
			}

			entity, err := client.Contact.Create().SetInput(decoded).Save(ctx)
			if err != nil {
				return "", logPersistError(ctx, ref, ErrCreateFailed, err)
			}

			return entity.ID, nil
		},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "contact", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateContactInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			if err := client.Contact.UpdateOneID(entityID).SetInput(decoded).Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "contact", Operation: refOpQuery}

			entities, err := client.Contact.Query().
				Where(contact.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "contact", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Contact.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		Ingest: &IngestCapability{
			Topic: gala.NamespacedTopic[IngestRequest](IngestTopics, "contact.ingest.requested"),
			prepare: func(ctx context.Context, integration *generated.Integration, payload json.RawMessage) (json.RawMessage, error) {
				ref := SchemaRef{Schema: "contact", Operation: refOpCreate}

				input, err := jsonx.Decode[generated.CreateContactInput](payload)
				if err != nil {
					return nil, logError(ctx, ref, ErrDecodeFailed, err)
				}

				if integration != nil {
					if input.IntegrationID == nil && integration.ID != "" {
						input.IntegrationID = &integration.ID
					}
					if input.OwnerID == nil && integration.OwnerID != "" {
						input.OwnerID = &integration.OwnerID
					}
				}

				prepared, err := json.Marshal(input)
				if err != nil {
					return nil, logError(ctx, ref, ErrMarshalFailed, err)
				}

				return prepared, nil
			},
		},
	}
	SchemaControl = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "Control",
			Snake:            "control",
			Lower:            "control",
			WorkflowEligible: true,
		},
		ProjectionType: reflect.TypeFor[ControlProjection](),
		ConsoleRoute:   &ConsoleRoute{Base: "controls"},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "control", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateControlInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			if err := client.Control.UpdateOneID(entityID).SetInput(decoded).Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "control", Operation: refOpQuery}

			entities, err := client.Control.Query().
				Where(control.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "control", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Control.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.Control.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "control", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
	}
	SchemaControlImplementation = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "ControlImplementation",
			Snake: "control_implementation",
			Lower: "controlimplementation",
		},
		ProjectionType: reflect.TypeFor[ControlImplementationProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "control_implementation", Operation: refOpQuery}

			entities, err := client.ControlImplementation.Query().
				Where(controlimplementation.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "control_implementation", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.ControlImplementation.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaControlObjective = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "ControlObjective",
			Snake: "control_objective",
			Lower: "controlobjective",
		},
		ProjectionType: reflect.TypeFor[ControlObjectiveProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "control_objective", Operation: refOpQuery}

			entities, err := client.ControlObjective.Query().
				Where(controlobjective.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "control_objective", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.ControlObjective.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaCustomDomain = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "CustomDomain",
			Snake: "custom_domain",
			Lower: "customdomain",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "custom_domain", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.CustomDomain.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaCustomTypeEnum = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "CustomTypeEnum",
			Snake: "custom_type_enum",
			Lower: "customtypeenum",
		},
		ProjectionType: reflect.TypeFor[CustomTypeEnumProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "custom_type_enum", Operation: refOpQuery}

			entities, err := client.CustomTypeEnum.Query().
				Where(customtypeenum.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "custom_type_enum", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.CustomTypeEnum.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaDNSVerification = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "DNSVerification",
			Snake: "dns_verification",
			Lower: "dnsverification",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "dns_verification", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.DNSVerification.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaDirectoryAccount = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "DirectoryAccount",
			Snake: "directory_account",
			Lower: "directoryaccount",
		},
		ProjectionType: reflect.TypeFor[DirectoryAccountProjection](),
		Create: func(ctx context.Context, client *generated.Client, input json.RawMessage) (string, error) {
			ref := SchemaRef{Schema: "directory_account", Operation: refOpCreate}

			decoded, err := jsonx.Decode[generated.CreateDirectoryAccountInput](input)
			if err != nil {
				return "", logError(ctx, ref, ErrDecodeFailed, err)
			}

			entity, err := client.DirectoryAccount.Create().SetInput(decoded).Save(ctx)
			if err != nil {
				return "", logPersistError(ctx, ref, ErrCreateFailed, err)
			}

			return entity.ID, nil
		},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "directory_account", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateDirectoryAccountInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			if err := client.DirectoryAccount.UpdateOneID(entityID).SetInput(decoded).Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "directory_account", Operation: refOpQuery}

			entities, err := client.DirectoryAccount.Query().
				Where(directoryaccount.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "directory_account", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.DirectoryAccount.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		Ingest: &IngestCapability{
			Topic: gala.NamespacedTopic[IngestRequest](IngestTopics, "directory_account.ingest.requested"),
			prepare: func(ctx context.Context, integration *generated.Integration, payload json.RawMessage) (json.RawMessage, error) {
				ref := SchemaRef{Schema: "directory_account", Operation: refOpCreate}

				input, err := jsonx.Decode[generated.CreateDirectoryAccountInput](payload)
				if err != nil {
					return nil, logError(ctx, ref, ErrDecodeFailed, err)
				}

				if integration != nil {
					if input.OwnerID == nil && integration.OwnerID != "" {
						input.OwnerID = &integration.OwnerID
					}
					if input.IntegrationID == nil && integration.ID != "" {
						input.IntegrationID = &integration.ID
					}
					if input.PlatformID == nil && integration.PlatformID != "" {
						input.PlatformID = &integration.PlatformID
					}
				}

				prepared, err := json.Marshal(input)
				if err != nil {
					return nil, logError(ctx, ref, ErrMarshalFailed, err)
				}

				return prepared, nil
			},
		},
	}
	SchemaDirectoryGroup = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "DirectoryGroup",
			Snake: "directory_group",
			Lower: "directorygroup",
		},
		ProjectionType: reflect.TypeFor[DirectoryGroupProjection](),
		Create: func(ctx context.Context, client *generated.Client, input json.RawMessage) (string, error) {
			ref := SchemaRef{Schema: "directory_group", Operation: refOpCreate}

			decoded, err := jsonx.Decode[generated.CreateDirectoryGroupInput](input)
			if err != nil {
				return "", logError(ctx, ref, ErrDecodeFailed, err)
			}

			entity, err := client.DirectoryGroup.Create().SetInput(decoded).Save(ctx)
			if err != nil {
				return "", logPersistError(ctx, ref, ErrCreateFailed, err)
			}

			return entity.ID, nil
		},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "directory_group", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateDirectoryGroupInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			if err := client.DirectoryGroup.UpdateOneID(entityID).SetInput(decoded).Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "directory_group", Operation: refOpQuery}

			entities, err := client.DirectoryGroup.Query().
				Where(directorygroup.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "directory_group", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.DirectoryGroup.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		Ingest: &IngestCapability{
			Topic: gala.NamespacedTopic[IngestRequest](IngestTopics, "directory_group.ingest.requested"),
			prepare: func(ctx context.Context, integration *generated.Integration, payload json.RawMessage) (json.RawMessage, error) {
				ref := SchemaRef{Schema: "directory_group", Operation: refOpCreate}

				input, err := jsonx.Decode[generated.CreateDirectoryGroupInput](payload)
				if err != nil {
					return nil, logError(ctx, ref, ErrDecodeFailed, err)
				}

				if integration != nil {
					if input.IntegrationID == "" {
						input.IntegrationID = integration.ID
					}
					if input.PlatformID == nil && integration.PlatformID != "" {
						input.PlatformID = &integration.PlatformID
					}
					if input.OwnerID == nil && integration.OwnerID != "" {
						input.OwnerID = &integration.OwnerID
					}
				}

				prepared, err := json.Marshal(input)
				if err != nil {
					return nil, logError(ctx, ref, ErrMarshalFailed, err)
				}

				return prepared, nil
			},
		},
	}
	SchemaDirectoryMembership = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "DirectoryMembership",
			Snake: "directory_membership",
			Lower: "directorymembership",
		},
		ProjectionType: reflect.TypeFor[DirectoryMembershipProjection](),
		Create: func(ctx context.Context, client *generated.Client, input json.RawMessage) (string, error) {
			ref := SchemaRef{Schema: "directory_membership", Operation: refOpCreate}

			decoded, err := jsonx.Decode[generated.CreateDirectoryMembershipInput](input)
			if err != nil {
				return "", logError(ctx, ref, ErrDecodeFailed, err)
			}

			entity, err := client.DirectoryMembership.Create().SetInput(decoded).Save(ctx)
			if err != nil {
				return "", logPersistError(ctx, ref, ErrCreateFailed, err)
			}

			return entity.ID, nil
		},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "directory_membership", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateDirectoryMembershipInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			if err := client.DirectoryMembership.UpdateOneID(entityID).SetInput(decoded).Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "directory_membership", Operation: refOpQuery}

			entities, err := client.DirectoryMembership.Query().
				Where(directorymembership.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "directory_membership", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.DirectoryMembership.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		Ingest: &IngestCapability{
			Topic: gala.NamespacedTopic[IngestRequest](IngestTopics, "directory_membership.ingest.requested"),
			prepare: func(ctx context.Context, integration *generated.Integration, payload json.RawMessage) (json.RawMessage, error) {
				ref := SchemaRef{Schema: "directory_membership", Operation: refOpCreate}

				input, err := jsonx.Decode[generated.CreateDirectoryMembershipInput](payload)
				if err != nil {
					return nil, logError(ctx, ref, ErrDecodeFailed, err)
				}

				if integration != nil {
					if input.IntegrationID == "" {
						input.IntegrationID = integration.ID
					}
					if input.OwnerID == nil && integration.OwnerID != "" {
						input.OwnerID = &integration.OwnerID
					}
				}

				prepared, err := json.Marshal(input)
				if err != nil {
					return nil, logError(ctx, ref, ErrMarshalFailed, err)
				}

				return prepared, nil
			},
		},
	}
	SchemaDirectorySyncRun = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "DirectorySyncRun",
			Snake: "directory_sync_run",
			Lower: "directorysyncrun",
		},
		ProjectionType: reflect.TypeFor[DirectorySyncRunProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "directory_sync_run", Operation: refOpQuery}

			entities, err := client.DirectorySyncRun.Query().
				Where(directorysyncrun.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "directory_sync_run", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.DirectorySyncRun.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaDiscussion = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Discussion",
			Snake: "discussion",
			Lower: "discussion",
		},
		ProjectionType: reflect.TypeFor[DiscussionProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "discussion", Operation: refOpQuery}

			entities, err := client.Discussion.Query().
				Where(discussion.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "discussion", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Discussion.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaDocumentData = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "DocumentData",
			Snake: "document_data",
			Lower: "documentdata",
		},
		ProjectionType: reflect.TypeFor[DocumentDataProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "document_data", Operation: refOpQuery}

			entities, err := client.DocumentData.Query().
				Where(documentdata.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "document_data", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.DocumentData.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaEmailTemplate = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "EmailTemplate",
			Snake: "email_template",
			Lower: "emailtemplate",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "email_template", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.EmailTemplate.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaEmailVerificationToken = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "EmailVerificationToken",
			Snake: "email_verification_token",
			Lower: "emailverificationtoken",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "email_verification_token", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.EmailVerificationToken.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaEntity = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Entity",
			Snake: "entity",
			Lower: "entity",
		},
		ProjectionType: reflect.TypeFor[EntityProjection](),
		Create: func(ctx context.Context, client *generated.Client, input json.RawMessage) (string, error) {
			ref := SchemaRef{Schema: "entity", Operation: refOpCreate}

			decoded, err := jsonx.Decode[generated.CreateEntityInput](input)
			if err != nil {
				return "", logError(ctx, ref, ErrDecodeFailed, err)
			}

			entity, err := client.Entity.Create().SetInput(decoded).Save(ctx)
			if err != nil {
				return "", logPersistError(ctx, ref, ErrCreateFailed, err)
			}

			return entity.ID, nil
		},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "entity", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateEntityInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			if err := client.Entity.UpdateOneID(entityID).SetInput(decoded).Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "entity", Operation: refOpQuery}

			entities, err := client.Entity.Query().
				Where(entity.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "entity", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Entity.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		Ingest: &IngestCapability{
			Topic: gala.NamespacedTopic[IngestRequest](IngestTopics, "entity.ingest.requested"),
			prepare: func(ctx context.Context, integration *generated.Integration, payload json.RawMessage) (json.RawMessage, error) {
				ref := SchemaRef{Schema: "entity", Operation: refOpCreate}

				input, err := jsonx.Decode[generated.CreateEntityInput](payload)
				if err != nil {
					return nil, logError(ctx, ref, ErrDecodeFailed, err)
				}

				if integration != nil {
					if input.OwnerID == nil && integration.OwnerID != "" {
						input.OwnerID = &integration.OwnerID
					}
				}

				prepared, err := json.Marshal(input)
				if err != nil {
					return nil, logError(ctx, ref, ErrMarshalFailed, err)
				}

				return prepared, nil
			},
		},
	}
	SchemaEntityType = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "EntityType",
			Snake: "entity_type",
			Lower: "entitytype",
		},
		ProjectionType: reflect.TypeFor[EntityTypeProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "entity_type", Operation: refOpQuery}

			entities, err := client.EntityType.Query().
				Where(entitytype.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "entity_type", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.EntityType.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaEvent = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Event",
			Snake: "event",
			Lower: "event",
		},
		ProjectionType: reflect.TypeFor[EventProjection](),
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "event", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Event.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaEvidence = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "Evidence",
			Snake:            "evidence",
			Lower:            "evidence",
			WorkflowEligible: true,
		},
		ProjectionType: reflect.TypeFor[EvidenceProjection](),
		ConsoleRoute:   &ConsoleRoute{Base: "evidence", IDParam: "id"},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "evidence", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateEvidenceInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			if err := client.Evidence.UpdateOneID(entityID).SetInput(decoded).Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "evidence", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Evidence.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.Evidence.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "evidence", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
	}
	SchemaExport = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Export",
			Snake: "export",
			Lower: "export",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "export", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Export.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaFile = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "File",
			Snake: "file",
			Lower: "file",
		},
		ProjectionType: reflect.TypeFor[FileProjection](),
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "file", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.File.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaFileDownloadToken = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "FileDownloadToken",
			Snake: "file_download_token",
			Lower: "filedownloadtoken",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "file_download_token", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.FileDownloadToken.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaFinding = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "Finding",
			Snake:            "finding",
			Lower:            "finding",
			WorkflowEligible: true,
		},
		ProjectionType: reflect.TypeFor[FindingProjection](),
		Create: func(ctx context.Context, client *generated.Client, input json.RawMessage) (string, error) {
			ref := SchemaRef{Schema: "finding", Operation: refOpCreate}

			decoded, err := jsonx.Decode[generated.CreateFindingInput](input)
			if err != nil {
				return "", logError(ctx, ref, ErrDecodeFailed, err)
			}

			entity, err := client.Finding.Create().SetInput(decoded).Save(ctx)
			if err != nil {
				return "", logPersistError(ctx, ref, ErrCreateFailed, err)
			}

			return entity.ID, nil
		},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "finding", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateFindingInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			if err := client.Finding.UpdateOneID(entityID).SetInput(decoded).Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "finding", Operation: refOpQuery}

			entities, err := client.Finding.Query().
				Where(finding.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "finding", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Finding.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.Finding.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "finding", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
		Ingest: &IngestCapability{
			Topic: gala.NamespacedTopic[IngestRequest](IngestTopics, "finding.ingest.requested"),
			prepare: func(ctx context.Context, integration *generated.Integration, payload json.RawMessage) (json.RawMessage, error) {
				ref := SchemaRef{Schema: "finding", Operation: refOpCreate}

				input, err := jsonx.Decode[generated.CreateFindingInput](payload)
				if err != nil {
					return nil, logError(ctx, ref, ErrDecodeFailed, err)
				}

				if integration != nil {
					if input.OwnerID == nil && integration.OwnerID != "" {
						input.OwnerID = &integration.OwnerID
					}
				}

				prepared, err := json.Marshal(input)
				if err != nil {
					return nil, logError(ctx, ref, ErrMarshalFailed, err)
				}

				return prepared, nil
			},
		},
	}
	SchemaFindingControl = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "FindingControl",
			Snake: "finding_control",
			Lower: "findingcontrol",
		},
		ProjectionType: reflect.TypeFor[FindingControlProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "finding_control", Operation: refOpQuery}

			entities, err := client.FindingControl.Query().
				Where(findingcontrol.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "finding_control", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.FindingControl.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaGroup = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Group",
			Snake: "group",
			Lower: "group",
		},
		ProjectionType: reflect.TypeFor[GroupProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "group", Operation: refOpQuery}

			entities, err := client.Group.Query().
				Where(group.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "group", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Group.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaGroupMembership = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "GroupMembership",
			Snake: "group_membership",
			Lower: "groupmembership",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "group_membership", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.GroupMembership.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaGroupSetting = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "GroupSetting",
			Snake: "group_setting",
			Lower: "groupsetting",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "group_setting", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.GroupSetting.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaHush = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Hush",
			Snake: "hush",
			Lower: "hush",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "hush", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Hush.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaIdentityHolder = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "IdentityHolder",
			Snake:            "identity_holder",
			Lower:            "identityholder",
			WorkflowEligible: true,
		},
		ProjectionType: reflect.TypeFor[IdentityHolderProjection](),
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "identity_holder", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateIdentityHolderInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			if err := client.IdentityHolder.UpdateOneID(entityID).SetInput(decoded).Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "identity_holder", Operation: refOpQuery}

			entities, err := client.IdentityHolder.Query().
				Where(identityholder.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "identity_holder", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.IdentityHolder.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.IdentityHolder.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "identity_holder", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
	}
	SchemaImpersonationEvent = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "ImpersonationEvent",
			Snake: "impersonation_event",
			Lower: "impersonationevent",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "impersonation_event", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.ImpersonationEvent.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaIntegration = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Integration",
			Snake: "integration",
			Lower: "integration",
		},
		ProjectionType: reflect.TypeFor[IntegrationProjection](),
		ConsoleRoute:   &ConsoleRoute{Base: "automation/integrations"},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "integration", Operation: refOpQuery}

			entities, err := client.Integration.Query().
				Where(integration.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "integration", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Integration.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaIntegrationRun = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "IntegrationRun",
			Snake: "integration_run",
			Lower: "integrationrun",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "integration_run", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.IntegrationRun.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaIntegrationWebhook = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "IntegrationWebhook",
			Snake: "integration_webhook",
			Lower: "integrationwebhook",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "integration_webhook", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.IntegrationWebhook.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaInternalPolicy = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "InternalPolicy",
			Snake:            "internal_policy",
			Lower:            "internalpolicy",
			WorkflowEligible: true,
		},
		ProjectionType: reflect.TypeFor[InternalPolicyProjection](),
		ConsoleRoute:   &ConsoleRoute{Base: "policies", Suffix: "view"},
		MentionSpec:    &MentionSpec{Schema: "InternalPolicy", NameField: "name", DetailsField: "details", DetailsJSONField: "details_json", OwnerField: "owner_id"},
		ApprovalSpec:   &ApprovalSpec{Schema: "InternalPolicy", StatusField: "status", ApproverField: "approver_id"},
		Create: func(ctx context.Context, client *generated.Client, input json.RawMessage) (string, error) {
			ref := SchemaRef{Schema: "internal_policy", Operation: refOpCreate}

			decoded, err := jsonx.Decode[generated.CreateInternalPolicyInput](input)
			if err != nil {
				return "", logError(ctx, ref, ErrDecodeFailed, err)
			}

			entity, err := client.InternalPolicy.Create().SetInput(decoded).Save(ctx)
			if err != nil {
				return "", logPersistError(ctx, ref, ErrCreateFailed, err)
			}

			return entity.ID, nil
		},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "internal_policy", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateInternalPolicyInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			if err := client.InternalPolicy.UpdateOneID(entityID).SetInput(decoded).Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "internal_policy", Operation: refOpQuery}

			entities, err := client.InternalPolicy.Query().
				Where(internalpolicy.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "internal_policy", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.InternalPolicy.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.InternalPolicy.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "internal_policy", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
		Ingest: &IngestCapability{
			Topic: gala.NamespacedTopic[IngestRequest](IngestTopics, "internal_policy.ingest.requested"),
			prepare: func(ctx context.Context, integration *generated.Integration, payload json.RawMessage) (json.RawMessage, error) {
				ref := SchemaRef{Schema: "internal_policy", Operation: refOpCreate}

				input, err := jsonx.Decode[generated.CreateInternalPolicyInput](payload)
				if err != nil {
					return nil, logError(ctx, ref, ErrDecodeFailed, err)
				}

				if integration != nil {
					if input.OwnerID == nil && integration.OwnerID != "" {
						input.OwnerID = &integration.OwnerID
					}
				}

				prepared, err := json.Marshal(input)
				if err != nil {
					return nil, logError(ctx, ref, ErrMarshalFailed, err)
				}

				return prepared, nil
			},
		},
	}
	SchemaInvite = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Invite",
			Snake: "invite",
			Lower: "invite",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "invite", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Invite.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaMappableDomain = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "MappableDomain",
			Snake: "mappable_domain",
			Lower: "mappabledomain",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "mappable_domain", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.MappableDomain.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaMappedControl = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "MappedControl",
			Snake: "mapped_control",
			Lower: "mappedcontrol",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "mapped_control", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.MappedControl.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaNarrative = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Narrative",
			Snake: "narrative",
			Lower: "narrative",
		},
		ProjectionType: reflect.TypeFor[NarrativeProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "narrative", Operation: refOpQuery}

			entities, err := client.Narrative.Query().
				Where(narrative.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "narrative", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Narrative.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaNote = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Note",
			Snake: "note",
			Lower: "note",
		},
		ProjectionType: reflect.TypeFor[NoteProjection](),
		MentionSpec:    &MentionSpec{Schema: "Note", NameField: "title", DetailsField: "text", DetailsJSONField: "text_json", OwnerField: "owner_id"},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "note", Operation: refOpQuery}

			entities, err := client.Note.Query().
				Where(note.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "note", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Note.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaNotification = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Notification",
			Snake: "notification",
			Lower: "notification",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "notification", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Notification.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaNotificationPreference = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "NotificationPreference",
			Snake: "notification_preference",
			Lower: "notificationpreference",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "notification_preference", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.NotificationPreference.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaNotificationTemplate = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "NotificationTemplate",
			Snake: "notification_template",
			Lower: "notificationtemplate",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "notification_template", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.NotificationTemplate.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaOnboarding = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Onboarding",
			Snake: "onboarding",
			Lower: "onboarding",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "onboarding", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Onboarding.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaOrgMembership = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "OrgMembership",
			Snake: "org_membership",
			Lower: "orgmembership",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "org_membership", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.OrgMembership.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaOrgModule = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "OrgModule",
			Snake: "org_module",
			Lower: "orgmodule",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "org_module", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.OrgModule.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaOrgPrice = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "OrgPrice",
			Snake: "org_price",
			Lower: "orgprice",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "org_price", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.OrgPrice.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaOrgProduct = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "OrgProduct",
			Snake: "org_product",
			Lower: "orgproduct",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "org_product", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.OrgProduct.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaOrgSubscription = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "OrgSubscription",
			Snake: "org_subscription",
			Lower: "orgsubscription",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "org_subscription", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.OrgSubscription.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaOrganization = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Organization",
			Snake: "organization",
			Lower: "organization",
		},
		ProjectionType: reflect.TypeFor[OrganizationProjection](),
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "organization", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Organization.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaOrganizationSetting = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "OrganizationSetting",
			Snake: "organization_setting",
			Lower: "organizationsetting",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "organization_setting", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.OrganizationSetting.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaPasswordResetToken = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "PasswordResetToken",
			Snake: "password_reset_token",
			Lower: "passwordresettoken",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "password_reset_token", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.PasswordResetToken.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaPersonalAccessToken = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "PersonalAccessToken",
			Snake: "personal_access_token",
			Lower: "personalaccesstoken",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "personal_access_token", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.PersonalAccessToken.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaPlatform = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "Platform",
			Snake:            "platform",
			Lower:            "platform",
			WorkflowEligible: true,
		},
		ProjectionType: reflect.TypeFor[PlatformProjection](),
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "platform", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdatePlatformInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			if err := client.Platform.UpdateOneID(entityID).SetInput(decoded).Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "platform", Operation: refOpQuery}

			entities, err := client.Platform.Query().
				Where(platform.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "platform", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Platform.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.Platform.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "platform", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
	}
	SchemaProcedure = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "Procedure",
			Snake:            "procedure",
			Lower:            "procedure",
			WorkflowEligible: true,
		},
		ProjectionType: reflect.TypeFor[ProcedureProjection](),
		ConsoleRoute:   &ConsoleRoute{Base: "procedures", Suffix: "view"},
		MentionSpec:    &MentionSpec{Schema: "Procedure", NameField: "name", DetailsField: "details", DetailsJSONField: "details_json", OwnerField: "owner_id"},
		ApprovalSpec:   &ApprovalSpec{Schema: "Procedure", StatusField: "status", ApproverField: "approver_id"},
		Create: func(ctx context.Context, client *generated.Client, input json.RawMessage) (string, error) {
			ref := SchemaRef{Schema: "procedure", Operation: refOpCreate}

			decoded, err := jsonx.Decode[generated.CreateProcedureInput](input)
			if err != nil {
				return "", logError(ctx, ref, ErrDecodeFailed, err)
			}

			entity, err := client.Procedure.Create().SetInput(decoded).Save(ctx)
			if err != nil {
				return "", logPersistError(ctx, ref, ErrCreateFailed, err)
			}

			return entity.ID, nil
		},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "procedure", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateProcedureInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			if err := client.Procedure.UpdateOneID(entityID).SetInput(decoded).Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "procedure", Operation: refOpQuery}

			entities, err := client.Procedure.Query().
				Where(procedure.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "procedure", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Procedure.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.Procedure.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "procedure", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
		Ingest: &IngestCapability{
			Topic: gala.NamespacedTopic[IngestRequest](IngestTopics, "procedure.ingest.requested"),
			prepare: func(ctx context.Context, _ *generated.Integration, payload json.RawMessage) (json.RawMessage, error) {
				ref := SchemaRef{Schema: "procedure", Operation: refOpCreate}

				input, err := jsonx.Decode[generated.CreateProcedureInput](payload)
				if err != nil {
					return nil, logError(ctx, ref, ErrDecodeFailed, err)
				}

				prepared, err := json.Marshal(input)
				if err != nil {
					return nil, logError(ctx, ref, ErrMarshalFailed, err)
				}

				return prepared, nil
			},
		},
	}
	SchemaProgram = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Program",
			Snake: "program",
			Lower: "program",
		},
		ProjectionType: reflect.TypeFor[ProgramProjection](),
		ConsoleRoute:   &ConsoleRoute{Base: "programs"},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "program", Operation: refOpQuery}

			entities, err := client.Program.Query().
				Where(program.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "program", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Program.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaProgramMembership = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "ProgramMembership",
			Snake: "program_membership",
			Lower: "programmembership",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "program_membership", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.ProgramMembership.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaRemediation = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "Remediation",
			Snake:            "remediation",
			Lower:            "remediation",
			WorkflowEligible: true,
		},
		ProjectionType: reflect.TypeFor[RemediationProjection](),
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "remediation", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateRemediationInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			if err := client.Remediation.UpdateOneID(entityID).SetInput(decoded).Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "remediation", Operation: refOpQuery}

			entities, err := client.Remediation.Query().
				Where(remediation.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "remediation", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Remediation.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.Remediation.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "remediation", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
	}
	SchemaReview = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Review",
			Snake: "review",
			Lower: "review",
		},
		ProjectionType: reflect.TypeFor[ReviewProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "review", Operation: refOpQuery}

			entities, err := client.Review.Query().
				Where(review.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "review", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Review.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaRisk = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "Risk",
			Snake:            "risk",
			Lower:            "risk",
			WorkflowEligible: true,
		},
		ProjectionType: reflect.TypeFor[RiskProjection](),
		ConsoleRoute:   &ConsoleRoute{Base: "exposure/risks"},
		MentionSpec:    &MentionSpec{Schema: "Risk", NameField: "name", DetailsField: "details", DetailsJSONField: "details_json", OwnerField: "owner_id"},
		Create: func(ctx context.Context, client *generated.Client, input json.RawMessage) (string, error) {
			ref := SchemaRef{Schema: "risk", Operation: refOpCreate}

			decoded, err := jsonx.Decode[generated.CreateRiskInput](input)
			if err != nil {
				return "", logError(ctx, ref, ErrDecodeFailed, err)
			}

			entity, err := client.Risk.Create().SetInput(decoded).Save(ctx)
			if err != nil {
				return "", logPersistError(ctx, ref, ErrCreateFailed, err)
			}

			return entity.ID, nil
		},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "risk", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateRiskInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			if err := client.Risk.UpdateOneID(entityID).SetInput(decoded).Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "risk", Operation: refOpQuery}

			entities, err := client.Risk.Query().
				Where(risk.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "risk", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Risk.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.Risk.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "risk", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
		Ingest: &IngestCapability{
			Topic: gala.NamespacedTopic[IngestRequest](IngestTopics, "risk.ingest.requested"),
			prepare: func(ctx context.Context, integration *generated.Integration, payload json.RawMessage) (json.RawMessage, error) {
				ref := SchemaRef{Schema: "risk", Operation: refOpCreate}

				input, err := jsonx.Decode[generated.CreateRiskInput](payload)
				if err != nil {
					return nil, logError(ctx, ref, ErrDecodeFailed, err)
				}

				if integration != nil {
					if input.OwnerID == nil && integration.OwnerID != "" {
						input.OwnerID = &integration.OwnerID
					}
					if input.IntegrationID == nil && integration.ID != "" {
						input.IntegrationID = &integration.ID
					}
				}

				prepared, err := json.Marshal(input)
				if err != nil {
					return nil, logError(ctx, ref, ErrMarshalFailed, err)
				}

				return prepared, nil
			},
		},
	}
	SchemaSLADefinition = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "SLADefinition",
			Snake: "sla_definition",
			Lower: "sladefinition",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "sla_definition", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.SLADefinition.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaScan = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Scan",
			Snake: "scan",
			Lower: "scan",
		},
		ProjectionType: reflect.TypeFor[ScanProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "scan", Operation: refOpQuery}

			entities, err := client.Scan.Query().
				Where(scan.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "scan", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Scan.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaStandard = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Standard",
			Snake: "standard",
			Lower: "standard",
		},
		ConsoleRoute: &ConsoleRoute{Base: "standards"},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "standard", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Standard.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaSubcontrol = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "Subcontrol",
			Snake:            "subcontrol",
			Lower:            "subcontrol",
			WorkflowEligible: true,
		},
		ProjectionType: reflect.TypeFor[SubcontrolProjection](),
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "subcontrol", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateSubcontrolInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			if err := client.Subcontrol.UpdateOneID(entityID).SetInput(decoded).Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "subcontrol", Operation: refOpQuery}

			entities, err := client.Subcontrol.Query().
				Where(subcontrol.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "subcontrol", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Subcontrol.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.Subcontrol.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "subcontrol", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
	}
	SchemaSubprocessor = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Subprocessor",
			Snake: "subprocessor",
			Lower: "subprocessor",
		},
		ProjectionType: reflect.TypeFor[SubprocessorProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "subprocessor", Operation: refOpQuery}

			entities, err := client.Subprocessor.Query().
				Where(subprocessor.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "subprocessor", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Subprocessor.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaSubscriber = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Subscriber",
			Snake: "subscriber",
			Lower: "subscriber",
		},
		ProjectionType: reflect.TypeFor[SubscriberProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "subscriber", Operation: refOpQuery}

			entities, err := client.Subscriber.Query().
				Where(subscriber.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "subscriber", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Subscriber.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaSystemDetail = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "SystemDetail",
			Snake: "system_detail",
			Lower: "systemdetail",
		},
		ProjectionType: reflect.TypeFor[SystemDetailProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "system_detail", Operation: refOpQuery}

			entities, err := client.SystemDetail.Query().
				Where(systemdetail.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "system_detail", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.SystemDetail.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaTFASetting = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "TFASetting",
			Snake: "tfa_setting",
			Lower: "tfasetting",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "tfa_setting", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.TFASetting.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaTagDefinition = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "TagDefinition",
			Snake: "tag_definition",
			Lower: "tagdefinition",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "tag_definition", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.TagDefinition.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaTask = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "Task",
			Snake:            "task",
			Lower:            "task",
			WorkflowEligible: true,
		},
		ProjectionType: reflect.TypeFor[TaskProjection](),
		ConsoleRoute:   &ConsoleRoute{Base: "automation/tasks", IDParam: "id"},
		MentionSpec:    &MentionSpec{Schema: "Task", NameField: "title", DetailsField: "details", DetailsJSONField: "details_json", OwnerField: "owner_id"},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "task", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateTaskInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			if err := client.Task.UpdateOneID(entityID).SetInput(decoded).Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "task", Operation: refOpQuery}

			entities, err := client.Task.Query().
				Where(task.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "task", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Task.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.Task.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "task", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
	}
	SchemaTemplate = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Template",
			Snake: "template",
			Lower: "template",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "template", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Template.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaTrustCenter = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "TrustCenter",
			Snake: "trust_center",
			Lower: "trustcenter",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "trust_center", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.TrustCenter.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaTrustCenterCompliance = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "TrustCenterCompliance",
			Snake: "trust_center_compliance",
			Lower: "trustcentercompliance",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "trust_center_compliance", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.TrustCenterCompliance.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaTrustCenterDoc = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "TrustCenterDoc",
			Snake: "trust_center_doc",
			Lower: "trustcenterdoc",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "trust_center_doc", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.TrustCenterDoc.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaTrustCenterEntity = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "TrustCenterEntity",
			Snake: "trust_center_entity",
			Lower: "trustcenterentity",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "trust_center_entity", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.TrustCenterEntity.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaTrustCenterFAQ = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "TrustCenterFAQ",
			Snake: "trust_center_faq",
			Lower: "trustcenterfaq",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "trust_center_faq", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.TrustCenterFAQ.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaTrustCenterNDARequest = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "TrustCenterNDARequest",
			Snake: "trust_center_nda_request",
			Lower: "trustcenterndarequest",
		},
		ConsoleRoute: &ConsoleRoute{Base: "trust-center/NDAs"},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "trust_center_nda_request", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.TrustCenterNDARequest.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaTrustCenterSetting = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "TrustCenterSetting",
			Snake: "trust_center_setting",
			Lower: "trustcentersetting",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "trust_center_setting", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.TrustCenterSetting.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaTrustCenterSubprocessor = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "TrustCenterSubprocessor",
			Snake: "trust_center_subprocessor",
			Lower: "trustcentersubprocessor",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "trust_center_subprocessor", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.TrustCenterSubprocessor.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaTrustCenterWatermarkConfig = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "TrustCenterWatermarkConfig",
			Snake: "trust_center_watermark_config",
			Lower: "trustcenterwatermarkconfig",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "trust_center_watermark_config", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.TrustCenterWatermarkConfig.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaUser = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "User",
			Snake: "user",
			Lower: "user",
		},
		ProjectionType: reflect.TypeFor[UserProjection](),
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "user", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.User.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaUserSetting = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "UserSetting",
			Snake: "user_setting",
			Lower: "usersetting",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "user_setting", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.UserSetting.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaVendorRiskScore = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "VendorRiskScore",
			Snake: "vendor_risk_score",
			Lower: "vendorriskscore",
		},
		ProjectionType: reflect.TypeFor[VendorRiskScoreProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "vendor_risk_score", Operation: refOpQuery}

			entities, err := client.VendorRiskScore.Query().
				Where(vendorriskscore.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "vendor_risk_score", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.VendorRiskScore.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaVendorScoringConfig = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "VendorScoringConfig",
			Snake: "vendor_scoring_config",
			Lower: "vendorscoringconfig",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "vendor_scoring_config", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.VendorScoringConfig.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaVulnerability = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "Vulnerability",
			Snake:            "vulnerability",
			Lower:            "vulnerability",
			WorkflowEligible: true,
		},
		ProjectionType: reflect.TypeFor[VulnerabilityProjection](),
		Create: func(ctx context.Context, client *generated.Client, input json.RawMessage) (string, error) {
			ref := SchemaRef{Schema: "vulnerability", Operation: refOpCreate}

			decoded, err := jsonx.Decode[generated.CreateVulnerabilityInput](input)
			if err != nil {
				return "", logError(ctx, ref, ErrDecodeFailed, err)
			}

			entity, err := client.Vulnerability.Create().SetInput(decoded).Save(ctx)
			if err != nil {
				return "", logPersistError(ctx, ref, ErrCreateFailed, err)
			}

			return entity.ID, nil
		},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "vulnerability", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateVulnerabilityInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			if err := client.Vulnerability.UpdateOneID(entityID).SetInput(decoded).Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "vulnerability", Operation: refOpQuery}

			entities, err := client.Vulnerability.Query().
				Where(vulnerability.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "vulnerability", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Vulnerability.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.Vulnerability.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "vulnerability", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
		Ingest: &IngestCapability{
			Topic: gala.NamespacedTopic[IngestRequest](IngestTopics, "vulnerability.ingest.requested"),
			prepare: func(ctx context.Context, integration *generated.Integration, payload json.RawMessage) (json.RawMessage, error) {
				ref := SchemaRef{Schema: "vulnerability", Operation: refOpCreate}

				input, err := jsonx.Decode[generated.CreateVulnerabilityInput](payload)
				if err != nil {
					return nil, logError(ctx, ref, ErrDecodeFailed, err)
				}

				if integration != nil {
					if input.OwnerID == nil && integration.OwnerID != "" {
						input.OwnerID = &integration.OwnerID
					}
				}

				prepared, err := json.Marshal(input)
				if err != nil {
					return nil, logError(ctx, ref, ErrMarshalFailed, err)
				}

				return prepared, nil
			},
		},
	}
	SchemaWebauthn = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Webauthn",
			Snake: "webauthn",
			Lower: "webauthn",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "webauthn", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Webauthn.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaWorkflowAssignment = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "WorkflowAssignment",
			Snake: "workflow_assignment",
			Lower: "workflowassignment",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "workflow_assignment", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.WorkflowAssignment.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaWorkflowAssignmentTarget = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "WorkflowAssignmentTarget",
			Snake: "workflow_assignment_target",
			Lower: "workflowassignmenttarget",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "workflow_assignment_target", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.WorkflowAssignmentTarget.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaWorkflowDefinition = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "WorkflowDefinition",
			Snake: "workflow_definition",
			Lower: "workflowdefinition",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "workflow_definition", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.WorkflowDefinition.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaWorkflowEvent = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "WorkflowEvent",
			Snake: "workflow_event",
			Lower: "workflowevent",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "workflow_event", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.WorkflowEvent.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaWorkflowInstance = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "WorkflowInstance",
			Snake: "workflow_instance",
			Lower: "workflowinstance",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "workflow_instance", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.WorkflowInstance.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaWorkflowObjectRef = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "WorkflowObjectRef",
			Snake: "workflow_object_ref",
			Lower: "workflowobjectref",
		},
		ProjectionType: reflect.TypeFor[WorkflowObjectRefProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "workflow_object_ref", Operation: refOpQuery}

			entities, err := client.WorkflowObjectRef.Query().
				Where(workflowobjectref.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "workflow_object_ref", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.WorkflowObjectRef.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaWorkflowProposal = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "WorkflowProposal",
			Snake: "workflow_proposal",
			Lower: "workflowproposal",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "workflow_proposal", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.WorkflowProposal.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
)

AllMutationOps is every operation including soft deletes

View Source
var IngestTopics = gala.IntegrationIngest.At("entityops")

IngestTopics is the namespace for every generated asynchronous schema-ingest topic.

RegularMutationOps is every operation except soft deletes; empty listener Operations expand to this set so soft deletes stay explicit opt-in

Functions

func ApprovalListeners

func ApprovalListeners(concern MutationConcern, caller func(*auth.Caller, MutationPayload) *auth.Caller, content NotificationContent, statusValues []string, skip ...*Schema) []gala.Registration

ApprovalListeners returns one declarative approval listener per approval-annotated schema, gated on the schema's status field matching any of the trigger values; the caller owns the notification content, trigger vocabulary, and capability hook

func BindIngest

func BindIngest[T any](schema *Schema, persist TypedIngestPersist[T]) error

BindIngest binds typed persistence to a generated schema capability. Topic, registration, emission, preparation, and delivery remain schema-owned.

func ConsoleLanding

func ConsoleLanding(schemaType string) string

ConsoleLanding returns the annotation-declared console landing path for a schema.

func ConsoleObjectPath

func ConsoleObjectPath(schemaType, objectID string) string

ConsoleObjectPath returns the annotation-declared console path for an object.

func CreateNotifications

func CreateNotifications(ctx context.Context, client *generated.Client, recipients []string, input *generated.CreateNotificationInput) error

CreateNotifications creates one notification per recipient from the given input, normalizing the object type; it is the single creation funnel for declarative and bespoke notifications

func EmissionVetoed

func EmissionVetoed(ctx context.Context) bool

EmissionVetoed reports whether mutation event emission is vetoed

func EmitMutation

func EmitMutation(ctx context.Context, runtimes []*gala.Gala, payload MutationPayload)

EmitMutation fans a mutation payload out to every interested concern topic on each runtime, detaching cancellation for best-effort dispatch; per-topic failures are logged and do not abort the fan-out

func FieldValue

func FieldValue(row json.RawMessage, field string) string

FieldValue returns the trimmed string value of one field from a marshaled entity row

func ForSchemas

func ForSchemas(schemas []*Schema, base MutationListener) []gala.Registration

ForSchemas stamps one listener declaration across schemas

func GroupMemberUserIDs

func GroupMemberUserIDs(ctx context.Context, client *generated.Client, groupID string) ([]string, error)

GroupMemberUserIDs returns the user ids of all members of the given group

func InjectCreateLinks(ctx context.Context, client *generated.Client, ownerID string, schema *Schema, payload json.RawMessage, links []LinkSpec) (json.RawMessage, error)

InjectCreateLinks resolves each link's target entities via selectTargets and writes the matched ids into the create-input payload under the edge's create-input key, so the source object is created with its edges already set in the same mutation rather than linked in a post-create step. A unique edge sets the scalar <edge>ID create field; a to-many edge sets the <edge>IDs list. Links resolving to no targets are skipped, leaving the create input unchanged for that edge. The target schema is taken authoritatively from the edge, so callers only supply the edge name and match criteria. Both the integration ingest engine and the workflow CREATE_OBJECT action use this, so a workflow definition can set edges identically to an ingest mapping

func InterestedInMutation

func InterestedInMutation(runtimes []*gala.Gala, schemaType, operation string) bool

InterestedInMutation reports whether any runtime has an interested listener on any of the schema's concern topics

func LegacyTopicRenames

func LegacyTopicRenames() map[gala.TopicName]gala.TopicName

LegacyTopicRenames maps the historical unprefixed direct mutation topic of every schema to its designated topic

func LoadEntity

func LoadEntity[T any](ctx context.Context, entityID string, load func(context.Context, string) (T, error)) (T, bool, error)

LoadEntity loads a listener's target row via the provided getter, treating a missing row as a skipped event: the entity was deleted between mutation and delivery, so there is nothing left to process. Any other load error is returned for the queue to retry

func MentionListeners

func MentionListeners(concern MutationConcern, caller func(*auth.Caller, MutationPayload) *auth.Caller, content NotificationContent, skip ...*Schema) []gala.Registration

MentionListeners returns one declarative mention listener per mention-annotated schema, excluding the skip schemas; the caller owns the notification content and capability hook

func MentionTexts

func MentionTexts(payload MutationPayload, spec MentionSpec) (string, string)

MentionTexts resolves the new and pre-mutation rich text scanned for mentions, preferring each JSON candidate over its plain-text fallback only when it is valid slate text

func MentionedUsers

func MentionedUsers(ctx context.Context, client *generated.Client, oldText, newText, objectType, objectID, objectName string) ([]string, error)

MentionedUsers resolves the user ids newly mentioned between the old and new rich text

func MutationConcernTopics

func MutationConcernTopics(schemaType string) [3]gala.TopicName

MutationConcernTopics returns the concern topic names a schema mutation fans out to

func MutationTopic

func MutationTopic(concern MutationConcern, schemaType string) gala.Topic[MutationPayload]

MutationTopic returns the typed mutation topic for a concern + schema type pair

func MutationTopicName

func MutationTopicName(concern MutationConcern, schemaType string) gala.TopicName

MutationTopicName returns the mutation topic name for a concern + schema type pair

func NormalizeStrings

func NormalizeStrings(values []string) []string

NormalizeStrings trims, deduplicates, and drops empty string values

func ParseEnum

func ParseEnum[T ~string](raw any, parser EnumParser[T], invalid ...T) (T, bool)

ParseEnum parses enum-like values through the provided enum parser. Optional invalid values can be provided to force known sentinel values to be treated as parse failures

func RecipientsFromField

func RecipientsFromField(fieldName string) func(Invocation, MutationPayload, json.RawMessage) ([]string, error)

RecipientsFromField resolves a single recipient from the payload's proposed value for the field, falling back to the loaded row; an empty value skips emission

func RegisterIngestListeners

func RegisterIngestListeners(runtime *gala.Gala, resolveIntegration IngestIntegrationResolver) error

RegisterIngestListeners attaches every generated schema-ingest consumer.

func RequireDep

func RequireDep[D any](handle func(Invocation, MutationPayload, D) error) func(Invocation, MutationPayload) error

RequireDep resolves one listener dependency before invoking handle, gating the event when the dependency is not wired

func ValueAsString

func ValueAsString(raw any) (string, bool)

ValueAsString converts arbitrary values into non-empty strings

func VetoEmission

func VetoEmission(ctx context.Context)

VetoEmission suppresses mutation event emission for the current mutation

func WithEmissionVeto

func WithEmissionVeto(ctx context.Context) context.Context

WithEmissionVeto installs a shared emission veto holder when none is present, so every emission hook on the chain reads the same suppression decision

func WithEmissionVetoed

func WithEmissionVetoed(ctx context.Context) context.Context

WithEmissionVetoed suppresses mutation event emission for every mutation under ctx; the fresh holder shadows any outer one so the veto never leaks to sibling contexts

Types

type ActionPlanProjection

type ActionPlanProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                              string                       `json:"id,omitempty"`
	ActionPlanKindID                string                       `json:"action_plan_kind_id,omitempty"`
	ActionPlanKindName              string                       `json:"action_plan_kind_name,omitempty"`
	ApprovalRequired                bool                         `json:"approval_required,omitempty"`
	ApproverID                      string                       `json:"approver_id,omitempty"`
	Blocked                         bool                         `json:"blocked,omitempty"`
	BlockerReason                   string                       `json:"blocker_reason,omitempty"`
	CompletedAt                     time.Time                    `json:"completed_at,omitempty"`
	ControlSuggestions              []string                     `json:"control_suggestions,omitempty"`
	CreatedAt                       time.Time                    `json:"created_at,omitempty"`
	CreatedBy                       string                       `json:"created_by,omitempty"`
	DelegateID                      string                       `json:"delegate_id,omitempty"`
	Description                     string                       `json:"description,omitempty"`
	Details                         string                       `json:"details,omitempty"`
	DetailsJSON                     []interface{}                `json:"details_json,omitempty"`
	DismissedControlSuggestions     []string                     `json:"dismissed_control_suggestions,omitempty"`
	DismissedImprovementSuggestions []string                     `json:"dismissed_improvement_suggestions,omitempty"`
	DismissedTagSuggestions         []string                     `json:"dismissed_tag_suggestions,omitempty"`
	DueDate                         time.Time                    `json:"due_date,omitempty"`
	ExternalContents                string                       `json:"external_contents,omitempty"`
	ExternalFileID                  string                       `json:"external_file_id,omitempty"`
	FileID                          string                       `json:"file_id,omitempty"`
	ImprovementSuggestions          []string                     `json:"improvement_suggestions,omitempty"`
	InternalNotes                   string                       `json:"internal_notes,omitempty"`
	ManagementMode                  enums.DocumentManagementMode `json:"management_mode,omitempty"`
	Metadata                        map[string]interface{}       `json:"metadata,omitempty"`
	Name                            string                       `json:"name,omitempty"`
	OwnerID                         string                       `json:"owner_id,omitempty"`
	Priority                        enums.Priority               `json:"priority,omitempty"`
	RawPayload                      map[string]interface{}       `json:"raw_payload,omitempty"`
	RequiresApproval                bool                         `json:"requires_approval,omitempty"`
	ReviewDue                       time.Time                    `json:"review_due,omitempty"`
	ReviewFrequency                 enums.Frequency              `json:"review_frequency,omitempty"`
	Revision                        string                       `json:"revision,omitempty"`
	Source                          string                       `json:"source,omitempty"`
	Status                          enums.DocumentStatus         `json:"status,omitempty"`
	Summary                         string                       `json:"summary,omitempty"`
	SystemInternalID                string                       `json:"system_internal_id,omitempty"`
	SystemOwned                     bool                         `json:"system_owned,omitempty"`
	TagSuggestions                  []string                     `json:"tag_suggestions,omitempty"`
	Tags                            []string                     `json:"tags,omitempty"`
	Title                           string                       `json:"title,omitempty"`
	UpdatedAt                       time.Time                    `json:"updated_at,omitempty"`
	UpdatedBy                       string                       `json:"updated_by,omitempty"`
	UpdatedByImpersonator           string                       `json:"updated_by_impersonator,omitempty"`
	URL                             string                       `json:"url,omitempty"`
	WorkflowEligibleMarker          bool                         `json:"workflow_eligible_marker,omitempty"`
}

ActionPlanProjection is the flat, CEL- and jsonschema-facing view of a ActionPlan: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.ActionPlan whose edge graph cannot be reflected

type ApprovalSpec

type ApprovalSpec struct {
	Schema        string `json:"schema"`
	StatusField   string `json:"statusField"`
	ApproverField string `json:"approverField"`
}

ApprovalSpec describes the approval-flow fields on a schema.

func ApprovalSpecFor

func ApprovalSpecFor(schemaType string) (ApprovalSpec, bool)

ApprovalSpecFor returns the annotation-declared approval fields for a schema.

type AssessmentProjection

type AssessmentProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                     string                 `json:"id,omitempty"`
	AssessmentType         enums.AssessmentType   `json:"assessment_type,omitempty"`
	CreatedAt              time.Time              `json:"created_at,omitempty"`
	CreatedBy              string                 `json:"created_by,omitempty"`
	InternalNotes          string                 `json:"internal_notes,omitempty"`
	Jsonconfig             map[string]interface{} `json:"jsonconfig,omitempty"`
	Name                   string                 `json:"name,omitempty"`
	OwnerID                string                 `json:"owner_id,omitempty"`
	ResponseDueDuration    int64                  `json:"response_due_duration,omitempty"`
	SystemInternalID       string                 `json:"system_internal_id,omitempty"`
	SystemOwned            bool                   `json:"system_owned,omitempty"`
	Tags                   []string               `json:"tags,omitempty"`
	TemplateID             string                 `json:"template_id,omitempty"`
	Uischema               map[string]interface{} `json:"uischema,omitempty"`
	UpdatedAt              time.Time              `json:"updated_at,omitempty"`
	UpdatedBy              string                 `json:"updated_by,omitempty"`
	UpdatedByImpersonator  string                 `json:"updated_by_impersonator,omitempty"`
	WorkflowEligibleMarker bool                   `json:"workflow_eligible_marker,omitempty"`
}

AssessmentProjection is the flat, CEL- and jsonschema-facing view of a Assessment: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Assessment whose edge graph cannot be reflected

type AssessmentResponseProjection

type AssessmentResponseProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                     string                         `json:"id,omitempty"`
	AssessmentID           string                         `json:"assessment_id,omitempty"`
	AssignedAt             time.Time                      `json:"assigned_at,omitempty"`
	CampaignID             string                         `json:"campaign_id,omitempty"`
	CompletedAt            time.Time                      `json:"completed_at,omitempty"`
	CreatedAt              time.Time                      `json:"created_at,omitempty"`
	CreatedBy              string                         `json:"created_by,omitempty"`
	DisplayName            string                         `json:"display_name,omitempty"`
	DocumentDataID         string                         `json:"document_data_id,omitempty"`
	DueDate                time.Time                      `json:"due_date,omitempty"`
	Email                  string                         `json:"email,omitempty"`
	EmailClickCount        int                            `json:"email_click_count,omitempty"`
	EmailClickedAt         time.Time                      `json:"email_clicked_at,omitempty"`
	EmailDeliveredAt       time.Time                      `json:"email_delivered_at,omitempty"`
	EmailMetadata          map[string]interface{}         `json:"email_metadata,omitempty"`
	EmailOpenCount         int                            `json:"email_open_count,omitempty"`
	EmailOpenedAt          time.Time                      `json:"email_opened_at,omitempty"`
	EntityID               string                         `json:"entity_id,omitempty"`
	IdentityHolderID       string                         `json:"identity_holder_id,omitempty"`
	IsDraft                bool                           `json:"is_draft,omitempty"`
	IsTest                 bool                           `json:"is_test,omitempty"`
	LastEmailEventAt       time.Time                      `json:"last_email_event_at,omitempty"`
	OwnerID                string                         `json:"owner_id,omitempty"`
	SendAttempts           int                            `json:"send_attempts,omitempty"`
	StartedAt              time.Time                      `json:"started_at,omitempty"`
	Status                 enums.AssessmentResponseStatus `json:"status,omitempty"`
	UpdatedAt              time.Time                      `json:"updated_at,omitempty"`
	UpdatedBy              string                         `json:"updated_by,omitempty"`
	UpdatedByImpersonator  string                         `json:"updated_by_impersonator,omitempty"`
	WorkflowEligibleMarker bool                           `json:"workflow_eligible_marker,omitempty"`
}

AssessmentResponseProjection is the flat, CEL- and jsonschema-facing view of a AssessmentResponse: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.AssessmentResponse whose edge graph cannot be reflected

type AssetProjection

type AssetProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                          string           `json:"id,omitempty"`
	AccessModelID               string           `json:"access_model_id,omitempty"`
	AccessModelName             string           `json:"access_model_name,omitempty"`
	AssetDataClassificationID   string           `json:"asset_data_classification_id,omitempty"`
	AssetDataClassificationName string           `json:"asset_data_classification_name,omitempty"`
	AssetSubtypeID              string           `json:"asset_subtype_id,omitempty"`
	AssetSubtypeName            string           `json:"asset_subtype_name,omitempty"`
	AssetType                   enums.AssetType  `json:"asset_type,omitempty"`
	Categories                  []string         `json:"categories,omitempty"`
	ContainsPii                 bool             `json:"contains_pii,omitempty"`
	CostCenter                  string           `json:"cost_center,omitempty"`
	Cpe                         string           `json:"cpe,omitempty"`
	CreatedAt                   time.Time        `json:"created_at,omitempty"`
	CreatedBy                   string           `json:"created_by,omitempty"`
	CriticalityID               string           `json:"criticality_id,omitempty"`
	CriticalityName             string           `json:"criticality_name,omitempty"`
	Description                 string           `json:"description,omitempty"`
	DisplayName                 string           `json:"display_name,omitempty"`
	EncryptionStatusID          string           `json:"encryption_status_id,omitempty"`
	EncryptionStatusName        string           `json:"encryption_status_name,omitempty"`
	EnvironmentID               string           `json:"environment_id,omitempty"`
	EnvironmentName             string           `json:"environment_name,omitempty"`
	EstimatedMonthlyCost        float64          `json:"estimated_monthly_cost,omitempty"`
	Identifier                  string           `json:"identifier,omitempty"`
	IntegrationID               string           `json:"integration_id,omitempty"`
	InternalNotes               string           `json:"internal_notes,omitempty"`
	InternalOwner               string           `json:"internal_owner,omitempty"`
	InternalOwnerGroupID        string           `json:"internal_owner_group_id,omitempty"`
	InternalOwnerUserID         string           `json:"internal_owner_user_id,omitempty"`
	Name                        string           `json:"name,omitempty"`
	ObservedAt                  models.DateTime  `json:"observed_at,omitempty"`
	OwnerID                     string           `json:"owner_id,omitempty"`
	PhysicalLocation            string           `json:"physical_location,omitempty"`
	PurchaseDate                models.DateTime  `json:"purchase_date,omitempty"`
	Region                      string           `json:"region,omitempty"`
	ScopeID                     string           `json:"scope_id,omitempty"`
	ScopeName                   string           `json:"scope_name,omitempty"`
	SecurityTierID              string           `json:"security_tier_id,omitempty"`
	SecurityTierName            string           `json:"security_tier_name,omitempty"`
	SourceIdentifier            string           `json:"source_identifier,omitempty"`
	SourcePlatformID            string           `json:"source_platform_id,omitempty"`
	SourceType                  enums.SourceType `json:"source_type,omitempty"`
	SystemInternalID            string           `json:"system_internal_id,omitempty"`
	SystemOwned                 bool             `json:"system_owned,omitempty"`
	Tags                        []string         `json:"tags,omitempty"`
	UpdatedAt                   time.Time        `json:"updated_at,omitempty"`
	UpdatedBy                   string           `json:"updated_by,omitempty"`
	UpdatedByImpersonator       string           `json:"updated_by_impersonator,omitempty"`
	Website                     string           `json:"website,omitempty"`
}

AssetProjection is the flat, CEL- and jsonschema-facing view of a Asset: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Asset whose edge graph cannot be reflected

type CampaignProjection

type CampaignProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                     string                 `json:"id,omitempty"`
	AssessmentID           string                 `json:"assessment_id,omitempty"`
	CampaignType           enums.CampaignType     `json:"campaign_type,omitempty"`
	CompletedAt            models.DateTime        `json:"completed_at,omitempty"`
	CreatedAt              time.Time              `json:"created_at,omitempty"`
	CreatedBy              string                 `json:"created_by,omitempty"`
	Description            string                 `json:"description,omitempty"`
	DisplayID              string                 `json:"display_id,omitempty"`
	DueDate                models.DateTime        `json:"due_date,omitempty"`
	EmailBrandingID        string                 `json:"email_branding_id,omitempty"`
	EmailTemplateID        string                 `json:"email_template_id,omitempty"`
	EntityID               string                 `json:"entity_id,omitempty"`
	IntegrationID          string                 `json:"integration_id,omitempty"`
	InternalOwner          string                 `json:"internal_owner,omitempty"`
	InternalOwnerGroupID   string                 `json:"internal_owner_group_id,omitempty"`
	InternalOwnerUserID    string                 `json:"internal_owner_user_id,omitempty"`
	IsActive               bool                   `json:"is_active,omitempty"`
	IsRecurring            bool                   `json:"is_recurring,omitempty"`
	LastResentAt           models.DateTime        `json:"last_resent_at,omitempty"`
	LastRunAt              models.DateTime        `json:"last_run_at,omitempty"`
	LaunchedAt             models.DateTime        `json:"launched_at,omitempty"`
	Metadata               map[string]interface{} `json:"metadata,omitempty"`
	Name                   string                 `json:"name,omitempty"`
	NextRunAt              models.DateTime        `json:"next_run_at,omitempty"`
	OwnerID                string                 `json:"owner_id,omitempty"`
	RecipientCount         int                    `json:"recipient_count,omitempty"`
	RecurrenceCron         models.Cron            `json:"recurrence_cron,omitempty"`
	RecurrenceEndAt        models.DateTime        `json:"recurrence_end_at,omitempty"`
	RecurrenceFrequency    enums.Frequency        `json:"recurrence_frequency,omitempty"`
	RecurrenceInterval     int                    `json:"recurrence_interval,omitempty"`
	RecurrenceTimezone     string                 `json:"recurrence_timezone,omitempty"`
	ResendCount            int                    `json:"resend_count,omitempty"`
	ScheduledAt            models.DateTime        `json:"scheduled_at,omitempty"`
	Status                 enums.CampaignStatus   `json:"status,omitempty"`
	Tags                   []string               `json:"tags,omitempty"`
	TemplateID             string                 `json:"template_id,omitempty"`
	TrustCenterID          string                 `json:"trust_center_id,omitempty"`
	UpdatedAt              time.Time              `json:"updated_at,omitempty"`
	UpdatedBy              string                 `json:"updated_by,omitempty"`
	UpdatedByImpersonator  string                 `json:"updated_by_impersonator,omitempty"`
	WorkflowEligibleMarker bool                   `json:"workflow_eligible_marker,omitempty"`
}

CampaignProjection is the flat, CEL- and jsonschema-facing view of a Campaign: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Campaign whose edge graph cannot be reflected

type CampaignTargetProjection

type CampaignTargetProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                     string                         `json:"id,omitempty"`
	CampaignID             string                         `json:"campaign_id,omitempty"`
	CompletedAt            models.DateTime                `json:"completed_at,omitempty"`
	ContactID              string                         `json:"contact_id,omitempty"`
	CreatedAt              time.Time                      `json:"created_at,omitempty"`
	CreatedBy              string                         `json:"created_by,omitempty"`
	Email                  string                         `json:"email,omitempty"`
	FullName               string                         `json:"full_name,omitempty"`
	GroupID                string                         `json:"group_id,omitempty"`
	Metadata               map[string]interface{}         `json:"metadata,omitempty"`
	OwnerID                string                         `json:"owner_id,omitempty"`
	SentAt                 models.DateTime                `json:"sent_at,omitempty"`
	Status                 enums.AssessmentResponseStatus `json:"status,omitempty"`
	SubscriberID           string                         `json:"subscriber_id,omitempty"`
	UpdatedAt              time.Time                      `json:"updated_at,omitempty"`
	UpdatedBy              string                         `json:"updated_by,omitempty"`
	UpdatedByImpersonator  string                         `json:"updated_by_impersonator,omitempty"`
	UserID                 string                         `json:"user_id,omitempty"`
	WorkflowEligibleMarker bool                           `json:"workflow_eligible_marker,omitempty"`
}

CampaignTargetProjection is the flat, CEL- and jsonschema-facing view of a CampaignTarget: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.CampaignTarget whose edge graph cannot be reflected

type ChangeSet

type ChangeSet struct {
	// ChangedFields captures updated and cleared fields for the mutation
	ChangedFields []string `json:"changed_fields,omitempty"`
	// ClearedFields captures fields explicitly cleared by the mutation
	ClearedFields []string `json:"cleared_fields,omitempty"`
	// ChangedEdges captures changed edge names for catalog-known edges
	ChangedEdges []string `json:"changed_edges,omitempty"`
	// AddedIDs captures edge IDs added by edge name
	AddedIDs map[string][]string `json:"added_ids,omitempty"`
	// RemovedIDs captures edge IDs removed by edge name
	RemovedIDs map[string][]string `json:"removed_ids,omitempty"`
	// ProposedChanges captures field-level proposed values. Its JSON shape is unchanged, while the
	// decoded map avoids repeated full-document decoding by every listener gate and handler.
	ProposedChanges map[string]any `json:"proposed_changes,omitempty"`
	// OldValues captures pre-mutation values for changed fields on single-row updates
	OldValues map[string]any `json:"old_values,omitempty"`
}

ChangeSet is the single mutation-delta contract shared by event payloads, workflow trigger context, and approval routing. Field json tags are durable wire format for queued mutation events and must not change

func ChangeSetFromMutation

func ChangeSetFromMutation(mutation ent.Mutation) ChangeSet

ChangeSetFromMutation builds the mutation's change set: normalized changed and cleared field lists, proposed field values including explicit clears, and the catalog-known edge deltas flattened to name-keyed ID maps. Consumers filter this canonical set rather than rebuilding mutation state independently

func (ChangeSet) Clone

func (set ChangeSet) Clone() ChangeSet

Clone returns a copy of the change set and its map-backed values

func (ChangeSet) FieldChanged

func (set ChangeSet) FieldChanged(field string) bool

FieldChanged reports whether the change set indicates the field changed

func (ChangeSet) Filter

func (set ChangeSet) Filter(keepField, keepEdge func(string) bool) ChangeSet

Filter returns a capability-specific view without changing the durable ChangeSet shape.

func (ChangeSet) OldStringValue

func (set ChangeSet) OldStringValue(field string) (string, bool)

OldStringValue returns the pre-mutation string value for a field on single-row updates

func (ChangeSet) OldValue

func (set ChangeSet) OldValue(field string) (any, bool)

OldValue returns the pre-mutation value for a field on single-row updates

func (ChangeSet) StringSliceValue

func (set ChangeSet) StringSliceValue(field string) []string

StringSliceValue returns a proposed string-slice mutation value for a field

func (ChangeSet) StringValue

func (set ChangeSet) StringValue(field string) (string, bool)

StringValue returns the proposed string mutation value for a field

func (ChangeSet) Value

func (set ChangeSet) Value(field string) (any, bool)

Value returns the proposed mutation value for a field

type CheckResultProjection

type CheckResultProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string            `json:"id,omitempty"`
	CreatedAt             time.Time         `json:"created_at,omitempty"`
	CreatedBy             string            `json:"created_by,omitempty"`
	Details               string            `json:"details,omitempty"`
	ExternalURI           string            `json:"external_uri,omitempty"`
	IntegrationID         string            `json:"integration_id,omitempty"`
	LastObservedAt        models.DateTime   `json:"last_observed_at,omitempty"`
	ParentExternalID      string            `json:"parent_external_id,omitempty"`
	Source                string            `json:"source,omitempty"`
	Status                enums.CheckStatus `json:"status,omitempty"`
	Tags                  []string          `json:"tags,omitempty"`
	UpdatedAt             time.Time         `json:"updated_at,omitempty"`
	UpdatedBy             string            `json:"updated_by,omitempty"`
	UpdatedByImpersonator string            `json:"updated_by_impersonator,omitempty"`
}

CheckResultProjection is the flat, CEL- and jsonschema-facing view of a CheckResult: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.CheckResult whose edge graph cannot be reflected

type ConsoleRoute

type ConsoleRoute struct {
	Base    string `json:"base"`
	IDParam string `json:"idParam,omitempty"`
	Suffix  string `json:"suffix,omitempty"`
}

ConsoleRoute describes how console URLs are built for a schema's objects.

type ContactProjection

type ContactProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string           `json:"id,omitempty"`
	Address               string           `json:"address,omitempty"`
	Company               string           `json:"company,omitempty"`
	CreatedAt             time.Time        `json:"created_at,omitempty"`
	CreatedBy             string           `json:"created_by,omitempty"`
	Email                 string           `json:"email,omitempty"`
	ExternalID            string           `json:"external_id,omitempty"`
	FullName              string           `json:"full_name,omitempty"`
	IntegrationID         string           `json:"integration_id,omitempty"`
	ObservedAt            models.DateTime  `json:"observed_at,omitempty"`
	OwnerID               string           `json:"owner_id,omitempty"`
	PhoneNumber           string           `json:"phone_number,omitempty"`
	Status                enums.UserStatus `json:"status,omitempty"`
	Tags                  []string         `json:"tags,omitempty"`
	Title                 string           `json:"title,omitempty"`
	UpdatedAt             time.Time        `json:"updated_at,omitempty"`
	UpdatedBy             string           `json:"updated_by,omitempty"`
	UpdatedByImpersonator string           `json:"updated_by_impersonator,omitempty"`
}

ContactProjection is the flat, CEL- and jsonschema-facing view of a Contact: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Contact whose edge graph cannot be reflected

type ControlImplementationProjection

type ControlImplementationProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string               `json:"id,omitempty"`
	CreatedAt             time.Time            `json:"created_at,omitempty"`
	CreatedBy             string               `json:"created_by,omitempty"`
	Details               string               `json:"details,omitempty"`
	DetailsJSON           []interface{}        `json:"details_json,omitempty"`
	ImplementationDate    time.Time            `json:"implementation_date,omitempty"`
	InternalNotes         string               `json:"internal_notes,omitempty"`
	OwnerID               string               `json:"owner_id,omitempty"`
	Status                enums.DocumentStatus `json:"status,omitempty"`
	SystemInternalID      string               `json:"system_internal_id,omitempty"`
	SystemOwned           bool                 `json:"system_owned,omitempty"`
	Tags                  []string             `json:"tags,omitempty"`
	UpdatedAt             time.Time            `json:"updated_at,omitempty"`
	UpdatedBy             string               `json:"updated_by,omitempty"`
	UpdatedByImpersonator string               `json:"updated_by_impersonator,omitempty"`
	VerificationDate      time.Time            `json:"verification_date,omitempty"`
	Verified              bool                 `json:"verified,omitempty"`
}

ControlImplementationProjection is the flat, CEL- and jsonschema-facing view of a ControlImplementation: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.ControlImplementation whose edge graph cannot be reflected

type ControlObjectiveProjection

type ControlObjectiveProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string                `json:"id,omitempty"`
	Category              string                `json:"category,omitempty"`
	ControlObjectiveType  string                `json:"control_objective_type,omitempty"`
	CreatedAt             time.Time             `json:"created_at,omitempty"`
	CreatedBy             string                `json:"created_by,omitempty"`
	DesiredOutcome        string                `json:"desired_outcome,omitempty"`
	DesiredOutcomeJSON    []interface{}         `json:"desired_outcome_json,omitempty"`
	DisplayID             string                `json:"display_id,omitempty"`
	InternalNotes         string                `json:"internal_notes,omitempty"`
	Name                  string                `json:"name,omitempty"`
	OwnerID               string                `json:"owner_id,omitempty"`
	Revision              string                `json:"revision,omitempty"`
	Source                enums.ControlSource   `json:"source,omitempty"`
	Status                enums.ObjectiveStatus `json:"status,omitempty"`
	Subcategory           string                `json:"subcategory,omitempty"`
	SystemInternalID      string                `json:"system_internal_id,omitempty"`
	SystemOwned           bool                  `json:"system_owned,omitempty"`
	Tags                  []string              `json:"tags,omitempty"`
	UpdatedAt             time.Time             `json:"updated_at,omitempty"`
	UpdatedBy             string                `json:"updated_by,omitempty"`
	UpdatedByImpersonator string                `json:"updated_by_impersonator,omitempty"`
}

ControlObjectiveProjection is the flat, CEL- and jsonschema-facing view of a ControlObjective: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.ControlObjective whose edge graph cannot be reflected

type ControlProjection

type ControlProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                         string                             `json:"id,omitempty"`
	Aliases                    []string                           `json:"aliases,omitempty"`
	AssessmentMethods          []models.AssessmentMethod          `json:"assessment_methods,omitempty"`
	AssessmentObjectives       []models.AssessmentObjective       `json:"assessment_objectives,omitempty"`
	AuditorReferenceID         string                             `json:"auditor_reference_id,omitempty"`
	Category                   string                             `json:"category,omitempty"`
	CategoryID                 string                             `json:"category_id,omitempty"`
	ControlKindID              string                             `json:"control_kind_id,omitempty"`
	ControlKindName            string                             `json:"control_kind_name,omitempty"`
	ControlOwnerID             string                             `json:"control_owner_id,omitempty"`
	ControlQuestions           []string                           `json:"control_questions,omitempty"`
	CreatedAt                  time.Time                          `json:"created_at,omitempty"`
	CreatedBy                  string                             `json:"created_by,omitempty"`
	DelegateID                 string                             `json:"delegate_id,omitempty"`
	Description                string                             `json:"description,omitempty"`
	DescriptionJSON            []interface{}                      `json:"description_json,omitempty"`
	DisplayID                  string                             `json:"display_id,omitempty"`
	EnvironmentID              string                             `json:"environment_id,omitempty"`
	EnvironmentName            string                             `json:"environment_name,omitempty"`
	EvidenceRequests           []models.EvidenceRequests          `json:"evidence_requests,omitempty"`
	ExampleEvidence            []models.ExampleEvidence           `json:"example_evidence,omitempty"`
	ExternalUUID               string                             `json:"external_uuid,omitempty"`
	ImplementationDescription  string                             `json:"implementation_description,omitempty"`
	ImplementationGuidance     []models.ImplementationGuidance    `json:"implementation_guidance,omitempty"`
	ImplementationStatus       enums.ControlImplementationStatus  `json:"implementation_status,omitempty"`
	InternalNotes              string                             `json:"internal_notes,omitempty"`
	IsTrustCenterControl       bool                               `json:"is_trust_center_control,omitempty"`
	MappedCategories           []string                           `json:"mapped_categories,omitempty"`
	OwnerID                    string                             `json:"owner_id,omitempty"`
	PublicRepresentation       string                             `json:"public_representation,omitempty"`
	RefCode                    string                             `json:"ref_code,omitempty"`
	ReferenceFramework         string                             `json:"reference_framework,omitempty"`
	ReferenceFrameworkRevision string                             `json:"reference_framework_revision,omitempty"`
	ReferenceID                string                             `json:"reference_id,omitempty"`
	References                 []models.Reference                 `json:"references,omitempty"`
	ResponsiblePartyID         string                             `json:"responsible_party_id,omitempty"`
	ScopeID                    string                             `json:"scope_id,omitempty"`
	ScopeName                  string                             `json:"scope_name,omitempty"`
	Source                     enums.ControlSource                `json:"source,omitempty"`
	SourceName                 string                             `json:"source_name,omitempty"`
	StandardID                 string                             `json:"standard_id,omitempty"`
	Status                     enums.ControlStatus                `json:"status,omitempty"`
	Subcategory                string                             `json:"subcategory,omitempty"`
	SystemInternalID           string                             `json:"system_internal_id,omitempty"`
	SystemOwned                bool                               `json:"system_owned,omitempty"`
	Tags                       []string                           `json:"tags,omitempty"`
	TestingProcedures          []models.TestingProcedures         `json:"testing_procedures,omitempty"`
	Title                      string                             `json:"title,omitempty"`
	TrustCenterVisibility      enums.TrustCenterControlVisibility `json:"trust_center_visibility,omitempty"`
	UpdatedAt                  time.Time                          `json:"updated_at,omitempty"`
	UpdatedBy                  string                             `json:"updated_by,omitempty"`
	UpdatedByImpersonator      string                             `json:"updated_by_impersonator,omitempty"`
	WorkflowEligibleMarker     bool                               `json:"workflow_eligible_marker,omitempty"`
}

ControlProjection is the flat, CEL- and jsonschema-facing view of a Control: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Control whose edge graph cannot be reflected

type CustomTypeEnumProjection

type CustomTypeEnumProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string    `json:"id,omitempty"`
	Color                 string    `json:"color,omitempty"`
	CreatedAt             time.Time `json:"created_at,omitempty"`
	CreatedBy             string    `json:"created_by,omitempty"`
	Description           string    `json:"description,omitempty"`
	Field                 string    `json:"field,omitempty"`
	Icon                  string    `json:"icon,omitempty"`
	InternalNotes         string    `json:"internal_notes,omitempty"`
	Name                  string    `json:"name,omitempty"`
	ObjectType            string    `json:"object_type,omitempty"`
	OwnerID               string    `json:"owner_id,omitempty"`
	SystemInternalID      string    `json:"system_internal_id,omitempty"`
	SystemOwned           bool      `json:"system_owned,omitempty"`
	UpdatedAt             time.Time `json:"updated_at,omitempty"`
	UpdatedBy             string    `json:"updated_by,omitempty"`
	UpdatedByImpersonator string    `json:"updated_by_impersonator,omitempty"`
}

CustomTypeEnumProjection is the flat, CEL- and jsonschema-facing view of a CustomTypeEnum: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.CustomTypeEnum whose edge graph cannot be reflected

type DirectoryAccountProjection

type DirectoryAccountProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string                         `json:"id,omitempty"`
	AccountType           enums.DirectoryAccountType     `json:"account_type,omitempty"`
	AddedAt               time.Time                      `json:"added_at,omitempty"`
	AvatarLocalFileID     string                         `json:"avatar_local_file_id,omitempty"`
	AvatarRemoteURL       string                         `json:"avatar_remote_url,omitempty"`
	AvatarUpdatedAt       time.Time                      `json:"avatar_updated_at,omitempty"`
	CanonicalEmail        string                         `json:"canonical_email,omitempty"`
	CreatedAt             time.Time                      `json:"created_at,omitempty"`
	CreatedBy             string                         `json:"created_by,omitempty"`
	Department            string                         `json:"department,omitempty"`
	DirectoryInstanceID   string                         `json:"directory_instance_id,omitempty"`
	DirectoryName         string                         `json:"directory_name,omitempty"`
	DirectorySyncRunID    string                         `json:"directory_sync_run_id,omitempty"`
	DisplayID             string                         `json:"display_id,omitempty"`
	DisplayName           string                         `json:"display_name,omitempty"`
	EmailAliases          []string                       `json:"email_aliases,omitempty"`
	EnvironmentID         string                         `json:"environment_id,omitempty"`
	EnvironmentName       string                         `json:"environment_name,omitempty"`
	ExternalID            string                         `json:"external_id,omitempty"`
	FamilyName            string                         `json:"family_name,omitempty"`
	FirstSeenAt           time.Time                      `json:"first_seen_at,omitempty"`
	GivenName             string                         `json:"given_name,omitempty"`
	IdentityHolderID      string                         `json:"identity_holder_id,omitempty"`
	IntegrationID         string                         `json:"integration_id,omitempty"`
	JobTitle              string                         `json:"job_title,omitempty"`
	LastLoginAt           time.Time                      `json:"last_login_at,omitempty"`
	LastSeenAt            time.Time                      `json:"last_seen_at,omitempty"`
	LastSeenIP            string                         `json:"last_seen_ip,omitempty"`
	Metadata              map[string]interface{}         `json:"metadata,omitempty"`
	MfaState              enums.DirectoryAccountMFAState `json:"mfa_state,omitempty"`
	ObservedAt            time.Time                      `json:"observed_at,omitempty"`
	OrganizationUnit      string                         `json:"organization_unit,omitempty"`
	OwnerID               string                         `json:"owner_id,omitempty"`
	PhoneNumber           string                         `json:"phone_number,omitempty"`
	PlatformID            string                         `json:"platform_id,omitempty"`
	PrimarySource         bool                           `json:"primary_source,omitempty"`
	Profile               map[string]interface{}         `json:"profile,omitempty"`
	ProfileHash           string                         `json:"profile_hash,omitempty"`
	RawProfileFileID      string                         `json:"raw_profile_file_id,omitempty"`
	RemovedAt             time.Time                      `json:"removed_at,omitempty"`
	ScopeID               string                         `json:"scope_id,omitempty"`
	ScopeName             string                         `json:"scope_name,omitempty"`
	SecondaryKey          string                         `json:"secondary_key,omitempty"`
	SourceVersion         string                         `json:"source_version,omitempty"`
	Status                enums.DirectoryAccountStatus   `json:"status,omitempty"`
	Tags                  []string                       `json:"tags,omitempty"`
	UpdatedAt             time.Time                      `json:"updated_at,omitempty"`
	UpdatedBy             string                         `json:"updated_by,omitempty"`
	UpdatedByImpersonator string                         `json:"updated_by_impersonator,omitempty"`
}

DirectoryAccountProjection is the flat, CEL- and jsonschema-facing view of a DirectoryAccount: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.DirectoryAccount whose edge graph cannot be reflected

type DirectoryGroupProjection

type DirectoryGroupProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                     string                             `json:"id,omitempty"`
	AddedAt                time.Time                          `json:"added_at,omitempty"`
	Classification         enums.DirectoryGroupClassification `json:"classification,omitempty"`
	CreatedAt              time.Time                          `json:"created_at,omitempty"`
	CreatedBy              string                             `json:"created_by,omitempty"`
	Description            string                             `json:"description,omitempty"`
	DirectoryInstanceID    string                             `json:"directory_instance_id,omitempty"`
	DirectoryName          string                             `json:"directory_name,omitempty"`
	DirectorySyncRunID     string                             `json:"directory_sync_run_id,omitempty"`
	DisplayID              string                             `json:"display_id,omitempty"`
	DisplayName            string                             `json:"display_name,omitempty"`
	Email                  string                             `json:"email,omitempty"`
	EnvironmentID          string                             `json:"environment_id,omitempty"`
	EnvironmentName        string                             `json:"environment_name,omitempty"`
	ExternalID             string                             `json:"external_id,omitempty"`
	ExternalSharingAllowed bool                               `json:"external_sharing_allowed,omitempty"`
	FirstSeenAt            time.Time                          `json:"first_seen_at,omitempty"`
	IntegrationID          string                             `json:"integration_id,omitempty"`
	LastSeenAt             time.Time                          `json:"last_seen_at,omitempty"`
	MemberCount            int                                `json:"member_count,omitempty"`
	Metadata               map[string]interface{}             `json:"metadata,omitempty"`
	ObservedAt             time.Time                          `json:"observed_at,omitempty"`
	OwnerID                string                             `json:"owner_id,omitempty"`
	PlatformID             string                             `json:"platform_id,omitempty"`
	Profile                map[string]interface{}             `json:"profile,omitempty"`
	ProfileHash            string                             `json:"profile_hash,omitempty"`
	RawProfileFileID       string                             `json:"raw_profile_file_id,omitempty"`
	RemovedAt              time.Time                          `json:"removed_at,omitempty"`
	ScopeID                string                             `json:"scope_id,omitempty"`
	ScopeName              string                             `json:"scope_name,omitempty"`
	SourceVersion          string                             `json:"source_version,omitempty"`
	Status                 enums.DirectoryGroupStatus         `json:"status,omitempty"`
	Tags                   []string                           `json:"tags,omitempty"`
	UpdatedAt              time.Time                          `json:"updated_at,omitempty"`
	UpdatedBy              string                             `json:"updated_by,omitempty"`
	UpdatedByImpersonator  string                             `json:"updated_by_impersonator,omitempty"`
}

DirectoryGroupProjection is the flat, CEL- and jsonschema-facing view of a DirectoryGroup: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.DirectoryGroup whose edge graph cannot be reflected

type DirectoryMembershipProjection

type DirectoryMembershipProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string                        `json:"id,omitempty"`
	AddedAt               time.Time                     `json:"added_at,omitempty"`
	CreatedAt             time.Time                     `json:"created_at,omitempty"`
	CreatedBy             string                        `json:"created_by,omitempty"`
	DirectoryAccountID    string                        `json:"directory_account_id,omitempty"`
	DirectoryGroupID      string                        `json:"directory_group_id,omitempty"`
	DirectoryInstanceID   string                        `json:"directory_instance_id,omitempty"`
	DirectoryName         string                        `json:"directory_name,omitempty"`
	DirectorySyncRunID    string                        `json:"directory_sync_run_id,omitempty"`
	DisplayID             string                        `json:"display_id,omitempty"`
	EnvironmentID         string                        `json:"environment_id,omitempty"`
	EnvironmentName       string                        `json:"environment_name,omitempty"`
	FirstSeenAt           time.Time                     `json:"first_seen_at,omitempty"`
	IntegrationID         string                        `json:"integration_id,omitempty"`
	LastConfirmedRunID    string                        `json:"last_confirmed_run_id,omitempty"`
	LastSeenAt            time.Time                     `json:"last_seen_at,omitempty"`
	Metadata              map[string]interface{}        `json:"metadata,omitempty"`
	ObservedAt            time.Time                     `json:"observed_at,omitempty"`
	OwnerID               string                        `json:"owner_id,omitempty"`
	PlatformID            string                        `json:"platform_id,omitempty"`
	RemovedAt             time.Time                     `json:"removed_at,omitempty"`
	Role                  enums.DirectoryMembershipRole `json:"role,omitempty"`
	ScopeID               string                        `json:"scope_id,omitempty"`
	ScopeName             string                        `json:"scope_name,omitempty"`
	Source                string                        `json:"source,omitempty"`
	UpdatedAt             time.Time                     `json:"updated_at,omitempty"`
	UpdatedBy             string                        `json:"updated_by,omitempty"`
	UpdatedByImpersonator string                        `json:"updated_by_impersonator,omitempty"`
}

DirectoryMembershipProjection is the flat, CEL- and jsonschema-facing view of a DirectoryMembership: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.DirectoryMembership whose edge graph cannot be reflected

type DirectorySyncRunProjection

type DirectorySyncRunProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string                       `json:"id,omitempty"`
	CompletedAt           time.Time                    `json:"completed_at,omitempty"`
	CreatedAt             time.Time                    `json:"created_at,omitempty"`
	CreatedBy             string                       `json:"created_by,omitempty"`
	DeltaCount            int                          `json:"delta_count,omitempty"`
	DirectoryInstanceID   string                       `json:"directory_instance_id,omitempty"`
	DisplayID             string                       `json:"display_id,omitempty"`
	EnvironmentID         string                       `json:"environment_id,omitempty"`
	EnvironmentName       string                       `json:"environment_name,omitempty"`
	Error                 string                       `json:"error,omitempty"`
	FullCount             int                          `json:"full_count,omitempty"`
	IntegrationID         string                       `json:"integration_id,omitempty"`
	OwnerID               string                       `json:"owner_id,omitempty"`
	PlatformID            string                       `json:"platform_id,omitempty"`
	RawManifestFileID     string                       `json:"raw_manifest_file_id,omitempty"`
	ScopeID               string                       `json:"scope_id,omitempty"`
	ScopeName             string                       `json:"scope_name,omitempty"`
	SourceCursor          string                       `json:"source_cursor,omitempty"`
	StartedAt             time.Time                    `json:"started_at,omitempty"`
	Stats                 map[string]interface{}       `json:"stats,omitempty"`
	Status                enums.DirectorySyncRunStatus `json:"status,omitempty"`
	UpdatedAt             time.Time                    `json:"updated_at,omitempty"`
	UpdatedBy             string                       `json:"updated_by,omitempty"`
	UpdatedByImpersonator string                       `json:"updated_by_impersonator,omitempty"`
}

DirectorySyncRunProjection is the flat, CEL- and jsonschema-facing view of a DirectorySyncRun: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.DirectorySyncRun whose edge graph cannot be reflected

type DiscussionProjection

type DiscussionProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string    `json:"id,omitempty"`
	CreatedAt             time.Time `json:"created_at,omitempty"`
	CreatedBy             string    `json:"created_by,omitempty"`
	ExternalID            string    `json:"external_id,omitempty"`
	IsResolved            bool      `json:"is_resolved,omitempty"`
	OwnerID               string    `json:"owner_id,omitempty"`
	UpdatedAt             time.Time `json:"updated_at,omitempty"`
	UpdatedBy             string    `json:"updated_by,omitempty"`
	UpdatedByImpersonator string    `json:"updated_by_impersonator,omitempty"`
}

DiscussionProjection is the flat, CEL- and jsonschema-facing view of a Discussion: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Discussion whose edge graph cannot be reflected

type DocumentDataProjection

type DocumentDataProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string                 `json:"id,omitempty"`
	CreatedAt             time.Time              `json:"created_at,omitempty"`
	CreatedBy             string                 `json:"created_by,omitempty"`
	Data                  map[string]interface{} `json:"data,omitempty"`
	EnvironmentID         string                 `json:"environment_id,omitempty"`
	EnvironmentName       string                 `json:"environment_name,omitempty"`
	OwnerID               string                 `json:"owner_id,omitempty"`
	ScopeID               string                 `json:"scope_id,omitempty"`
	ScopeName             string                 `json:"scope_name,omitempty"`
	Tags                  []string               `json:"tags,omitempty"`
	TemplateID            string                 `json:"template_id,omitempty"`
	UpdatedAt             time.Time              `json:"updated_at,omitempty"`
	UpdatedBy             string                 `json:"updated_by,omitempty"`
	UpdatedByImpersonator string                 `json:"updated_by_impersonator,omitempty"`
}

DocumentDataProjection is the flat, CEL- and jsonschema-facing view of a DocumentData: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.DocumentData whose edge graph cannot be reflected

type EdgeDescriptor

type EdgeDescriptor struct {
	// Name is the edge name (e.g., "controls")
	Name string `json:"name"`
	// Target is the target schema's registry entry
	Target *Schema `json:"-"`
	// TargetType is the PascalCase target schema name, surfaced for the cross-link target dropdown
	TargetType string `json:"target,omitempty"`
	// Label is the human-readable label (PascalCase of the edge name)
	Label string `json:"label,omitempty"`
	// Unique reports whether this side references a single target (sets <edge>ID rather than <edge>IDs)
	Unique bool `json:"unique,omitempty"`
	// Field is the foreign-key storage column on this schema's table for unique owning edges
	// (e.g. "control_id"); empty when the foreign key lives on the target table
	Field string `json:"field,omitempty"`
	// CreateField is the create-input JSON key used to set this edge at create time, matching the
	// input's snake_case json tag (e.g. "control_ids")
	CreateField string `json:"createField,omitempty"`
	// AddField is the update-input key that adds targets to a to-many edge (e.g. "add_control_ids");
	// empty for unique or immutable edges
	AddField string `json:"addField,omitempty"`
	// Through reports whether the edge goes through a join entity (edge schema). Through edges
	// are linked by creating join entity rows — one per target, each with its own generated id —
	// because batch edge adds cannot produce per-row entity ids
	Through bool `json:"through,omitempty"`
	// LinkThrough creates the join entity rows binding the source to each target, skipping pairs
	// that already exist; nil for plain edges
	LinkThrough func(ctx context.Context, client *generated.Client, sourceID string, targetIDs []string) error `json:"-"`
	// WorkflowEligible reports whether the edge may drive workflow conditions and triggers
	WorkflowEligible bool `json:"workflowEligible,omitempty"`
}

EdgeDescriptor describes an edge on a schema. It is the single edge-capability record shared by create-time link injection, the workflow object-ref catalog, and the integration cross-link inventory

type EntityProjection

type EntityProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                                    string                 `json:"id,omitempty"`
	Aliases                               []string               `json:"aliases,omitempty"`
	AnnualSpend                           float64                `json:"annual_spend,omitempty"`
	ApprovedForUse                        bool                   `json:"approved_for_use,omitempty"`
	AutoRenews                            bool                   `json:"auto_renews,omitempty"`
	BillingModel                          string                 `json:"billing_model,omitempty"`
	ContractEndDate                       models.DateTime        `json:"contract_end_date,omitempty"`
	ContractRenewalAt                     models.DateTime        `json:"contract_renewal_at,omitempty"`
	ContractStartDate                     models.DateTime        `json:"contract_start_date,omitempty"`
	CreatedAt                             time.Time              `json:"created_at,omitempty"`
	CreatedBy                             string                 `json:"created_by,omitempty"`
	Description                           string                 `json:"description,omitempty"`
	DisplayName                           string                 `json:"display_name,omitempty"`
	Domains                               []string               `json:"domains,omitempty"`
	EntityRelationshipStateID             string                 `json:"entity_relationship_state_id,omitempty"`
	EntityRelationshipStateName           string                 `json:"entity_relationship_state_name,omitempty"`
	EntitySecurityQuestionnaireStatusID   string                 `json:"entity_security_questionnaire_status_id,omitempty"`
	EntitySecurityQuestionnaireStatusName string                 `json:"entity_security_questionnaire_status_name,omitempty"`
	EntitySourceTypeID                    string                 `json:"entity_source_type_id,omitempty"`
	EntitySourceTypeName                  string                 `json:"entity_source_type_name,omitempty"`
	EntityTypeID                          string                 `json:"entity_type_id,omitempty"`
	EnvironmentID                         string                 `json:"environment_id,omitempty"`
	EnvironmentName                       string                 `json:"environment_name,omitempty"`
	ExternalID                            string                 `json:"external_id,omitempty"`
	HasSoc2                               bool                   `json:"has_soc2,omitempty"`
	InternalNotes                         string                 `json:"internal_notes,omitempty"`
	InternalOwner                         string                 `json:"internal_owner,omitempty"`
	InternalOwnerGroupID                  string                 `json:"internal_owner_group_id,omitempty"`
	InternalOwnerUserID                   string                 `json:"internal_owner_user_id,omitempty"`
	LastReviewedAt                        models.DateTime        `json:"last_reviewed_at,omitempty"`
	LinkedAssetIds                        []string               `json:"linked_asset_ids,omitempty"`
	Links                                 []string               `json:"links,omitempty"`
	LogoFileID                            string                 `json:"logo_file_id,omitempty"`
	LogoRemoteURL                         string                 `json:"logo_remote_url,omitempty"`
	MfaEnforced                           bool                   `json:"mfa_enforced,omitempty"`
	MfaSupported                          bool                   `json:"mfa_supported,omitempty"`
	Name                                  string                 `json:"name,omitempty"`
	NextReviewAt                          models.DateTime        `json:"next_review_at,omitempty"`
	ObservedAt                            models.DateTime        `json:"observed_at,omitempty"`
	OwnerID                               string                 `json:"owner_id,omitempty"`
	ProvidedServices                      []string               `json:"provided_services,omitempty"`
	RenewalRisk                           string                 `json:"renewal_risk,omitempty"`
	ReviewFrequency                       enums.Frequency        `json:"review_frequency,omitempty"`
	ReviewedBy                            string                 `json:"reviewed_by,omitempty"`
	ReviewedByGroupID                     string                 `json:"reviewed_by_group_id,omitempty"`
	ReviewedByUserID                      string                 `json:"reviewed_by_user_id,omitempty"`
	RiskRating                            string                 `json:"risk_rating,omitempty"`
	RiskScore                             int                    `json:"risk_score,omitempty"`
	RiskScoreCoverage                     int                    `json:"risk_score_coverage,omitempty"`
	ScopeID                               string                 `json:"scope_id,omitempty"`
	ScopeName                             string                 `json:"scope_name,omitempty"`
	Soc2PeriodEnd                         models.DateTime        `json:"soc2_period_end,omitempty"`
	SpendCurrency                         string                 `json:"spend_currency,omitempty"`
	SSOEnforced                           bool                   `json:"sso_enforced,omitempty"`
	Status                                enums.EntityStatus     `json:"status,omitempty"`
	StatusPageURL                         string                 `json:"status_page_url,omitempty"`
	SystemInternalID                      string                 `json:"system_internal_id,omitempty"`
	SystemOwned                           bool                   `json:"system_owned,omitempty"`
	Tags                                  []string               `json:"tags,omitempty"`
	TerminationNoticeDays                 int                    `json:"termination_notice_days,omitempty"`
	Tier                                  enums.VendorTier       `json:"tier,omitempty"`
	UpdatedAt                             time.Time              `json:"updated_at,omitempty"`
	UpdatedBy                             string                 `json:"updated_by,omitempty"`
	UpdatedByImpersonator                 string                 `json:"updated_by_impersonator,omitempty"`
	VendorMetadata                        map[string]interface{} `json:"vendor_metadata,omitempty"`
}

EntityProjection is the flat, CEL- and jsonschema-facing view of a Entity: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Entity whose edge graph cannot be reflected

type EntityTypeProjection

type EntityTypeProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string    `json:"id,omitempty"`
	CreatedAt             time.Time `json:"created_at,omitempty"`
	CreatedBy             string    `json:"created_by,omitempty"`
	InternalNotes         string    `json:"internal_notes,omitempty"`
	Name                  string    `json:"name,omitempty"`
	OwnerID               string    `json:"owner_id,omitempty"`
	SystemInternalID      string    `json:"system_internal_id,omitempty"`
	SystemOwned           bool      `json:"system_owned,omitempty"`
	Tags                  []string  `json:"tags,omitempty"`
	UpdatedAt             time.Time `json:"updated_at,omitempty"`
	UpdatedBy             string    `json:"updated_by,omitempty"`
	UpdatedByImpersonator string    `json:"updated_by_impersonator,omitempty"`
}

EntityTypeProjection is the flat, CEL- and jsonschema-facing view of a EntityType: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.EntityType whose edge graph cannot be reflected

type EnumParser

type EnumParser[T ~string] func(string) *T

EnumParser converts a normalized string into an enum pointer value

type EventProjection

type EventProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID            string                 `json:"id,omitempty"`
	CorrelationID string                 `json:"correlation_id,omitempty"`
	CreatedAt     time.Time              `json:"created_at,omitempty"`
	CreatedBy     string                 `json:"created_by,omitempty"`
	EventID       string                 `json:"event_id,omitempty"`
	EventType     string                 `json:"event_type,omitempty"`
	Metadata      map[string]interface{} `json:"metadata,omitempty"`
	Tags          []string               `json:"tags,omitempty"`
	UpdatedAt     time.Time              `json:"updated_at,omitempty"`
	UpdatedBy     string                 `json:"updated_by,omitempty"`
}

EventProjection is the flat, CEL- and jsonschema-facing view of a Event: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Event whose edge graph cannot be reflected

type EvidenceProjection

type EvidenceProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                     string               `json:"id,omitempty"`
	AuditorReferenceID     string               `json:"auditor_reference_id,omitempty"`
	CollectionProcedure    string               `json:"collection_procedure,omitempty"`
	CreatedAt              time.Time            `json:"created_at,omitempty"`
	CreatedBy              string               `json:"created_by,omitempty"`
	CreationDate           models.DateTime      `json:"creation_date,omitempty"`
	Description            string               `json:"description,omitempty"`
	DisplayID              string               `json:"display_id,omitempty"`
	EnvironmentID          string               `json:"environment_id,omitempty"`
	EnvironmentName        string               `json:"environment_name,omitempty"`
	ExternalUUID           string               `json:"external_uuid,omitempty"`
	IsAutomated            bool                 `json:"is_automated,omitempty"`
	Name                   string               `json:"name,omitempty"`
	OwnerID                string               `json:"owner_id,omitempty"`
	RenewalDate            models.DateTime      `json:"renewal_date,omitempty"`
	ReviewFrequency        enums.Frequency      `json:"review_frequency,omitempty"`
	ScopeID                string               `json:"scope_id,omitempty"`
	ScopeName              string               `json:"scope_name,omitempty"`
	Source                 string               `json:"source,omitempty"`
	Status                 enums.EvidenceStatus `json:"status,omitempty"`
	Tags                   []string             `json:"tags,omitempty"`
	UpdatedAt              time.Time            `json:"updated_at,omitempty"`
	UpdatedBy              string               `json:"updated_by,omitempty"`
	UpdatedByImpersonator  string               `json:"updated_by_impersonator,omitempty"`
	URL                    string               `json:"url,omitempty"`
	WorkflowEligibleMarker bool                 `json:"workflow_eligible_marker,omitempty"`
}

EvidenceProjection is the flat, CEL- and jsonschema-facing view of a Evidence: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Evidence whose edge graph cannot be reflected

type FieldDescriptor

type FieldDescriptor struct {
	// Name is the schema field name (snake_case)
	Name string `json:"name"`
	// Label is the human-readable label (PascalCase of the field name)
	Label string `json:"label"`
	// Type is the ent field type string (e.g. "string", "bool", "time.Time")
	Type string `json:"type"`
	// WorkflowEligible reports whether the field may drive workflow conditions and triggers
	WorkflowEligible bool `json:"workflowEligible,omitempty"`
	// MatchKey reports whether the field is a plain-string indexed column usable as a cross-link match key
	MatchKey bool `json:"matchKey,omitempty"`
	// InputKey is the integration mapping create-input key (lowerCamel); empty for non-mapped fields
	InputKey string `json:"inputKey,omitempty"`
	// LookupKey reports whether the field is the ingest upsert lookup column for its schema
	LookupKey bool `json:"lookupKey,omitempty"`
	// DisplayKey reports whether the field is the schema's display-name source
	DisplayKey bool `json:"displayKey,omitempty"`
	// Clearable reports whether update inputs support explicitly clearing this field
	Clearable bool `json:"clearable,omitempty"`
	// WebhookPayload reports whether workflow webhook enrichment includes this field
	WebhookPayload bool `json:"webhookPayload,omitempty"`
	// TaskRules are suggested-task rules declared on this field via entx.FieldTaskRule
	TaskRules []TaskRuleDescriptor `json:"taskRules,omitempty"`
}

FieldDescriptor describes one field on a schema. It is the single field-capability record shared by the workflow builder (condition/trigger fields) and the integration cross-link config (match fields), replacing the separate workflow-field and key-field lists

type FieldMatch

type FieldMatch struct {
	// Field is the snake_case mutation field the predicate reads
	Field string
	// In is the set of accepted stringified values
	In []string
	// Negate inverts the membership test
	Negate bool
}

FieldMatch is one declarative proposed-value predicate on a mutation listener: the mutation's proposed value for Field must stringify to a member of In (or a non-member when Negate is set) for the listener to run

type FieldTaskRule

type FieldTaskRule struct {
	// Field is the snake_case field name the rule was declared on; empty for schema-level rules
	Field string
	// Rule is the task rule descriptor itself
	Rule TaskRuleDescriptor
}

FieldTaskRule pairs one task rule with the field it was declared on. Field is empty for schema-level rules (entx.SchemaTaskRule), which have no field to evaluate and always fire

type FileProjection

type FileProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string                 `json:"id,omitempty"`
	CategoryID            string                 `json:"category_id,omitempty"`
	CategoryName          string                 `json:"category_name,omitempty"`
	CategoryType          string                 `json:"category_type,omitempty"`
	CreatedAt             time.Time              `json:"created_at,omitempty"`
	CreatedBy             string                 `json:"created_by,omitempty"`
	DetectedContentType   string                 `json:"detected_content_type,omitempty"`
	DetectedMimeType      string                 `json:"detected_mime_type,omitempty"`
	EnvironmentID         string                 `json:"environment_id,omitempty"`
	EnvironmentName       string                 `json:"environment_name,omitempty"`
	InternalNotes         string                 `json:"internal_notes,omitempty"`
	LastAccessedAt        time.Time              `json:"last_accessed_at,omitempty"`
	Md5Hash               string                 `json:"md5_hash,omitempty"`
	Metadata              map[string]interface{} `json:"metadata,omitempty"`
	Name                  string                 `json:"name,omitempty"`
	PersistedFileSize     int64                  `json:"persisted_file_size,omitempty"`
	ProvidedFileExtension string                 `json:"provided_file_extension,omitempty"`
	ProvidedFileName      string                 `json:"provided_file_name,omitempty"`
	ProvidedFileSize      int64                  `json:"provided_file_size,omitempty"`
	ScopeID               string                 `json:"scope_id,omitempty"`
	ScopeName             string                 `json:"scope_name,omitempty"`
	StoragePath           string                 `json:"storage_path,omitempty"`
	StorageProvider       string                 `json:"storage_provider,omitempty"`
	StorageRegion         string                 `json:"storage_region,omitempty"`
	StorageScheme         string                 `json:"storage_scheme,omitempty"`
	StorageVolume         string                 `json:"storage_volume,omitempty"`
	StoreKey              string                 `json:"store_key,omitempty"`
	SystemInternalID      string                 `json:"system_internal_id,omitempty"`
	SystemOwned           bool                   `json:"system_owned,omitempty"`
	Tags                  []string               `json:"tags,omitempty"`
	UpdatedAt             time.Time              `json:"updated_at,omitempty"`
	UpdatedBy             string                 `json:"updated_by,omitempty"`
	UpdatedByImpersonator string                 `json:"updated_by_impersonator,omitempty"`
	URI                   string                 `json:"uri,omitempty"`
}

FileProjection is the flat, CEL- and jsonschema-facing view of a File: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.File whose edge graph cannot be reflected

type FindingControlProjection

type FindingControlProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                      string                 `json:"id,omitempty"`
	ControlID               string                 `json:"control_id,omitempty"`
	CreatedAt               time.Time              `json:"created_at,omitempty"`
	CreatedBy               string                 `json:"created_by,omitempty"`
	DiscoveredAt            models.DateTime        `json:"discovered_at,omitempty"`
	ExternalControlID       string                 `json:"external_control_id,omitempty"`
	ExternalStandard        string                 `json:"external_standard,omitempty"`
	ExternalStandardVersion string                 `json:"external_standard_version,omitempty"`
	FindingID               string                 `json:"finding_id,omitempty"`
	Metadata                map[string]interface{} `json:"metadata,omitempty"`
	OwnerID                 string                 `json:"owner_id,omitempty"`
	Source                  string                 `json:"source,omitempty"`
	StandardID              string                 `json:"standard_id,omitempty"`
	UpdatedAt               time.Time              `json:"updated_at,omitempty"`
	UpdatedBy               string                 `json:"updated_by,omitempty"`
	UpdatedByImpersonator   string                 `json:"updated_by_impersonator,omitempty"`
}

FindingControlProjection is the flat, CEL- and jsonschema-facing view of a FindingControl: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.FindingControl whose edge graph cannot be reflected

type FindingProjection

type FindingProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                     string                 `json:"id,omitempty"`
	AssessmentID           string                 `json:"assessment_id,omitempty"`
	AssignedTo             string                 `json:"assigned_to,omitempty"`
	AssignedToGroupID      string                 `json:"assigned_to_group_id,omitempty"`
	AssignedToUserID       string                 `json:"assigned_to_user_id,omitempty"`
	BlocksProduction       bool                   `json:"blocks_production,omitempty"`
	Categories             []string               `json:"categories,omitempty"`
	Category               string                 `json:"category,omitempty"`
	CreatedAt              time.Time              `json:"created_at,omitempty"`
	CreatedBy              string                 `json:"created_by,omitempty"`
	Description            string                 `json:"description,omitempty"`
	DisplayID              string                 `json:"display_id,omitempty"`
	DisplayName            string                 `json:"display_name,omitempty"`
	EnvironmentID          string                 `json:"environment_id,omitempty"`
	EnvironmentName        string                 `json:"environment_name,omitempty"`
	EventTime              models.DateTime        `json:"event_time,omitempty"`
	Exploitability         float64                `json:"exploitability,omitempty"`
	ExternalID             string                 `json:"external_id,omitempty"`
	ExternalOwnerID        string                 `json:"external_owner_id,omitempty"`
	ExternalURI            string                 `json:"external_uri,omitempty"`
	FindingClass           string                 `json:"finding_class,omitempty"`
	FindingStatusID        string                 `json:"finding_status_id,omitempty"`
	FindingStatusName      string                 `json:"finding_status_name,omitempty"`
	Impact                 float64                `json:"impact,omitempty"`
	InternalNotes          string                 `json:"internal_notes,omitempty"`
	Metadata               map[string]interface{} `json:"metadata,omitempty"`
	NumericSeverity        float64                `json:"numeric_severity,omitempty"`
	Open                   bool                   `json:"open,omitempty"`
	OwnerID                string                 `json:"owner_id,omitempty"`
	Priority               string                 `json:"priority,omitempty"`
	Production             bool                   `json:"production,omitempty"`
	Public                 bool                   `json:"public,omitempty"`
	RawPayload             map[string]interface{} `json:"raw_payload,omitempty"`
	Recommendation         string                 `json:"recommendation,omitempty"`
	RecommendedActions     string                 `json:"recommended_actions,omitempty"`
	References             []string               `json:"references,omitempty"`
	RemediationSLA         int                    `json:"remediation_sla,omitempty"`
	ReportedAt             models.DateTime        `json:"reported_at,omitempty"`
	ResourceName           string                 `json:"resource_name,omitempty"`
	ReviewedBy             string                 `json:"reviewed_by,omitempty"`
	ReviewedByGroupID      string                 `json:"reviewed_by_group_id,omitempty"`
	ReviewedByUserID       string                 `json:"reviewed_by_user_id,omitempty"`
	ScopeID                string                 `json:"scope_id,omitempty"`
	ScopeName              string                 `json:"scope_name,omitempty"`
	Score                  float64                `json:"score,omitempty"`
	SecurityLevel          enums.SecurityLevel    `json:"security_level,omitempty"`
	Severity               string                 `json:"severity,omitempty"`
	Source                 string                 `json:"source,omitempty"`
	SourceUpdatedAt        models.DateTime        `json:"source_updated_at,omitempty"`
	State                  string                 `json:"state,omitempty"`
	StepsToReproduce       []string               `json:"steps_to_reproduce,omitempty"`
	SystemInternalID       string                 `json:"system_internal_id,omitempty"`
	SystemOwned            bool                   `json:"system_owned,omitempty"`
	Tags                   []string               `json:"tags,omitempty"`
	TargetDetails          map[string]interface{} `json:"target_details,omitempty"`
	Targets                []string               `json:"targets,omitempty"`
	UpdatedAt              time.Time              `json:"updated_at,omitempty"`
	UpdatedBy              string                 `json:"updated_by,omitempty"`
	UpdatedByImpersonator  string                 `json:"updated_by_impersonator,omitempty"`
	Validated              bool                   `json:"validated,omitempty"`
	Vector                 string                 `json:"vector,omitempty"`
	WorkflowEligibleMarker bool                   `json:"workflow_eligible_marker,omitempty"`
}

FindingProjection is the flat, CEL- and jsonschema-facing view of a Finding: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Finding whose edge graph cannot be reflected

type GroupProjection

type GroupProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string    `json:"id,omitempty"`
	AvatarLocalFileID     string    `json:"avatar_local_file_id,omitempty"`
	CreatedAt             time.Time `json:"created_at,omitempty"`
	CreatedBy             string    `json:"created_by,omitempty"`
	Description           string    `json:"description,omitempty"`
	DisplayID             string    `json:"display_id,omitempty"`
	DisplayName           string    `json:"display_name,omitempty"`
	GravatarLogoURL       string    `json:"gravatar_logo_url,omitempty"`
	IsManaged             bool      `json:"is_managed,omitempty"`
	LogoURL               string    `json:"logo_url,omitempty"`
	Name                  string    `json:"name,omitempty"`
	OscalContactUuids     []string  `json:"oscal_contact_uuids,omitempty"`
	OscalPartyUUID        string    `json:"oscal_party_uuid,omitempty"`
	OscalRole             string    `json:"oscal_role,omitempty"`
	OwnerID               string    `json:"owner_id,omitempty"`
	ScimActive            bool      `json:"scim_active,omitempty"`
	ScimDisplayName       string    `json:"scim_display_name,omitempty"`
	ScimExternalID        string    `json:"scim_external_id,omitempty"`
	ScimGroupMailing      string    `json:"scim_group_mailing,omitempty"`
	Tags                  []string  `json:"tags,omitempty"`
	UpdatedAt             time.Time `json:"updated_at,omitempty"`
	UpdatedBy             string    `json:"updated_by,omitempty"`
	UpdatedByImpersonator string    `json:"updated_by_impersonator,omitempty"`
}

GroupProjection is the flat, CEL- and jsonschema-facing view of a Group: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Group whose edge graph cannot be reflected

type IdentityHolderProjection

type IdentityHolderProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                     string                   `json:"id,omitempty"`
	AlternateEmail         string                   `json:"alternate_email,omitempty"`
	AvatarRemoteURL        string                   `json:"avatar_remote_url,omitempty"`
	CreatedAt              time.Time                `json:"created_at,omitempty"`
	CreatedBy              string                   `json:"created_by,omitempty"`
	Department             string                   `json:"department,omitempty"`
	DisplayID              string                   `json:"display_id,omitempty"`
	Email                  string                   `json:"email,omitempty"`
	EmailAliases           []string                 `json:"email_aliases,omitempty"`
	EmployerEntityID       string                   `json:"employer_entity_id,omitempty"`
	EndDate                models.DateTime          `json:"end_date,omitempty"`
	EnvironmentID          string                   `json:"environment_id,omitempty"`
	EnvironmentName        string                   `json:"environment_name,omitempty"`
	ExternalReferenceID    string                   `json:"external_reference_id,omitempty"`
	ExternalUserID         string                   `json:"external_user_id,omitempty"`
	FullName               string                   `json:"full_name,omitempty"`
	IdentityHolderType     enums.IdentityHolderType `json:"identity_holder_type,omitempty"`
	InternalOwner          string                   `json:"internal_owner,omitempty"`
	InternalOwnerGroupID   string                   `json:"internal_owner_group_id,omitempty"`
	InternalOwnerUserID    string                   `json:"internal_owner_user_id,omitempty"`
	IsActive               bool                     `json:"is_active,omitempty"`
	IsOpenlaneUser         bool                     `json:"is_openlane_user,omitempty"`
	Location               string                   `json:"location,omitempty"`
	Metadata               map[string]interface{}   `json:"metadata,omitempty"`
	OwnerID                string                   `json:"owner_id,omitempty"`
	PhoneNumber            string                   `json:"phone_number,omitempty"`
	ScopeID                string                   `json:"scope_id,omitempty"`
	ScopeName              string                   `json:"scope_name,omitempty"`
	StartDate              models.DateTime          `json:"start_date,omitempty"`
	Status                 enums.UserStatus         `json:"status,omitempty"`
	Tags                   []string                 `json:"tags,omitempty"`
	Team                   string                   `json:"team,omitempty"`
	Title                  string                   `json:"title,omitempty"`
	UpdatedAt              time.Time                `json:"updated_at,omitempty"`
	UpdatedBy              string                   `json:"updated_by,omitempty"`
	UpdatedByImpersonator  string                   `json:"updated_by_impersonator,omitempty"`
	UserID                 string                   `json:"user_id,omitempty"`
	WorkflowEligibleMarker bool                     `json:"workflow_eligible_marker,omitempty"`
}

IdentityHolderProjection is the flat, CEL- and jsonschema-facing view of a IdentityHolder: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.IdentityHolder whose edge graph cannot be reflected

type IngestCapability

type IngestCapability struct {
	Topic gala.Topic[IngestRequest]
	// contains filtered or unexported fields
}

IngestCapability is the schema's single asynchronous ingest control surface.

type IngestIntegrationResolver

type IngestIntegrationResolver func(context.Context, *generated.Client, gala.OperationContext) (*generated.Integration, error)

IngestIntegrationResolver loads the integration referenced by the durable operation context. The application owns terminal-error classification for integrations removed while work is queued.

type IngestPersist

IngestPersist is the type-erased persistence operation bound to a schema at startup.

type IngestRequest

type IngestRequest struct {
	OperationContext gala.OperationContext `json:"operationContext"`
	Input            json.RawMessage       `json:"input"`
	ThroughEdgeIDs   map[string][]string   `json:"throughEdgeIds,omitempty"`
	Defaults         map[string]any        `json:"defaults,omitempty"`
	Links            []LinkSpec            `json:"links,omitempty"`
}

IngestRequest is the durable schema-ingest command. Defaults are resolved through the schema field catalog, so operation-specific values do not become fields on the ingest machinery.

type IntegrationProjection

type IntegrationProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                       string                  `json:"id,omitempty"`
	CampaignEmail            bool                    `json:"campaign_email,omitempty"`
	CreatedAt                time.Time               `json:"created_at,omitempty"`
	CreatedBy                string                  `json:"created_by,omitempty"`
	DefinitionID             string                  `json:"definition_id,omitempty"`
	DefinitionSlug           string                  `json:"definition_slug,omitempty"`
	DefinitionVersion        string                  `json:"definition_version,omitempty"`
	Description              string                  `json:"description,omitempty"`
	EnvironmentID            string                  `json:"environment_id,omitempty"`
	EnvironmentName          string                  `json:"environment_name,omitempty"`
	Family                   string                  `json:"family,omitempty"`
	IntegrationType          string                  `json:"integration_type,omitempty"`
	InternalNotes            string                  `json:"internal_notes,omitempty"`
	Kind                     string                  `json:"kind,omitempty"`
	Metadata                 map[string]interface{}  `json:"metadata,omitempty"`
	Name                     string                  `json:"name,omitempty"`
	OwnerID                  string                  `json:"owner_id,omitempty"`
	PlatformID               string                  `json:"platform_id,omitempty"`
	PrimaryDirectory         bool                    `json:"primary_directory,omitempty"`
	ProviderMetadataSnapshot map[string]interface{}  `json:"provider_metadata_snapshot,omitempty"`
	ScopeID                  string                  `json:"scope_id,omitempty"`
	ScopeName                string                  `json:"scope_name,omitempty"`
	Status                   enums.IntegrationStatus `json:"status,omitempty"`
	SystemInternalID         string                  `json:"system_internal_id,omitempty"`
	SystemOwned              bool                    `json:"system_owned,omitempty"`
	Tags                     []string                `json:"tags,omitempty"`
	UpdatedAt                time.Time               `json:"updated_at,omitempty"`
	UpdatedBy                string                  `json:"updated_by,omitempty"`
	UpdatedByImpersonator    string                  `json:"updated_by_impersonator,omitempty"`
}

IntegrationProjection is the flat, CEL- and jsonschema-facing view of a Integration: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Integration whose edge graph cannot be reflected

type InternalPolicyProjection

type InternalPolicyProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                              string                       `json:"id,omitempty"`
	ApprovalRequired                bool                         `json:"approval_required,omitempty"`
	ApproverID                      string                       `json:"approver_id,omitempty"`
	ControlSuggestions              []string                     `json:"control_suggestions,omitempty"`
	CreatedAt                       time.Time                    `json:"created_at,omitempty"`
	CreatedBy                       string                       `json:"created_by,omitempty"`
	DelegateID                      string                       `json:"delegate_id,omitempty"`
	Details                         string                       `json:"details,omitempty"`
	DetailsJSON                     []interface{}                `json:"details_json,omitempty"`
	DismissedControlSuggestions     []string                     `json:"dismissed_control_suggestions,omitempty"`
	DismissedImprovementSuggestions []string                     `json:"dismissed_improvement_suggestions,omitempty"`
	DismissedTagSuggestions         []string                     `json:"dismissed_tag_suggestions,omitempty"`
	DisplayID                       string                       `json:"display_id,omitempty"`
	EnvironmentID                   string                       `json:"environment_id,omitempty"`
	EnvironmentName                 string                       `json:"environment_name,omitempty"`
	ExternalContents                string                       `json:"external_contents,omitempty"`
	ExternalFileID                  string                       `json:"external_file_id,omitempty"`
	ExternalUUID                    string                       `json:"external_uuid,omitempty"`
	FileID                          string                       `json:"file_id,omitempty"`
	ImprovementSuggestions          []string                     `json:"improvement_suggestions,omitempty"`
	InternalNotes                   string                       `json:"internal_notes,omitempty"`
	InternalPolicyKindID            string                       `json:"internal_policy_kind_id,omitempty"`
	InternalPolicyKindName          string                       `json:"internal_policy_kind_name,omitempty"`
	ManagementMode                  enums.DocumentManagementMode `json:"management_mode,omitempty"`
	Name                            string                       `json:"name,omitempty"`
	OwnerID                         string                       `json:"owner_id,omitempty"`
	ReviewDue                       time.Time                    `json:"review_due,omitempty"`
	ReviewFrequency                 enums.Frequency              `json:"review_frequency,omitempty"`
	Revision                        string                       `json:"revision,omitempty"`
	ScopeID                         string                       `json:"scope_id,omitempty"`
	ScopeName                       string                       `json:"scope_name,omitempty"`
	Status                          enums.DocumentStatus         `json:"status,omitempty"`
	Summary                         string                       `json:"summary,omitempty"`
	SystemInternalID                string                       `json:"system_internal_id,omitempty"`
	SystemOwned                     bool                         `json:"system_owned,omitempty"`
	TagSuggestions                  []string                     `json:"tag_suggestions,omitempty"`
	Tags                            []string                     `json:"tags,omitempty"`
	UpdatedAt                       time.Time                    `json:"updated_at,omitempty"`
	UpdatedBy                       string                       `json:"updated_by,omitempty"`
	UpdatedByImpersonator           string                       `json:"updated_by_impersonator,omitempty"`
	URL                             string                       `json:"url,omitempty"`
	WorkflowEligibleMarker          bool                         `json:"workflow_eligible_marker,omitempty"`
}

InternalPolicyProjection is the flat, CEL- and jsonschema-facing view of a InternalPolicy: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.InternalPolicy whose edge graph cannot be reflected

type Invocation

type Invocation struct {
	// Context is the restored event context seeded with the ent client
	Context context.Context
	// Client is the ent client resolved from the gala injector
	Client *generated.Client
	// Schema is the entityops schema handle for the mutated type
	Schema *Schema
	// EntityID is the mutated entity identifier
	EntityID string
	// Caller is the pre-resolved caller for this dispatch, never nil
	Caller *auth.Caller
	// Envelope is the envelope being processed
	Envelope gala.Envelope
	// Injector provides typed dependency lookup via samber/do for every subsystem
	// registered at wiring
	Injector do.Injector
}

Invocation bundles the standard dependencies handed to a mutation listener

type KeyMatch

type KeyMatch struct {
	// TargetField is the snake_case field on the target schema to match against
	TargetField string `json:"target_field"`
	// SourceField is the snake_case scalar field on the source entity whose value must match the target field
	SourceField string `json:"source_field,omitempty"`
	// SourceList is the snake_case list field on the source entity holding additional candidate values
	SourceList string `json:"source_list,omitempty"`
}

KeyMatch describes a structured key-equality match between a target schema field and values taken from the source entity. When set on a TargetSelector it is compiled into an indexed query predicate (target_field IN source values) instead of a row-by-row expression evaluation

type LinkSpec

type LinkSpec struct {
	// Edge is the edge name on the source schema to link over
	Edge string `json:"edge"`
	// Target specifies which entities to link via schema, key match, or expression
	Target TargetSelector `json:"target"`
}

LinkSpec describes one edge-linking operation: the named edge to link over and a target selector resolving which entities to link. Resolved through selectTargets and applied by InjectCreateLinks, which sets the edge in the create mutation itself; shared by the integration ingest engine and the workflow CREATE_OBJECT action so both set edges identically at create time

type MentionSpec

type MentionSpec struct {
	Schema           string `json:"schema"`
	NameField        string `json:"nameField"`
	DetailsField     string `json:"detailsField"`
	DetailsJSONField string `json:"detailsJsonField"`
	OwnerField       string `json:"ownerField"`
}

MentionSpec describes the rich-text fields scanned for mentions on a schema.

func MentionSpecFor

func MentionSpecFor(schemaType string) (MentionSpec, bool)

MentionSpecFor returns the annotation-declared mention fields for a schema.

type MutationConcern

type MutationConcern string

MutationConcern identifies the eventing concern namespace for mutation topics

const (
	// MutationConcernDirect is the default concern for direct mutation listeners
	MutationConcernDirect MutationConcern = "direct"
	// MutationConcernWorkflow is the concern for workflow mutation listeners
	MutationConcernWorkflow MutationConcern = "workflow"
	// MutationConcernNotification is the concern for notification mutation listeners
	MutationConcernNotification MutationConcern = "notification"
)

type MutationListener

type MutationListener struct {
	// Concern selects the mutation topic namespace; empty means the direct concern
	Concern MutationConcern
	// Schema is the canonical entityops schema whose mutations the listener observes
	Schema *Schema
	// Operations optionally scopes listener interest to specific mutation operations;
	// empty expands to RegularMutationOps, so OpSoftDelete is explicit opt-in
	Operations []string
	// Fields optionally gates update operations on at least one of these fields having
	// changed; create and delete operations pass the gate
	Fields []string
	// Match optionally gates handling on every proposed-value predicate holding
	Match []FieldMatch
	// Caller optionally replaces or augments the restored caller; it receives the restored
	// caller (never nil) and its result is set on the context and Invocation.Caller
	Caller func(*auth.Caller, MutationPayload) *auth.Caller
	// ContextKeys are applied to the context in order before the handler runs
	ContextKeys []func(context.Context) context.Context
	// Notify declares a declarative notification emitted when the gates pass; exactly one of
	// Handle and Notify must be set
	Notify *NotifySpec
	// Handle is invoked with the standard invocation bundle and the mutation payload
	Handle func(Invocation, MutationPayload) error
}

MutationListener declares one mutation listener bound to a schema mutation topic and compiles to a standard gala definition via Definition, so registration is always gala.Register. The listener name composes from the topic and optional label; declarative gating, caller resolution, and context keys compile to their definition fields, and the handler runs behind the standard preamble: restored-client validation and entity-id resolution

func (MutationListener) Attach

func (listener MutationListener) Attach(g *gala.Gala) (gala.ListenerID, error)

Attach compiles the listener to its definition and registers it on the runtime

func (MutationListener) Definition

func (listener MutationListener) Definition() gala.Definition[MutationPayload]

Definition compiles the listener into the standard gala definition, so mutation listeners register through gala.Register like every other listener

func (MutationListener) Name

func (listener MutationListener) Name() string

Name returns the composed listener name: the mutation topic, suffixed with the label when one is set

type MutationPayload

type MutationPayload struct {
	// MutationType is the ent schema type that emitted the mutation
	MutationType string `json:"mutation_type"`
	// Operation is the mutation operation string
	Operation string `json:"operation"`
	// EntityID is the mutated entity identifier
	EntityID string `json:"entity_id"`

	ChangeSet
}

MutationPayload is the durable mutation event payload dispatched to gala listeners. Identity field json tags and the embedded ChangeSet tags are wire format for queued jobs

func (MutationPayload) PayloadOperation

func (payload MutationPayload) PayloadOperation() string

PayloadOperation returns the mutation operation for gala listener routing

func (MutationPayload) WithPayloadOperation

func (payload MutationPayload) WithPayloadOperation(operation string) any

WithPayloadOperation returns a copy of the payload with its operation replaced

type NarrativeProjection

type NarrativeProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string    `json:"id,omitempty"`
	CreatedAt             time.Time `json:"created_at,omitempty"`
	CreatedBy             string    `json:"created_by,omitempty"`
	Description           string    `json:"description,omitempty"`
	Details               string    `json:"details,omitempty"`
	DisplayID             string    `json:"display_id,omitempty"`
	InternalNotes         string    `json:"internal_notes,omitempty"`
	Name                  string    `json:"name,omitempty"`
	OwnerID               string    `json:"owner_id,omitempty"`
	SystemInternalID      string    `json:"system_internal_id,omitempty"`
	SystemOwned           bool      `json:"system_owned,omitempty"`
	Tags                  []string  `json:"tags,omitempty"`
	UpdatedAt             time.Time `json:"updated_at,omitempty"`
	UpdatedBy             string    `json:"updated_by,omitempty"`
	UpdatedByImpersonator string    `json:"updated_by_impersonator,omitempty"`
}

NarrativeProjection is the flat, CEL- and jsonschema-facing view of a Narrative: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Narrative whose edge graph cannot be reflected

type NoteProjection

type NoteProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string        `json:"id,omitempty"`
	CreatedAt             time.Time     `json:"created_at,omitempty"`
	CreatedBy             string        `json:"created_by,omitempty"`
	DiscussionID          string        `json:"discussion_id,omitempty"`
	DisplayID             string        `json:"display_id,omitempty"`
	IsEdited              bool          `json:"is_edited,omitempty"`
	NoteRef               string        `json:"note_ref,omitempty"`
	NotifiedAt            time.Time     `json:"notified_at,omitempty"`
	NotifySubscribers     bool          `json:"notify_subscribers,omitempty"`
	OwnerID               string        `json:"owner_id,omitempty"`
	Text                  string        `json:"text,omitempty"`
	TextJSON              []interface{} `json:"text_json,omitempty"`
	Title                 string        `json:"title,omitempty"`
	TrustCenterID         string        `json:"trust_center_id,omitempty"`
	UpdatedAt             time.Time     `json:"updated_at,omitempty"`
	UpdatedBy             string        `json:"updated_by,omitempty"`
	UpdatedByImpersonator string        `json:"updated_by_impersonator,omitempty"`
}

NoteProjection is the flat, CEL- and jsonschema-facing view of a Note: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Note whose edge graph cannot be reflected

type NotificationContent

type NotificationContent struct {
	// Type is the notification audience type
	Type enums.NotificationType
	// Topic is the notification topic
	Topic enums.NotificationTopic
	// TitleTemplate is the Go text/template title, matching the ent title_template column
	TitleTemplate string
	// BodyTemplate is the Go text/template body, matching the ent body_template column
	BodyTemplate string
	// Data is static base data carried on the notification; string values render as templates
	// and empty rendered values are omitted, matching the ent defaults column semantics
	Data map[string]any
}

NotificationContent is the in-code notification content contract; its fields mirror the notification_template ent schema columns so specs can later hydrate from persisted rows

type NotifySpec

type NotifySpec struct {
	// Recipients resolves recipient user ids; an empty result skips emission
	Recipients func(Invocation, MutationPayload, json.RawMessage) ([]string, error)
	// Content is the notification content rendered per emission
	Content NotificationContent
}

NotifySpec declares a declarative notification on a mutation listener: recipients resolve from the invocation, payload, and loaded row, and content renders against the notification vars

type OrganizationProjection

type OrganizationProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string    `json:"id,omitempty"`
	AvatarLocalFileID     string    `json:"avatar_local_file_id,omitempty"`
	AvatarRemoteURL       string    `json:"avatar_remote_url,omitempty"`
	AvatarUpdatedAt       time.Time `json:"avatar_updated_at,omitempty"`
	CreatedAt             time.Time `json:"created_at,omitempty"`
	CreatedBy             string    `json:"created_by,omitempty"`
	Description           string    `json:"description,omitempty"`
	DisplayName           string    `json:"display_name,omitempty"`
	Name                  string    `json:"name,omitempty"`
	PersonalOrg           bool      `json:"personal_org,omitempty"`
	SlugName              string    `json:"slug_name,omitempty"`
	StripeCustomerID      string    `json:"stripe_customer_id,omitempty"`
	Tags                  []string  `json:"tags,omitempty"`
	UpdatedAt             time.Time `json:"updated_at,omitempty"`
	UpdatedBy             string    `json:"updated_by,omitempty"`
	UpdatedByImpersonator string    `json:"updated_by_impersonator,omitempty"`
}

OrganizationProjection is the flat, CEL- and jsonschema-facing view of a Organization: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Organization whose edge graph cannot be reflected

type PlatformProjection

type PlatformProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                             string                 `json:"id,omitempty"`
	AccessModelID                  string                 `json:"access_model_id,omitempty"`
	AccessModelName                string                 `json:"access_model_name,omitempty"`
	BusinessOwner                  string                 `json:"business_owner,omitempty"`
	BusinessOwnerGroupID           string                 `json:"business_owner_group_id,omitempty"`
	BusinessOwnerUserID            string                 `json:"business_owner_user_id,omitempty"`
	BusinessPurpose                string                 `json:"business_purpose,omitempty"`
	ContainsPii                    bool                   `json:"contains_pii,omitempty"`
	CostCenter                     string                 `json:"cost_center,omitempty"`
	CreatedAt                      time.Time              `json:"created_at,omitempty"`
	CreatedBy                      string                 `json:"created_by,omitempty"`
	CriticalityID                  string                 `json:"criticality_id,omitempty"`
	CriticalityName                string                 `json:"criticality_name,omitempty"`
	DataFlowSummary                string                 `json:"data_flow_summary,omitempty"`
	Description                    string                 `json:"description,omitempty"`
	DisplayID                      string                 `json:"display_id,omitempty"`
	EncryptionStatusID             string                 `json:"encryption_status_id,omitempty"`
	EncryptionStatusName           string                 `json:"encryption_status_name,omitempty"`
	EnvironmentID                  string                 `json:"environment_id,omitempty"`
	EnvironmentName                string                 `json:"environment_name,omitempty"`
	EstimatedMonthlyCost           float64                `json:"estimated_monthly_cost,omitempty"`
	ExternalReferenceID            string                 `json:"external_reference_id,omitempty"`
	ExternalUUID                   string                 `json:"external_uuid,omitempty"`
	InternalOwner                  string                 `json:"internal_owner,omitempty"`
	InternalOwnerGroupID           string                 `json:"internal_owner_group_id,omitempty"`
	InternalOwnerUserID            string                 `json:"internal_owner_user_id,omitempty"`
	Metadata                       map[string]interface{} `json:"metadata,omitempty"`
	Name                           string                 `json:"name,omitempty"`
	OwnerID                        string                 `json:"owner_id,omitempty"`
	PhysicalLocation               string                 `json:"physical_location,omitempty"`
	PlatformDataClassificationID   string                 `json:"platform_data_classification_id,omitempty"`
	PlatformDataClassificationName string                 `json:"platform_data_classification_name,omitempty"`
	PlatformKindID                 string                 `json:"platform_kind_id,omitempty"`
	PlatformKindName               string                 `json:"platform_kind_name,omitempty"`
	PlatformOwnerID                string                 `json:"platform_owner_id,omitempty"`
	PurchaseDate                   models.DateTime        `json:"purchase_date,omitempty"`
	Region                         string                 `json:"region,omitempty"`
	ScopeID                        string                 `json:"scope_id,omitempty"`
	ScopeName                      string                 `json:"scope_name,omitempty"`
	ScopeStatement                 string                 `json:"scope_statement,omitempty"`
	SecurityOwner                  string                 `json:"security_owner,omitempty"`
	SecurityOwnerGroupID           string                 `json:"security_owner_group_id,omitempty"`
	SecurityOwnerUserID            string                 `json:"security_owner_user_id,omitempty"`
	SecurityTierID                 string                 `json:"security_tier_id,omitempty"`
	SecurityTierName               string                 `json:"security_tier_name,omitempty"`
	SourceIdentifier               string                 `json:"source_identifier,omitempty"`
	SourceType                     enums.SourceType       `json:"source_type,omitempty"`
	Status                         enums.PlatformStatus   `json:"status,omitempty"`
	Tags                           []string               `json:"tags,omitempty"`
	TechnicalOwner                 string                 `json:"technical_owner,omitempty"`
	TechnicalOwnerGroupID          string                 `json:"technical_owner_group_id,omitempty"`
	TechnicalOwnerUserID           string                 `json:"technical_owner_user_id,omitempty"`
	TrustBoundaryDescription       string                 `json:"trust_boundary_description,omitempty"`
	UpdatedAt                      time.Time              `json:"updated_at,omitempty"`
	UpdatedBy                      string                 `json:"updated_by,omitempty"`
	UpdatedByImpersonator          string                 `json:"updated_by_impersonator,omitempty"`
	WorkflowEligibleMarker         bool                   `json:"workflow_eligible_marker,omitempty"`
}

PlatformProjection is the flat, CEL- and jsonschema-facing view of a Platform: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Platform whose edge graph cannot be reflected

type ProcedureProjection

type ProcedureProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                              string                       `json:"id,omitempty"`
	ApprovalRequired                bool                         `json:"approval_required,omitempty"`
	ApproverID                      string                       `json:"approver_id,omitempty"`
	ControlSuggestions              []string                     `json:"control_suggestions,omitempty"`
	CreatedAt                       time.Time                    `json:"created_at,omitempty"`
	CreatedBy                       string                       `json:"created_by,omitempty"`
	DelegateID                      string                       `json:"delegate_id,omitempty"`
	Details                         string                       `json:"details,omitempty"`
	DetailsJSON                     []interface{}                `json:"details_json,omitempty"`
	DismissedControlSuggestions     []string                     `json:"dismissed_control_suggestions,omitempty"`
	DismissedImprovementSuggestions []string                     `json:"dismissed_improvement_suggestions,omitempty"`
	DismissedTagSuggestions         []string                     `json:"dismissed_tag_suggestions,omitempty"`
	DisplayID                       string                       `json:"display_id,omitempty"`
	EnvironmentID                   string                       `json:"environment_id,omitempty"`
	EnvironmentName                 string                       `json:"environment_name,omitempty"`
	ExternalContents                string                       `json:"external_contents,omitempty"`
	ExternalFileID                  string                       `json:"external_file_id,omitempty"`
	FileID                          string                       `json:"file_id,omitempty"`
	ImprovementSuggestions          []string                     `json:"improvement_suggestions,omitempty"`
	InternalNotes                   string                       `json:"internal_notes,omitempty"`
	ManagementMode                  enums.DocumentManagementMode `json:"management_mode,omitempty"`
	Name                            string                       `json:"name,omitempty"`
	OwnerID                         string                       `json:"owner_id,omitempty"`
	ProcedureKindID                 string                       `json:"procedure_kind_id,omitempty"`
	ProcedureKindName               string                       `json:"procedure_kind_name,omitempty"`
	ReviewDue                       time.Time                    `json:"review_due,omitempty"`
	ReviewFrequency                 enums.Frequency              `json:"review_frequency,omitempty"`
	Revision                        string                       `json:"revision,omitempty"`
	ScopeID                         string                       `json:"scope_id,omitempty"`
	ScopeName                       string                       `json:"scope_name,omitempty"`
	Status                          enums.DocumentStatus         `json:"status,omitempty"`
	Summary                         string                       `json:"summary,omitempty"`
	SystemInternalID                string                       `json:"system_internal_id,omitempty"`
	SystemOwned                     bool                         `json:"system_owned,omitempty"`
	TagSuggestions                  []string                     `json:"tag_suggestions,omitempty"`
	Tags                            []string                     `json:"tags,omitempty"`
	UpdatedAt                       time.Time                    `json:"updated_at,omitempty"`
	UpdatedBy                       string                       `json:"updated_by,omitempty"`
	UpdatedByImpersonator           string                       `json:"updated_by_impersonator,omitempty"`
	URL                             string                       `json:"url,omitempty"`
	WorkflowEligibleMarker          bool                         `json:"workflow_eligible_marker,omitempty"`
}

ProcedureProjection is the flat, CEL- and jsonschema-facing view of a Procedure: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Procedure whose edge graph cannot be reflected

type ProgramProjection

type ProgramProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                         string              `json:"id,omitempty"`
	AuditFirm                  string              `json:"audit_firm,omitempty"`
	Auditor                    string              `json:"auditor,omitempty"`
	AuditorEmail               string              `json:"auditor_email,omitempty"`
	AuditorReadComments        bool                `json:"auditor_read_comments,omitempty"`
	AuditorReady               bool                `json:"auditor_ready,omitempty"`
	AuditorWriteComments       bool                `json:"auditor_write_comments,omitempty"`
	CreatedAt                  time.Time           `json:"created_at,omitempty"`
	CreatedBy                  string              `json:"created_by,omitempty"`
	Description                string              `json:"description,omitempty"`
	DisplayID                  string              `json:"display_id,omitempty"`
	EndDate                    time.Time           `json:"end_date,omitempty"`
	ExternalUUID               string              `json:"external_uuid,omitempty"`
	FieldworkEndDate           time.Time           `json:"fieldwork_end_date,omitempty"`
	FieldworkStartDate         time.Time           `json:"fieldwork_start_date,omitempty"`
	FrameworkName              string              `json:"framework_name,omitempty"`
	Name                       string              `json:"name,omitempty"`
	ObservationPeriodEndDate   time.Time           `json:"observation_period_end_date,omitempty"`
	ObservationPeriodStartDate time.Time           `json:"observation_period_start_date,omitempty"`
	OwnerID                    string              `json:"owner_id,omitempty"`
	ProgramKindID              string              `json:"program_kind_id,omitempty"`
	ProgramKindName            string              `json:"program_kind_name,omitempty"`
	ProgramOwnerID             string              `json:"program_owner_id,omitempty"`
	StartDate                  time.Time           `json:"start_date,omitempty"`
	Status                     enums.ProgramStatus `json:"status,omitempty"`
	Tags                       []string            `json:"tags,omitempty"`
	UpdatedAt                  time.Time           `json:"updated_at,omitempty"`
	UpdatedBy                  string              `json:"updated_by,omitempty"`
	UpdatedByImpersonator      string              `json:"updated_by_impersonator,omitempty"`
}

ProgramProjection is the flat, CEL- and jsonschema-facing view of a Program: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Program whose edge graph cannot be reflected

type RemediationProjection

type RemediationProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                     string                  `json:"id,omitempty"`
	CompletedAt            models.DateTime         `json:"completed_at,omitempty"`
	CreatedAt              time.Time               `json:"created_at,omitempty"`
	CreatedBy              string                  `json:"created_by,omitempty"`
	DisplayID              string                  `json:"display_id,omitempty"`
	DueAt                  models.DateTime         `json:"due_at,omitempty"`
	EnvironmentID          string                  `json:"environment_id,omitempty"`
	EnvironmentName        string                  `json:"environment_name,omitempty"`
	Error                  string                  `json:"error,omitempty"`
	Explanation            string                  `json:"explanation,omitempty"`
	ExternalID             string                  `json:"external_id,omitempty"`
	ExternalOwnerID        string                  `json:"external_owner_id,omitempty"`
	ExternalURI            string                  `json:"external_uri,omitempty"`
	Instructions           string                  `json:"instructions,omitempty"`
	Intent                 string                  `json:"intent,omitempty"`
	InternalNotes          string                  `json:"internal_notes,omitempty"`
	Metadata               map[string]interface{}  `json:"metadata,omitempty"`
	OwnerID                string                  `json:"owner_id,omitempty"`
	OwnerReference         string                  `json:"owner_reference,omitempty"`
	PrGeneratedAt          models.DateTime         `json:"pr_generated_at,omitempty"`
	PullRequestURI         string                  `json:"pull_request_uri,omitempty"`
	RepositoryURI          string                  `json:"repository_uri,omitempty"`
	ScopeID                string                  `json:"scope_id,omitempty"`
	ScopeName              string                  `json:"scope_name,omitempty"`
	Source                 string                  `json:"source,omitempty"`
	State                  string                  `json:"state,omitempty"`
	Status                 enums.RemediationStatus `json:"status,omitempty"`
	Summary                string                  `json:"summary,omitempty"`
	SystemInternalID       string                  `json:"system_internal_id,omitempty"`
	SystemOwned            bool                    `json:"system_owned,omitempty"`
	Tags                   []string                `json:"tags,omitempty"`
	TicketReference        string                  `json:"ticket_reference,omitempty"`
	Title                  string                  `json:"title,omitempty"`
	UpdatedAt              time.Time               `json:"updated_at,omitempty"`
	UpdatedBy              string                  `json:"updated_by,omitempty"`
	UpdatedByImpersonator  string                  `json:"updated_by_impersonator,omitempty"`
	WorkflowEligibleMarker bool                    `json:"workflow_eligible_marker,omitempty"`
}

RemediationProjection is the flat, CEL- and jsonschema-facing view of a Remediation: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Remediation whose edge graph cannot be reflected

type ReviewProjection

type ReviewProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string                 `json:"id,omitempty"`
	Approved              bool                   `json:"approved,omitempty"`
	ApprovedAt            models.DateTime        `json:"approved_at,omitempty"`
	Category              string                 `json:"category,omitempty"`
	Classification        string                 `json:"classification,omitempty"`
	CreatedAt             time.Time              `json:"created_at,omitempty"`
	CreatedBy             string                 `json:"created_by,omitempty"`
	Details               string                 `json:"details,omitempty"`
	EnvironmentID         string                 `json:"environment_id,omitempty"`
	EnvironmentName       string                 `json:"environment_name,omitempty"`
	ExternalID            string                 `json:"external_id,omitempty"`
	ExternalOwnerID       string                 `json:"external_owner_id,omitempty"`
	ExternalURI           string                 `json:"external_uri,omitempty"`
	InternalNotes         string                 `json:"internal_notes,omitempty"`
	Metadata              map[string]interface{} `json:"metadata,omitempty"`
	OwnerID               string                 `json:"owner_id,omitempty"`
	RawPayload            map[string]interface{} `json:"raw_payload,omitempty"`
	ReportedAt            models.DateTime        `json:"reported_at,omitempty"`
	Reporter              string                 `json:"reporter,omitempty"`
	ReviewedAt            models.DateTime        `json:"reviewed_at,omitempty"`
	ReviewerID            string                 `json:"reviewer_id,omitempty"`
	ScopeID               string                 `json:"scope_id,omitempty"`
	ScopeName             string                 `json:"scope_name,omitempty"`
	Source                string                 `json:"source,omitempty"`
	State                 string                 `json:"state,omitempty"`
	Status                enums.ReviewStatus     `json:"status,omitempty"`
	Summary               string                 `json:"summary,omitempty"`
	SystemInternalID      string                 `json:"system_internal_id,omitempty"`
	SystemOwned           bool                   `json:"system_owned,omitempty"`
	Tags                  []string               `json:"tags,omitempty"`
	Title                 string                 `json:"title,omitempty"`
	UpdatedAt             time.Time              `json:"updated_at,omitempty"`
	UpdatedBy             string                 `json:"updated_by,omitempty"`
	UpdatedByImpersonator string                 `json:"updated_by_impersonator,omitempty"`
}

ReviewProjection is the flat, CEL- and jsonschema-facing view of a Review: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Review whose edge graph cannot be reflected

type RiskProjection

type RiskProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                     string               `json:"id,omitempty"`
	BusinessCosts          string               `json:"business_costs,omitempty"`
	BusinessCostsJSON      []interface{}        `json:"business_costs_json,omitempty"`
	CreatedAt              time.Time            `json:"created_at,omitempty"`
	CreatedBy              string               `json:"created_by,omitempty"`
	DelegateID             string               `json:"delegate_id,omitempty"`
	Details                string               `json:"details,omitempty"`
	DetailsJSON            []interface{}        `json:"details_json,omitempty"`
	DisplayID              string               `json:"display_id,omitempty"`
	DueDate                models.DateTime      `json:"due_date,omitempty"`
	EnvironmentID          string               `json:"environment_id,omitempty"`
	EnvironmentName        string               `json:"environment_name,omitempty"`
	ExternalID             string               `json:"external_id,omitempty"`
	ExternalUUID           string               `json:"external_uuid,omitempty"`
	Impact                 enums.RiskImpact     `json:"impact,omitempty"`
	IntegrationID          string               `json:"integration_id,omitempty"`
	LastReviewedAt         models.DateTime      `json:"last_reviewed_at,omitempty"`
	Likelihood             enums.RiskLikelihood `json:"likelihood,omitempty"`
	MitigatedAt            models.DateTime      `json:"mitigated_at,omitempty"`
	Mitigation             string               `json:"mitigation,omitempty"`
	MitigationJSON         []interface{}        `json:"mitigation_json,omitempty"`
	Name                   string               `json:"name,omitempty"`
	NextReviewDueAt        models.DateTime      `json:"next_review_due_at,omitempty"`
	ObservedAt             models.DateTime      `json:"observed_at,omitempty"`
	OwnerID                string               `json:"owner_id,omitempty"`
	ResidualScore          int                  `json:"residual_score,omitempty"`
	ReviewFrequency        enums.Frequency      `json:"review_frequency,omitempty"`
	ReviewRequired         bool                 `json:"review_required,omitempty"`
	RiskCategoryID         string               `json:"risk_category_id,omitempty"`
	RiskCategoryName       string               `json:"risk_category_name,omitempty"`
	RiskDecision           enums.RiskDecision   `json:"risk_decision,omitempty"`
	RiskKindID             string               `json:"risk_kind_id,omitempty"`
	RiskKindName           string               `json:"risk_kind_name,omitempty"`
	ScopeID                string               `json:"scope_id,omitempty"`
	ScopeName              string               `json:"scope_name,omitempty"`
	Score                  int                  `json:"score,omitempty"`
	StakeholderID          string               `json:"stakeholder_id,omitempty"`
	Status                 enums.RiskStatus     `json:"status,omitempty"`
	Tags                   []string             `json:"tags,omitempty"`
	UpdatedAt              time.Time            `json:"updated_at,omitempty"`
	UpdatedBy              string               `json:"updated_by,omitempty"`
	UpdatedByImpersonator  string               `json:"updated_by_impersonator,omitempty"`
	WorkflowEligibleMarker bool                 `json:"workflow_eligible_marker,omitempty"`
}

RiskProjection is the flat, CEL- and jsonschema-facing view of a Risk: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Risk whose edge graph cannot be reflected

type ScanProjection

type ScanProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                         string                 `json:"id,omitempty"`
	AssignedTo                 string                 `json:"assigned_to,omitempty"`
	AssignedToGroupID          string                 `json:"assigned_to_group_id,omitempty"`
	AssignedToUserID           string                 `json:"assigned_to_user_id,omitempty"`
	CreatedAt                  time.Time              `json:"created_at,omitempty"`
	CreatedBy                  string                 `json:"created_by,omitempty"`
	DiscoveredVulnerabilityIds []string               `json:"discovered_vulnerability_ids,omitempty"`
	EnvironmentID              string                 `json:"environment_id,omitempty"`
	EnvironmentName            string                 `json:"environment_name,omitempty"`
	GeneratedByPlatformID      string                 `json:"generated_by_platform_id,omitempty"`
	InternalNotes              string                 `json:"internal_notes,omitempty"`
	Metadata                   map[string]interface{} `json:"metadata,omitempty"`
	NextScanRunAt              models.DateTime        `json:"next_scan_run_at,omitempty"`
	OwnerID                    string                 `json:"owner_id,omitempty"`
	PerformedBy                string                 `json:"performed_by,omitempty"`
	PerformedByGroupID         string                 `json:"performed_by_group_id,omitempty"`
	PerformedByUserID          string                 `json:"performed_by_user_id,omitempty"`
	ReviewedBy                 string                 `json:"reviewed_by,omitempty"`
	ReviewedByGroupID          string                 `json:"reviewed_by_group_id,omitempty"`
	ReviewedByUserID           string                 `json:"reviewed_by_user_id,omitempty"`
	ScanDate                   models.DateTime        `json:"scan_date,omitempty"`
	ScanSchedule               models.Cron            `json:"scan_schedule,omitempty"`
	ScanType                   enums.ScanType         `json:"scan_type,omitempty"`
	ScopeID                    string                 `json:"scope_id,omitempty"`
	ScopeName                  string                 `json:"scope_name,omitempty"`
	Status                     enums.ScanStatus       `json:"status,omitempty"`
	SystemInternalID           string                 `json:"system_internal_id,omitempty"`
	SystemOwned                bool                   `json:"system_owned,omitempty"`
	Tags                       []string               `json:"tags,omitempty"`
	Target                     string                 `json:"target,omitempty"`
	UpdatedAt                  time.Time              `json:"updated_at,omitempty"`
	UpdatedBy                  string                 `json:"updated_by,omitempty"`
	UpdatedByImpersonator      string                 `json:"updated_by_impersonator,omitempty"`
}

ScanProjection is the flat, CEL- and jsonschema-facing view of a Scan: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Scan whose edge graph cannot be reflected

type Schema

type Schema struct {
	SchemaDescriptor
	// Create creates a new entity from a JSON input and returns the entity ID; emitted only for
	// integration-mapped schemas, whose ingest upsert is the sole caller
	Create func(ctx context.Context, client *generated.Client, input json.RawMessage) (string, error)
	// Update applies a typed update input to an entity by ID; emitted only for integration-mapped
	// and workflow-eligible schemas
	Update func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error
	// Query returns all entities of this schema within an organization as JSON; emitted only for
	// integration-mapped schemas and link-rule targets, whose target selection is the sole caller
	Query func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error)
	// QueryByKey returns entities of this schema within an organization whose given snake_case
	// field matches any of the provided values, pushing the predicate into the database; emitted
	// only for integration-mapped schemas and link-rule targets with match-key columns
	QueryByKey func(ctx context.Context, client *generated.Client, orgID string, field string, values []string) ([]json.RawMessage, error)
	// Load loads a single entity by ID and returns its JSON representation
	Load func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error)
	// LoadObject loads the native generated Ent object for consumers that require its interfaces;
	// emitted only for workflow-eligible schemas, whose workflow object loading is the sole caller
	LoadObject func(ctx context.Context, client *generated.Client, entityID string) (any, error)
	// Fields is the unified field catalog for this schema, consumed by the workflow builder and the
	// integration cross-link config; workflow-eligible and match-key views are filtered from it
	Fields []FieldDescriptor
	// Edges lists every edge to an entityops schema (and workflow group edges) for this schema
	Edges []EdgeDescriptor
	// TaskRules are schema-level (unconditional) suggested-task rules declared via entx.SchemaTaskRule
	TaskRules []TaskRuleDescriptor
	// ProjectionType is the reflect.Type of this schema's flat CEL/jsonschema projection struct
	// ({Name}Projection); the registerable native-type view of the entity used for typed expressions.
	// Projections are emitted only for integration-mapped, workflow-eligible, and link-target
	// schemas, the schemas typed expression evaluation can reach; nil otherwise
	ProjectionType reflect.Type
	// Ingest is present when this schema supports mapped integration ingestion
	Ingest *IngestCapability
	// ConsoleRoute is present only when the schema explicitly declares a console route
	ConsoleRoute *ConsoleRoute
	// MentionSpec is present only when the schema explicitly declares mention scanning
	MentionSpec *MentionSpec
	// ApprovalSpec is present only when the schema explicitly declares approval fields
	ApprovalSpec *ApprovalSpec
}

Schema is the runtime representation of a registered entity schema. It carries the schema identity and its operation closures. Load, Fields, and Edges are universal; the remaining closures are emitted only for schemas whose capabilities can reach them and are nil otherwise

func AllSchemas

func AllSchemas() []*Schema

AllSchemas returns a copy of all registered schemas

func LookupSchema

func LookupSchema(name string) (*Schema, bool)

LookupSchema resolves a schema by any known name variation (PascalCase, snake_case, camelCase, or lowercase). Returns the schema and whether a match was found.

func TaskRuleEligibleSchemas

func TaskRuleEligibleSchemas() []*Schema

TaskRuleEligibleSchemas returns every registered schema carrying at least one task rule

func WorkflowObjectFromRef

func WorkflowObjectFromRef(ref *generated.WorkflowObjectRef) (*Schema, string, error)

WorkflowObjectFromRef resolves an object-reference row through the canonical edge catalog.

func (*Schema) AllTaskRules

func (s *Schema) AllTaskRules() []FieldTaskRule

AllTaskRules returns every task rule registered on this schema, both schema-level and field-level, as a flat list pairing each rule with its source field

func (*Schema) ApplyWorkflowFields

func (s *Schema) ApplyWorkflowFields(ctx context.Context, client *generated.Client, objectID string, updates map[string]any) error

ApplyWorkflowFields validates and applies workflow updates through the schema's existing updater.

func (*Schema) CoerceValue

func (s *Schema) CoerceValue(name string, value any) (any, error)

CoerceValue coerces a raw document value into the Go shape of the named field per its catalog type. Unknown and custom field types pass through unchanged so JSON unmarshalling into the typed create input remains the final arbiter

func (*Schema) DisplayField

func (s *Schema) DisplayField() (FieldDescriptor, bool)

DisplayField returns the schema's display-name field; generation enforces at most one

func (*Schema) DisplayValue

func (s *Schema) DisplayValue(row json.RawMessage) string

DisplayValue returns the display-name value from a loaded row, or empty when the schema declares no display field or the row lacks a value

func (*Schema) EdgeByName

func (s *Schema) EdgeByName(name string) (EdgeDescriptor, bool)

EdgeByName returns the edge with the given name

func (*Schema) EmitIngest

func (s *Schema) EmitIngest(ctx context.Context, runtime *gala.Gala, headers gala.Headers, request IngestRequest) error

EmitIngest queues one durable schema-ingest command.

func (*Schema) EnrichWorkflowPayload

func (s *Schema) EnrichWorkflowPayload(ctx context.Context, client *generated.Client, objectID string, payload map[string]any) error

EnrichWorkflowPayload copies designated object fields into a webhook payload. Schemas without designated payload fields contribute only their object ID, preserving the existing contract.

func (*Schema) FieldByName

func (s *Schema) FieldByName(name string) (FieldDescriptor, bool)

FieldByName returns the field descriptor addressed by a caller-supplied field or input name.

func (*Schema) FilterWorkflowInstances

func (s *Schema) FilterWorkflowInstances(query *generated.WorkflowInstanceQuery, objectID string) (*generated.WorkflowInstanceQuery, error)

FilterWorkflowInstances restricts a workflow instance query to one object.

func (*Schema) FilterWorkflowObjectRefs

func (s *Schema) FilterWorkflowObjectRefs(query *generated.WorkflowObjectRefQuery, objectID string) (*generated.WorkflowObjectRefQuery, error)

FilterWorkflowObjectRefs restricts an object-reference query to one object.

func (*Schema) LoadWorkflowObject

func (s *Schema) LoadWorkflowObject(ctx context.Context, client *generated.Client, objectID string) (generated.Noder, error)

LoadWorkflowObject loads the native Ent node for a workflow-designated schema.

func (*Schema) LookupField

func (s *Schema) LookupField() (FieldDescriptor, bool)

LookupField returns the schema's single ingest upsert lookup field. It returns false when the schema declares no lookup key or more than one, since priority between multiple lookup keys is schema-specific and stays with hand-written persistence

func (*Schema) MatchKeyField

func (s *Schema) MatchKeyField(field string) bool

MatchKeyField reports whether field is a declared match-key column for this schema

func (*Schema) PersistIngest

func (s *Schema) PersistIngest(ctx context.Context, client *generated.Client, integration *generated.Integration, payload json.RawMessage) (string, error)

PersistIngest prepares and persists one mapped record synchronously through the schema's bound persistence, sharing the preparation the durable ingest consumer applies

func (*Schema) ResolveInputKey

func (s *Schema) ResolveInputKey(name string) (string, bool)

ResolveInputKey resolves a caller-supplied field name to this schema's canonical create-input key. It accepts the mapping input key, the snake_case field name, or case variants of either; annotation-declared input keys win over raw field names. The returned key matches the create input's snake_case json tags so mapped payloads unmarshal without re-keying

func (*Schema) SetWorkflowInstanceObjectID

func (s *Schema) SetWorkflowInstanceObjectID(builder *generated.WorkflowInstanceCreate, objectID string) error

SetWorkflowInstanceObjectID binds a workflow instance builder to an object using the canonical edge.

func (*Schema) SetWorkflowObjectRefObjectID

func (s *Schema) SetWorkflowObjectRefObjectID(builder *generated.WorkflowObjectRefCreate, objectID string) error

SetWorkflowObjectRefObjectID binds an object-reference builder using the canonical edge.

func (*Schema) SoftDeletes

func (s *Schema) SoftDeletes() bool

SoftDeletes reports whether this schema soft-deletes rows via the deleted_at column

func (*Schema) TaskRuleEligible

func (s *Schema) TaskRuleEligible() bool

TaskRuleEligible reports whether the schema has any field-level or schema-level task rules

func (*Schema) Upsert

func (s *Schema) Upsert(ctx context.Context, client *generated.Client, ownerID string, payload json.RawMessage) (string, error)

Upsert persists one create-input payload by the schema's lookup key: the payload's lookup value is matched against existing org-scoped records via the indexed key query, updating the single match or creating the record when none exists, and returns the entity id. Matching more than one record fails with ErrUpsertConflict rather than guessing. It composes the schema's catalog closures, so unlike Create/Update/QueryByKey it needs no per-schema wiring. Schemas whose lookup predicates are not a single org-scoped key column (integration-scoped lookups, multi-key priority) keep hand-written persistence instead

func (*Schema) WorkflowChangeSet

func (s *Schema) WorkflowChangeSet(changes ChangeSet) ChangeSet

WorkflowChangeSet filters the canonical mutation delta to workflow-designated fields and edges.

func (*Schema) WorkflowEdges

func (s *Schema) WorkflowEdges() []EdgeDescriptor

WorkflowEdges returns the workflow-eligible members of the schema's canonical edge catalog.

func (*Schema) WorkflowFields

func (s *Schema) WorkflowFields() []FieldDescriptor

WorkflowFields returns the workflow-eligible members of the schema's canonical field catalog.

func (*Schema) WorkflowOwnerID

func (s *Schema) WorkflowOwnerID(ctx context.Context, client *generated.Client, objectID string) (string, error)

WorkflowOwnerID returns the owner_id of a workflow object through the schema's existing loader.

type SchemaDescriptor

type SchemaDescriptor struct {
	// Name is the PascalCase canonical form
	Name string `json:"-"`
	// Snake is the snake_case form
	Snake string `json:"-"`
	// Lower is the lowercase no-separator form used for fuzzy lookup
	Lower string `json:"-"`
	// WorkflowEligible reports whether this schema participates in workflow operations
	WorkflowEligible bool `json:"-"`
}

SchemaDescriptor is the canonical identity for an entity schema

func (SchemaDescriptor) IsZero

func (d SchemaDescriptor) IsZero() bool

IsZero reports whether the descriptor is unset

func (SchemaDescriptor) Label

func (d SchemaDescriptor) Label() string

Label derives the human-readable schema label from the PascalCase name by inserting spaces at word boundaries, keeping acronym runs intact (TrustCenterNDARequest -> "Trust Center NDA Request")

func (SchemaDescriptor) MarshalJSON

func (d SchemaDescriptor) MarshalJSON() ([]byte, error)

MarshalJSON serializes the descriptor as its snake_case form

func (SchemaDescriptor) String

func (d SchemaDescriptor) String() string

String returns the PascalCase canonical name

func (*SchemaDescriptor) UnmarshalJSON

func (d *SchemaDescriptor) UnmarshalJSON(data []byte) error

UnmarshalJSON deserializes a descriptor from any known name variation. An empty string deserializes to the zero descriptor so optional/omitted descriptor fields round-trip cleanly

type SchemaRef

type SchemaRef struct {
	// Schema is the schema name
	Schema string
	// Operation is the operation being performed
	Operation string
	// EntityID is the entity identifier when available
	EntityID string
	// Edge is the edge name when available
	Edge string
}

SchemaRef carries schema and operation identity for structured log embedding

func (SchemaRef) MarshalZerologObject

func (r SchemaRef) MarshalZerologObject(e *zerolog.Event)

MarshalZerologObject implements zerolog.LogObjectMarshaler

type SubcontrolProjection

type SubcontrolProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                         string                            `json:"id,omitempty"`
	Aliases                    []string                          `json:"aliases,omitempty"`
	AssessmentMethods          []models.AssessmentMethod         `json:"assessment_methods,omitempty"`
	AssessmentObjectives       []models.AssessmentObjective      `json:"assessment_objectives,omitempty"`
	AuditorReferenceID         string                            `json:"auditor_reference_id,omitempty"`
	Category                   string                            `json:"category,omitempty"`
	CategoryID                 string                            `json:"category_id,omitempty"`
	ControlID                  string                            `json:"control_id,omitempty"`
	ControlOwnerID             string                            `json:"control_owner_id,omitempty"`
	ControlQuestions           []string                          `json:"control_questions,omitempty"`
	CreatedAt                  time.Time                         `json:"created_at,omitempty"`
	CreatedBy                  string                            `json:"created_by,omitempty"`
	DelegateID                 string                            `json:"delegate_id,omitempty"`
	Description                string                            `json:"description,omitempty"`
	DescriptionJSON            []interface{}                     `json:"description_json,omitempty"`
	DisplayID                  string                            `json:"display_id,omitempty"`
	EvidenceRequests           []models.EvidenceRequests         `json:"evidence_requests,omitempty"`
	ExampleEvidence            []models.ExampleEvidence          `json:"example_evidence,omitempty"`
	ExternalUUID               string                            `json:"external_uuid,omitempty"`
	ImplementationDescription  string                            `json:"implementation_description,omitempty"`
	ImplementationGuidance     []models.ImplementationGuidance   `json:"implementation_guidance,omitempty"`
	ImplementationStatus       enums.ControlImplementationStatus `json:"implementation_status,omitempty"`
	InternalNotes              string                            `json:"internal_notes,omitempty"`
	MappedCategories           []string                          `json:"mapped_categories,omitempty"`
	OwnerID                    string                            `json:"owner_id,omitempty"`
	PublicRepresentation       string                            `json:"public_representation,omitempty"`
	RefCode                    string                            `json:"ref_code,omitempty"`
	ReferenceFramework         string                            `json:"reference_framework,omitempty"`
	ReferenceFrameworkRevision string                            `json:"reference_framework_revision,omitempty"`
	ReferenceID                string                            `json:"reference_id,omitempty"`
	References                 []models.Reference                `json:"references,omitempty"`
	ResponsiblePartyID         string                            `json:"responsible_party_id,omitempty"`
	Source                     enums.ControlSource               `json:"source,omitempty"`
	SourceName                 string                            `json:"source_name,omitempty"`
	Status                     enums.ControlStatus               `json:"status,omitempty"`
	Subcategory                string                            `json:"subcategory,omitempty"`
	SubcontrolKindID           string                            `json:"subcontrol_kind_id,omitempty"`
	SubcontrolKindName         string                            `json:"subcontrol_kind_name,omitempty"`
	SystemInternalID           string                            `json:"system_internal_id,omitempty"`
	SystemOwned                bool                              `json:"system_owned,omitempty"`
	Tags                       []string                          `json:"tags,omitempty"`
	TestingProcedures          []models.TestingProcedures        `json:"testing_procedures,omitempty"`
	Title                      string                            `json:"title,omitempty"`
	UpdatedAt                  time.Time                         `json:"updated_at,omitempty"`
	UpdatedBy                  string                            `json:"updated_by,omitempty"`
	UpdatedByImpersonator      string                            `json:"updated_by_impersonator,omitempty"`
	WorkflowEligibleMarker     bool                              `json:"workflow_eligible_marker,omitempty"`
}

SubcontrolProjection is the flat, CEL- and jsonschema-facing view of a Subcontrol: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Subcontrol whose edge graph cannot be reflected

type SubprocessorProjection

type SubprocessorProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string    `json:"id,omitempty"`
	CreatedAt             time.Time `json:"created_at,omitempty"`
	CreatedBy             string    `json:"created_by,omitempty"`
	Description           string    `json:"description,omitempty"`
	InternalNotes         string    `json:"internal_notes,omitempty"`
	LogoFileID            string    `json:"logo_file_id,omitempty"`
	LogoRemoteURL         string    `json:"logo_remote_url,omitempty"`
	Name                  string    `json:"name,omitempty"`
	OwnerID               string    `json:"owner_id,omitempty"`
	SystemInternalID      string    `json:"system_internal_id,omitempty"`
	SystemOwned           bool      `json:"system_owned,omitempty"`
	Tags                  []string  `json:"tags,omitempty"`
	UpdatedAt             time.Time `json:"updated_at,omitempty"`
	UpdatedBy             string    `json:"updated_by,omitempty"`
	UpdatedByImpersonator string    `json:"updated_by_impersonator,omitempty"`
}

SubprocessorProjection is the flat, CEL- and jsonschema-facing view of a Subprocessor: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Subprocessor whose edge graph cannot be reflected

type SubscriberProjection

type SubscriberProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string    `json:"id,omitempty"`
	Active                bool      `json:"active,omitempty"`
	ContactID             string    `json:"contact_id,omitempty"`
	CreatedAt             time.Time `json:"created_at,omitempty"`
	CreatedBy             string    `json:"created_by,omitempty"`
	Email                 string    `json:"email,omitempty"`
	OwnerID               string    `json:"owner_id,omitempty"`
	PhoneNumber           string    `json:"phone_number,omitempty"`
	SendAttempts          int       `json:"send_attempts,omitempty"`
	Tags                  []string  `json:"tags,omitempty"`
	TrustCenterID         string    `json:"trust_center_id,omitempty"`
	Unsubscribed          bool      `json:"unsubscribed,omitempty"`
	UpdatedAt             time.Time `json:"updated_at,omitempty"`
	UpdatedBy             string    `json:"updated_by,omitempty"`
	UpdatedByImpersonator string    `json:"updated_by_impersonator,omitempty"`
	UserID                string    `json:"user_id,omitempty"`
	VerifiedEmail         bool      `json:"verified_email,omitempty"`
	VerifiedPhone         bool      `json:"verified_phone,omitempty"`
}

SubscriberProjection is the flat, CEL- and jsonschema-facing view of a Subscriber: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Subscriber whose edge graph cannot be reflected

type SystemDetailProjection

type SystemDetailProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string                       `json:"id,omitempty"`
	AuthorizationBoundary string                       `json:"authorization_boundary,omitempty"`
	CreatedAt             time.Time                    `json:"created_at,omitempty"`
	CreatedBy             string                       `json:"created_by,omitempty"`
	Description           string                       `json:"description,omitempty"`
	DisplayID             string                       `json:"display_id,omitempty"`
	LastReviewed          models.DateTime              `json:"last_reviewed,omitempty"`
	OscalMetadataJSON     map[string]interface{}       `json:"oscal_metadata_json,omitempty"`
	OwnerID               string                       `json:"owner_id,omitempty"`
	RevisionHistory       []interface{}                `json:"revision_history,omitempty"`
	SensitivityLevel      enums.SystemSensitivityLevel `json:"sensitivity_level,omitempty"`
	SystemName            string                       `json:"system_name,omitempty"`
	Tags                  []string                     `json:"tags,omitempty"`
	UpdatedAt             time.Time                    `json:"updated_at,omitempty"`
	UpdatedBy             string                       `json:"updated_by,omitempty"`
	UpdatedByImpersonator string                       `json:"updated_by_impersonator,omitempty"`
	Version               string                       `json:"version,omitempty"`
}

SystemDetailProjection is the flat, CEL- and jsonschema-facing view of a SystemDetail: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.SystemDetail whose edge graph cannot be reflected

type TargetSelector

type TargetSelector struct {
	// Schema is the target entity schema
	Schema SchemaDescriptor `json:"schema"`
	// SourceSchema is the schema of the source entity in SourceContext; when set, selectTargets binds
	// "source" as that schema's native projection type so source-aware expressions resolve typed fields
	SourceSchema SchemaDescriptor `json:"source_schema,omitempty"`
	// KeyMatch, when set, resolves candidates with an indexed key query before any Expression filtering
	KeyMatch *KeyMatch `json:"key_match,omitempty"`
	// Expression is a CEL expression evaluated against each candidate entity
	Expression string `json:"expression"`
	// ExcludeIDs is a list of entity IDs to exclude from the result set
	ExcludeIDs []string `json:"exclude_ids,omitempty"`
	// SourceContext is optional JSON data for the source entity, exposed as "source" in CEL expressions
	SourceContext json.RawMessage `json:"source_context,omitempty"`
}

TargetSelector specifies a set of entities to target via schema and expression

type TaskProjection

type TaskProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                     string                 `json:"id,omitempty"`
	AssigneeID             string                 `json:"assignee_id,omitempty"`
	AssignerID             string                 `json:"assigner_id,omitempty"`
	Completed              models.DateTime        `json:"completed,omitempty"`
	CreatedAt              time.Time              `json:"created_at,omitempty"`
	CreatedBy              string                 `json:"created_by,omitempty"`
	Details                string                 `json:"details,omitempty"`
	DetailsJSON            []interface{}          `json:"details_json,omitempty"`
	DisplayID              string                 `json:"display_id,omitempty"`
	Due                    models.DateTime        `json:"due,omitempty"`
	EnvironmentID          string                 `json:"environment_id,omitempty"`
	EnvironmentName        string                 `json:"environment_name,omitempty"`
	ExternalReferenceURL   []string               `json:"external_reference_url,omitempty"`
	ExternalUUID           string                 `json:"external_uuid,omitempty"`
	IdempotencyKey         string                 `json:"idempotency_key,omitempty"`
	IsSuggested            bool                   `json:"is_suggested,omitempty"`
	IsTemplate             bool                   `json:"is_template,omitempty"`
	Metadata               map[string]interface{} `json:"metadata,omitempty"`
	OwnerID                string                 `json:"owner_id,omitempty"`
	ParentTaskID           string                 `json:"parent_task_id,omitempty"`
	Priority               int                    `json:"priority,omitempty"`
	ScopeID                string                 `json:"scope_id,omitempty"`
	ScopeName              string                 `json:"scope_name,omitempty"`
	Source                 string                 `json:"source,omitempty"`
	SourceKey              string                 `json:"source_key,omitempty"`
	Status                 enums.TaskStatus       `json:"status,omitempty"`
	SystemGenerated        bool                   `json:"system_generated,omitempty"`
	Tags                   []string               `json:"tags,omitempty"`
	TaskKindID             string                 `json:"task_kind_id,omitempty"`
	TaskKindName           string                 `json:"task_kind_name,omitempty"`
	Title                  string                 `json:"title,omitempty"`
	UpdatedAt              time.Time              `json:"updated_at,omitempty"`
	UpdatedBy              string                 `json:"updated_by,omitempty"`
	UpdatedByImpersonator  string                 `json:"updated_by_impersonator,omitempty"`
	WorkflowEligibleMarker bool                   `json:"workflow_eligible_marker,omitempty"`
}

TaskProjection is the flat, CEL- and jsonschema-facing view of a Task: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Task whose edge graph cannot be reflected

type TaskRuleDescriptor

type TaskRuleDescriptor struct {
	// RuleID identifies which task template to render at rule evaluation time
	RuleID string `json:"ruleId"`
	// Expression is a CEL boolean expression evaluated with the owning field's decoded JSON value
	// bound as "value" (e.g. "value.policies.has_existing == true"); empty always fires. Ignored
	// when EachElement is set
	Expression string `json:"expression,omitempty"`
	// EachElement, when set, is a CEL expression resolving to a list within the field's value; the
	// rule expands to fire once per element instead of evaluating Expression as a single boolean
	EachElement string `json:"eachElement,omitempty"`
	// Trigger selects create-and-update (empty) or create-only evaluation; compare against
	// entx.TaskRuleOnCreateOnly / entx.TaskRuleOnCreateOrUpdate
	Trigger entx.TaskRuleTrigger `json:"trigger,omitempty"`
}

TaskRuleDescriptor describes one suggested-task trigger: a CEL condition plus the RuleID a runtime engine uses to look up the task's template content

type TypedIngestPersist

type TypedIngestPersist[T any] func(context.Context, *generated.Client, *generated.Integration, T) (string, error)

TypedIngestPersist is the typed persistence operation adapted by BindIngest.

type UserProjection

type UserProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string             `json:"id,omitempty"`
	AuthProvider          enums.AuthProvider `json:"auth_provider,omitempty"`
	AvatarLocalFileID     string             `json:"avatar_local_file_id,omitempty"`
	AvatarRemoteURL       string             `json:"avatar_remote_url,omitempty"`
	AvatarUpdatedAt       time.Time          `json:"avatar_updated_at,omitempty"`
	CreatedAt             time.Time          `json:"created_at,omitempty"`
	CreatedBy             string             `json:"created_by,omitempty"`
	DisplayID             string             `json:"display_id,omitempty"`
	DisplayName           string             `json:"display_name,omitempty"`
	Email                 string             `json:"email,omitempty"`
	FirstName             string             `json:"first_name,omitempty"`
	LastLoginProvider     enums.AuthProvider `json:"last_login_provider,omitempty"`
	LastName              string             `json:"last_name,omitempty"`
	LastSeen              time.Time          `json:"last_seen,omitempty"`
	Role                  enums.Role         `json:"role,omitempty"`
	ScimActive            bool               `json:"scim_active,omitempty"`
	ScimExternalID        string             `json:"scim_external_id,omitempty"`
	ScimLocale            string             `json:"scim_locale,omitempty"`
	ScimPreferredLanguage string             `json:"scim_preferred_language,omitempty"`
	ScimUsername          string             `json:"scim_username,omitempty"`
	Sub                   string             `json:"sub,omitempty"`
	Tags                  []string           `json:"tags,omitempty"`
	UpdatedAt             time.Time          `json:"updated_at,omitempty"`
	UpdatedBy             string             `json:"updated_by,omitempty"`
}

UserProjection is the flat, CEL- and jsonschema-facing view of a User: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.User whose edge graph cannot be reflected

type VendorRiskScoreProjection

type VendorRiskScoreProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string                        `json:"id,omitempty"`
	Answer                string                        `json:"answer,omitempty"`
	AnswerType            enums.VendorScoringAnswerType `json:"answer_type,omitempty"`
	AssessmentResponseID  string                        `json:"assessment_response_id,omitempty"`
	CreatedAt             time.Time                     `json:"created_at,omitempty"`
	CreatedBy             string                        `json:"created_by,omitempty"`
	EntityID              string                        `json:"entity_id,omitempty"`
	Impact                enums.VendorRiskImpact        `json:"impact,omitempty"`
	Likelihood            enums.VendorRiskLikelihood    `json:"likelihood,omitempty"`
	Notes                 string                        `json:"notes,omitempty"`
	OwnerID               string                        `json:"owner_id,omitempty"`
	QuestionCategory      enums.VendorScoringCategory   `json:"question_category,omitempty"`
	QuestionDescription   string                        `json:"question_description,omitempty"`
	QuestionKey           string                        `json:"question_key,omitempty"`
	QuestionName          string                        `json:"question_name,omitempty"`
	Score                 float64                       `json:"score,omitempty"`
	Tags                  []string                      `json:"tags,omitempty"`
	UpdatedAt             time.Time                     `json:"updated_at,omitempty"`
	UpdatedBy             string                        `json:"updated_by,omitempty"`
	UpdatedByImpersonator string                        `json:"updated_by_impersonator,omitempty"`
	VendorScoringConfigID string                        `json:"vendor_scoring_config_id,omitempty"`
}

VendorRiskScoreProjection is the flat, CEL- and jsonschema-facing view of a VendorRiskScore: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.VendorRiskScore whose edge graph cannot be reflected

type VulnerabilityProjection

type VulnerabilityProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                      string                 `json:"id,omitempty"`
	AssignedTo              string                 `json:"assigned_to,omitempty"`
	AssignedToGroupID       string                 `json:"assigned_to_group_id,omitempty"`
	AssignedToUserID        string                 `json:"assigned_to_user_id,omitempty"`
	AutoDismissedAt         models.DateTime        `json:"auto_dismissed_at,omitempty"`
	Blocking                bool                   `json:"blocking,omitempty"`
	Category                string                 `json:"category,omitempty"`
	CreatedAt               time.Time              `json:"created_at,omitempty"`
	CreatedBy               string                 `json:"created_by,omitempty"`
	CveID                   string                 `json:"cve_id,omitempty"`
	CweIds                  []string               `json:"cwe_ids,omitempty"`
	DependencyScope         string                 `json:"dependency_scope,omitempty"`
	Description             string                 `json:"description,omitempty"`
	DiscoveredAt            models.DateTime        `json:"discovered_at,omitempty"`
	DismissedAt             models.DateTime        `json:"dismissed_at,omitempty"`
	DismissedComment        string                 `json:"dismissed_comment,omitempty"`
	DismissedReason         string                 `json:"dismissed_reason,omitempty"`
	DisplayID               string                 `json:"display_id,omitempty"`
	DisplayName             string                 `json:"display_name,omitempty"`
	EnvironmentID           string                 `json:"environment_id,omitempty"`
	EnvironmentName         string                 `json:"environment_name,omitempty"`
	Exploitability          float64                `json:"exploitability,omitempty"`
	ExternalID              string                 `json:"external_id,omitempty"`
	ExternalOwnerID         string                 `json:"external_owner_id,omitempty"`
	ExternalURI             string                 `json:"external_uri,omitempty"`
	FirstPatchedVersion     string                 `json:"first_patched_version,omitempty"`
	FixAvailable            bool                   `json:"fix_available,omitempty"`
	FixedAt                 models.DateTime        `json:"fixed_at,omitempty"`
	Impact                  float64                `json:"impact,omitempty"`
	Impacts                 []string               `json:"impacts,omitempty"`
	InternalNotes           string                 `json:"internal_notes,omitempty"`
	ManifestPath            string                 `json:"manifest_path,omitempty"`
	Metadata                map[string]interface{} `json:"metadata,omitempty"`
	Open                    bool                   `json:"open,omitempty"`
	OwnerID                 string                 `json:"owner_id,omitempty"`
	PackageEcosystem        string                 `json:"package_ecosystem,omitempty"`
	PackageName             string                 `json:"package_name,omitempty"`
	Priority                string                 `json:"priority,omitempty"`
	Production              bool                   `json:"production,omitempty"`
	Public                  bool                   `json:"public,omitempty"`
	PublishedAt             models.DateTime        `json:"published_at,omitempty"`
	RawPayload              map[string]interface{} `json:"raw_payload,omitempty"`
	References              []string               `json:"references,omitempty"`
	RemediationSLA          int                    `json:"remediation_sla,omitempty"`
	ReviewedBy              string                 `json:"reviewed_by,omitempty"`
	ReviewedByGroupID       string                 `json:"reviewed_by_group_id,omitempty"`
	ReviewedByUserID        string                 `json:"reviewed_by_user_id,omitempty"`
	ScopeID                 string                 `json:"scope_id,omitempty"`
	ScopeName               string                 `json:"scope_name,omitempty"`
	Score                   float64                `json:"score,omitempty"`
	SecurityLevel           enums.SecurityLevel    `json:"security_level,omitempty"`
	Severity                string                 `json:"severity,omitempty"`
	Source                  string                 `json:"source,omitempty"`
	SourceUpdatedAt         models.DateTime        `json:"source_updated_at,omitempty"`
	Summary                 string                 `json:"summary,omitempty"`
	SystemInternalID        string                 `json:"system_internal_id,omitempty"`
	SystemOwned             bool                   `json:"system_owned,omitempty"`
	Tags                    []string               `json:"tags,omitempty"`
	UpdatedAt               time.Time              `json:"updated_at,omitempty"`
	UpdatedBy               string                 `json:"updated_by,omitempty"`
	UpdatedByImpersonator   string                 `json:"updated_by_impersonator,omitempty"`
	Validated               bool                   `json:"validated,omitempty"`
	Vector                  string                 `json:"vector,omitempty"`
	VulnerabilityStatusID   string                 `json:"vulnerability_status_id,omitempty"`
	VulnerabilityStatusName string                 `json:"vulnerability_status_name,omitempty"`
	VulnerableVersionRange  string                 `json:"vulnerable_version_range,omitempty"`
	WorkflowEligibleMarker  bool                   `json:"workflow_eligible_marker,omitempty"`
}

VulnerabilityProjection is the flat, CEL- and jsonschema-facing view of a Vulnerability: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Vulnerability whose edge graph cannot be reflected

type WorkflowObjectRefProjection

type WorkflowObjectRefProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string    `json:"id,omitempty"`
	ActionPlanID          string    `json:"action_plan_id,omitempty"`
	AssessmentID          string    `json:"assessment_id,omitempty"`
	AssessmentResponseID  string    `json:"assessment_response_id,omitempty"`
	CampaignID            string    `json:"campaign_id,omitempty"`
	CampaignTargetID      string    `json:"campaign_target_id,omitempty"`
	ControlID             string    `json:"control_id,omitempty"`
	CreatedAt             time.Time `json:"created_at,omitempty"`
	CreatedBy             string    `json:"created_by,omitempty"`
	DirectoryAccountID    string    `json:"directory_account_id,omitempty"`
	DirectoryGroupID      string    `json:"directory_group_id,omitempty"`
	DirectoryMembershipID string    `json:"directory_membership_id,omitempty"`
	DisplayID             string    `json:"display_id,omitempty"`
	EvidenceID            string    `json:"evidence_id,omitempty"`
	FindingID             string    `json:"finding_id,omitempty"`
	IdentityHolderID      string    `json:"identity_holder_id,omitempty"`
	InternalPolicyID      string    `json:"internal_policy_id,omitempty"`
	OwnerID               string    `json:"owner_id,omitempty"`
	PlatformID            string    `json:"platform_id,omitempty"`
	ProcedureID           string    `json:"procedure_id,omitempty"`
	RemediationID         string    `json:"remediation_id,omitempty"`
	RiskID                string    `json:"risk_id,omitempty"`
	SubcontrolID          string    `json:"subcontrol_id,omitempty"`
	TaskID                string    `json:"task_id,omitempty"`
	UpdatedAt             time.Time `json:"updated_at,omitempty"`
	UpdatedBy             string    `json:"updated_by,omitempty"`
	UpdatedByImpersonator string    `json:"updated_by_impersonator,omitempty"`
	VulnerabilityID       string    `json:"vulnerability_id,omitempty"`
	WorkflowInstanceID    string    `json:"workflow_instance_id,omitempty"`
}

WorkflowObjectRefProjection is the flat, CEL- and jsonschema-facing view of a WorkflowObjectRef: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.WorkflowObjectRef whose edge graph cannot be reflected

Jump to

Keyboard shortcuts

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