// Package seedrows holds the stdlib-only data shapes for the action/permission
// seed-row family: the runtime row projections consumed by the standard-action
// dispatcher, the authored *Def shapes the bootstrap seeder parses, and the
// pure permission-catalog parser. These carry no backend dependency, so they
// live in the contract module where pack tooling and runtime can both import
// them without dragging in shared/kernel.
package seedrows

// ActionSchemaRow is the subset of _System_ActionSchema consumed by the
// generic standard-action dispatcher at request time.
type ActionSchemaRow struct {
	Direction                 string
	APIName                   string
	DataType                  string
	ReferenceTo               string
	Label                     string
	UISection                 string
	UIMode                    string
	TargetObject              string
	TargetFieldAPIName        string
	PrefillSourceFieldAPIName string
	RequiredPicklistTag       string
	MappingSourceObject       string
	MappingActionType         string
	IsCollection              bool
	IsRequired                bool
	SortOrder                 int
}

// ActionFieldDefaultRow is the subset of _System_ActionFieldDefault the
// standard-action dispatcher consumes at request time. The Condition and
// ValueFormula strings are fed to the shared formula engine.
type ActionFieldDefaultRow struct {
	TargetObject string
	FieldAPIName string
	ValueFormula string
	Condition    string
	Priority     int
}

// ActionInputGuardRow is the subset of _System_ActionInputGuard consumed by
// the generic standard-action dispatcher at request time. Kept shallow so
// the dispatcher does not depend on the full bootstrap write path.
type ActionInputGuardRow struct {
	Condition          string
	RequiredPermission string
	RequiredObject     string
	RequiredOperation  string
	ErrorMessage       string
	// GatedInput names the action-input APIName this guard conditions.
	// Empty = guard applies to the whole action, not a specific input.
	// Populated so GET /actions/standard can tell the frontend which input
	// UI element to hide per caller.
	GatedInput string
	SortOrder  int
}

// StandardActionInternalAccessScopeRow is the runtime projection consumed by
// the dispatcher before it invokes a standard action flow. Pure stdlib fields,
// so it lives in the contract module alongside the other action seed-row
// projections; the bootstrap package keeps an alias for existing importers.
type StandardActionInternalAccessScopeRow struct {
	StandardActionID string
	ObjectAPIName    string
	Operation        string
	Reason           string
}
