Documentation
¶
Overview ¶
Package resourceloaders holds the gRPC-backed loaders used by the api-gateway resourcekit include resolver. Each loader is a plain function that takes a slice of IDs and returns a map[id]*apiresource (typed as any to fit resourcekit's signature). Loaders build clean apiresource values and stash any FK metadata the SubField closures will need into the request-scoped resourcekit.LoadMeta side-table.
The core client is set once at process startup via SetCoreClient — the loaders cannot be invoked before that.
Index ¶
- Constants
- func APIKeyFromProto(ctx context.Context, k *authpb.APIKeyInfo) *apiresource.APIKey
- func AccountGroupProductLineAccessFromProto(item *pb.AccountGroupProductLineAccessInfo) *apiresource.AccountGroupProductLineAccess
- func AccountIntegrationFromProto(ai *pb.AccountIntegrationInfo) *apiresource.AccountIntegration
- func ActorRefFromID(actorID string) *apiresource.Actor
- func AgentDefinitionExists(ctx context.Context, id string) (bool, *apierror.APIError)
- func AgentMemoryFromProto(m *agentpb.AgentMemoryInfo) *apiresource.AgentMemory
- func AttributeFromProto(a *pb.AttributeInfo) *apiresource.Attribute
- func ChildAccountFromProto(ca *pb.ChildAccountProto) *apiresource.ChildAccount
- func CustomerProductLineAccessFromProto(item *pb.CustomerProductLineAccessInfo) *apiresource.CustomerProductLineAccess
- func DemandOverrideFromProto(o *pb.DemandOverrideInfo) *apiresource.DemandOverride
- func HydrateActorNames(ctx context.Context, actors []*apiresource.Actor)
- func HydrateCustomerEntities(ctx context.Context, entities []*apiresource.Entity)
- func HydrateIdentityActorNames(ctx context.Context, actors []*apiresource.Actor)
- func HydrateMessagingGroups(ctx context.Context, groups []*apiresource.MessagingGroup)
- func LoadAPIKeys(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadAccountGroupProductLineAccess(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadAccountGroups(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadAccountIntegrations(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadAccountPrices(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadAccountStatuses(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadAccountUsageResponses(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadAccountUserNames(ctx context.Context, ids []string) (map[string]AccountUserName, *apierror.APIError)
- func LoadAccountUsers(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadAccounts(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadActors(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadAddressDetailsResults(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadAddressSuggestions(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadAddresses(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadAdjustmentTypes(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadAgentDefinitionNames(ctx context.Context, ids []string) (map[string]AgentDefinitionName, *apierror.APIError)
- func LoadAgentDefinitions(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadAgentMemories(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadAgentRuns(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadAllocationEntries(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadAnnouncements(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadAttributes(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadAuditEvents(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadAvailableTools(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadBillingPortalSessions(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadCarriers(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadCatalogCategories(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadCatalogProductLines(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadChildAccounts(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadConsumptions(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadContactMatches(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadConversationLinks(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadConversations(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadCreatedBySalesOrders(ctx context.Context, orderIDs []string) (map[string]any, *apierror.APIError)
- func LoadCustomerPricingFindings(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadCustomerProductLineAccess(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadCustomers(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadDCLocations(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadDeliveries(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadDemandOverrides(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadDepartments(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadEDIRuns(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadEmailDomains(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadEmailInboxes(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadEmailLogs(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadEnsureBillingCustomerResponses(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadEnterpriseInquiries(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadInventoryChangeLogs(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadInventoryItems(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadInvoices(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadItemCategories(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadItemInventories(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadItems(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadJobs(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadLocations(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadMachineDowntimeEvents(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadMachines(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadMaterials(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadMessageAttachments(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadMessageReports(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadMessages(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadMessagingBlocks(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadNotifications(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadOpenCreditEntries(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadOrderDiscounts(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadParts(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadPaymentTerms(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadPermissionGroups(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadPickLines(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadPicks(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadPlanChangeProrations(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadPortalDomains(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadPricingPlans(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadPriorities(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadProductLines(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadProductTypes(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadProductionFlows(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadProductionRuns(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadProductionSteps(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadProductions(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadProducts(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadProperties(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadPublicAccounts(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadPurchaseOrders(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadQuantities(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadRates(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadRealizedMarginFindings(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadReceivableEntries(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadReceivingOrderLines(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadReceivingOrders(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadRegistrationFlows(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadRequestLogs(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadRoles(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadSalesOrderStatuses(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadSalesOrders(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadSalesTargets(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadSandboxes(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadScanningStations(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadServiceLevels(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadSettlementSummaries(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadSettlements(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadShipmentLines(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadShipments(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadShippingCases(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadShippingTerms(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadSpendingCapResponses(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadSupplierMaterials(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadSuppliers(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadSwitchPlanResponses(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadSysProperties(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadTenancies(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadTerritories(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadToolGroups(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadTransactionAllocations(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadTransactions(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadUnitGroupUnits(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadUnitGroups(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadUnits(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadUsers(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
- func LoadValidatedAddresses(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func LoadVolumeDiscounts(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
- func MachineDowntimeEventFromProto(e *pb.MachineDowntimeEventInfo) *apiresource.MachineDowntimeEvent
- func MachineFromProto(m *pb.MachineInfo) *apiresource.Machine
- func MaterialFromProto(m *pb.MaterialInfo) *apiresource.Material
- func OrderDiscountFromProto(d *pb.OrderDiscountInfo) *apiresource.OrderDiscount
- func PartFromProto(p *pb.PartInfo) *apiresource.Part
- func ProductFromProto(p *pb.ProductFullInfo) *apiresource.Product
- func PropertyFromProto(p *pb.PropertyInfo) *apiresource.Property
- func ScanningStationFromLightProto(ss *pb.LightScanningStationInfo) *apiresource.ScanningStation
- func ScanningStationFromProto(ss *pb.ScanningStationInfo) *apiresource.ScanningStation
- func SetAgentClient(c agentpb.AgentServiceClient)
- func SetAuditClient(c platformpb.AuditServiceClient)
- func SetAuthClient(c authpb.AuthServiceClient)
- func SetChatClient(c notifpb.ChatServiceClient)
- func SetCoreClient(c pb.CoreServiceClient)
- func SetCorePickingClient(c pb.CorePickingServiceClient)
- func SetCoreProductionRunClient(c pb.CoreProductionRunServiceClient)
- func SetCorePurchaseClient(c pb.CorePurchaseServiceClient)
- func SetCoreReceivingClient(c pb.CoreReceivingServiceClient)
- func SetCoreSalesClient(c pb.CoreSalesServiceClient)
- func SetCoreShippingClient(c pb.CoreShippingServiceClient)
- func SetDemandOverrideClient(c pb.CoreDemandOverrideServiceClient)
- func SetEmailBridgeClient(c notifpb.EmailBridgeServiceClient)
- func SetFulfillmentClient(c pb.CoreFulfillmentServiceClient)
- func SetLoggingClient(c platformpb.LoggingServiceClient)
- func SetMachineDowntimeClient(c pb.CoreMachineDowntimeServiceClient)
- func SetPortalDomainClient(c pb.CorePortalDomainServiceClient)
- func StashMaterialMeta(ctx context.Context, m *pb.MaterialInfo)
- func StashPartMeta(ctx context.Context, p *pb.PartInfo)
- func StashProductMeta(ctx context.Context, p *pb.ProductFullInfo)
- type AccountUserName
- type AgentDefinitionName
Constants ¶
const CarrierServiceLevelsLimit = 10
CarrierServiceLevelsLimit caps the size of the service_levels list returned inline on a Carrier. Clients that need more must page through GET /v1/operations/carriers/{id}/service-levels.
Variables ¶
This section is empty.
Functions ¶
func APIKeyFromProto ¶
func APIKeyFromProto(ctx context.Context, k *authpb.APIKeyInfo) *apiresource.APIKey
APIKeyFromProto builds the APIKey resource from the proto and stashes the role FK in LoadMeta so ?include=role resolves. List presenters use this directly so the response comes from the list RPC's single snapshot instead of a second batch read that can observe concurrent mutations.
func AccountGroupProductLineAccessFromProto ¶
func AccountGroupProductLineAccessFromProto(item *pb.AccountGroupProductLineAccessInfo) *apiresource.AccountGroupProductLineAccess
AccountGroupProductLineAccessFromProto maps the gRPC proto to the apiresource. Exported so endpoint service methods that already hold a proto response (Create/Update return the resource directly) can reuse it.
func AccountIntegrationFromProto ¶
func AccountIntegrationFromProto(ai *pb.AccountIntegrationInfo) *apiresource.AccountIntegration
AccountIntegrationFromProto maps the gRPC AccountIntegrationInfo to the apiresource shape. Exported so endpoint service methods that already hold a proto response (e.g. Delete, which can't fan back through LoadXs) can reuse it directly.
func ActorRefFromID ¶
func ActorRefFromID(actorID string) *apiresource.Actor
ActorRefFromID builds a minimal Actor reference from a bare identity-actor id by recognizing its prefix: us_/acus_ → user, apke_/apky_ → api_key, agdf_ → agent. Columns like machine downtime's reported_by_id store identity.Actor.ID with no actor type alongside, so the type must be recovered from the id itself. User actors can carry either a user id (us_, written by user-token identities) or an account_user id (acus_, written by legacy dashboard rows). Returns nil for an empty or unrecognized id rather than fabricating an actor of unknown type.
func AgentDefinitionExists ¶ added in v1.1.7
AgentDefinitionExists reports whether an agent definition id resolves through AgentService, for callers that need to validate a caller-supplied reference before storing it. A missing agent is (false, nil); any other failure is returned so an AgentService outage surfaces as itself rather than as a rejected request.
func AgentMemoryFromProto ¶
func AgentMemoryFromProto(m *agentpb.AgentMemoryInfo) *apiresource.AgentMemory
AgentMemoryFromProto maps the gRPC AgentMemoryInfo to the apiresource shape. Exported so endpoint service methods that already hold a proto response (e.g. Create/Update returning the resource directly) can reuse it.
func AttributeFromProto ¶
func AttributeFromProto(a *pb.AttributeInfo) *apiresource.Attribute
func ChildAccountFromProto ¶
func ChildAccountFromProto(ca *pb.ChildAccountProto) *apiresource.ChildAccount
ChildAccountFromProto maps the gRPC ChildAccountProto to the apiresource shape. Exported so endpoint service methods that already hold a proto response (Add returns the resource directly) can reuse it.
func CustomerProductLineAccessFromProto ¶
func CustomerProductLineAccessFromProto(item *pb.CustomerProductLineAccessInfo) *apiresource.CustomerProductLineAccess
CustomerProductLineAccessFromProto maps the gRPC proto to the apiresource. Exported for use by mutation handlers that already hold a proto response. NOTE: preserves the legacy presenter's quirk of setting Customer.Object to ObjectTypeAccount rather than ObjectTypeCustomer (the apiresource.Customer type is account-shaped in the existing schema).
func DemandOverrideFromProto ¶
func DemandOverrideFromProto(o *pb.DemandOverrideInfo) *apiresource.DemandOverride
func HydrateActorNames ¶
func HydrateActorNames(ctx context.Context, actors []*apiresource.Actor)
HydrateActorNames fills display name + handle (+ avatar for users) on the given actors by batch-resolving their backing ids: user actors via core-service, agent actors via agent-service. Group/system personas already carry their display name, so they are left untouched. Best-effort: on failure the actors keep whatever names they already had. Safe to pass nils and duplicates.
func HydrateCustomerEntities ¶
func HydrateCustomerEntities(ctx context.Context, entities []*apiresource.Entity)
HydrateCustomerEntities fills in the display Name (customer name) and Handle (customer number) on entity references that point to a customer, which the bare entity_type/entity_id pair cannot supply. The entities are mutated in place via one batched BatchGetCustomersByIDs call. Best-effort: nil entries, non-customer entities, unresolved/deleted ids, or a failed customer fetch leave the entity as a plain id/type reference.
func HydrateIdentityActorNames ¶
func HydrateIdentityActorNames(ctx context.Context, actors []*apiresource.Actor)
HydrateIdentityActorNames fills display name + handle (+ avatar for users) on actors built from bare identity-actor ids (ActorRefFromID). User actors carry either a user id (us_, resolved via the user loader) or an account_user id (acus_, resolved via the account-user loader); api_key actors resolve via the api-key loader and agent actors via agent-service. Best-effort: on failure the actors keep whatever names they already had. Safe to pass nils and duplicates.
func HydrateMessagingGroups ¶
func HydrateMessagingGroups(ctx context.Context, groups []*apiresource.MessagingGroup)
HydrateMessagingGroups fills the roster's identity (Name + timestamps) on messaging-group references that the chat service stashes by id only. The groups are mutated in place. Members are deliberately left nil: the conversation's group is provenance only (members were snapshotted at creation and are not driven by the roster thereafter), so exposing the roster's current members here would mislead.
The notification-service exposes no batch get for rosters, so this resolves each distinct id via a GetMessagingGroup call. Best-effort: nil entries, duplicates, and unresolved/deleted ids leave the reference as a bare id+object stub.
func LoadAPIKeys ¶
func LoadAccountGroupProductLineAccess ¶
func LoadAccountGroupProductLineAccess(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
LoadAccountGroupProductLineAccess fetches access records by account_group_id via BatchGetAccountGroupProductLineAccessByIDs. The inline AccountGroup shell + ProductLines list are built from denormalized proto fields — no expandable sub-resources.
func LoadAccountGroups ¶
LoadAccountGroups fetches account groups by ID via BatchGetAccountGroupsByIDs. AccountGroup exposes no expandable sub-resources (not even an Owner) so no LoadMeta needs to be stashed.
func LoadAccountIntegrations ¶
func LoadAccountIntegrations(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
LoadAccountIntegrations fetches account integrations by ID via BatchGetAccountIntegrationsByIDs. Pure leaf — no expandable sub-resources.
func LoadAccountPrices ¶
func LoadAccountStatuses ¶
LoadAccountStatuses fetches account statuses by ID via BatchGetAccountStatusesByIDs. System-only resource — no LoadMeta needed.
func LoadAccountUserNames ¶
func LoadAccountUserNames(ctx context.Context, ids []string) (map[string]AccountUserName, *apierror.APIError)
LoadAccountUserNames batch-resolves account_user ids to their display name + email, for hydrating polymorphic actors (e.g. conversation participants) that only carry ids.
func LoadAccountUsers ¶
func LoadAccounts ¶
LoadAccounts fetches accounts by ID via BatchGetAccountsByIDs. Builds clean *apiresource.Account values. No FK metadata is currently stashed — Account sub-resources (Branding, Portal, default addresses) aren't part of the carrier pilot.
func LoadActors ¶
func LoadAddressSuggestions ¶
func LoadAddresses ¶
LoadAddresses fetches addresses by ID via BatchGetAddressesByIDs. Geolocation is an inline sub-record (always present, not expandable) so it's populated directly from the proto response. Address exposes no expandable sub-resources so no LoadMeta is needed.
func LoadAdjustmentTypes ¶
func LoadAgentDefinitionNames ¶
func LoadAgentDefinitionNames(ctx context.Context, ids []string) (map[string]AgentDefinitionName, *apierror.APIError)
LoadAgentDefinitionNames resolves agent definition ids (agdf_) to their display name + slug via AgentService. There is no batch RPC, so it fetches each unique id with GetAgentDefinition (the set is small — agents per conversation are few). Best-effort: an unresolved id is omitted rather than failing the request.
func LoadAgentDefinitions ¶
LoadAgentDefinitions fetches agent definitions by ID and builds base AgentDefinition references for expansion as a sub-resource (e.g. an email inbox's ?include=agent_config). Only the inline definition fields are populated; the definition's own expandable sub-objects (config, tools, role) are not stashed here, so deeper includes through this path resolve to null. AgentService exposes no batch get, so definitions are fetched one at a time; in practice each parent carries a single agent id and the resolver dedups across roots before calling this loader.
func LoadAgentMemories ¶
LoadAgentMemories fetches agent memories by ID via BatchGetAgentMemoriesByIDs (AgentService). Entity is materialized inline from the proto entity_type/entity_id pair — no expandable sub-resources.
func LoadAgentRuns ¶
LoadAgentRuns fetches agent runs by ID and builds base AgentRun references for expansion as a sub-resource (e.g. a chat message's ?include=agent_run). Only the inline run fields are populated; the run's own expandable sub-objects (triggered_by, actions, definition, steps) are not stashed here, so deeper includes through this path resolve to null. The agent service exposes no batch get, so runs are fetched one at a time; in practice each parent carries at most one run id and the resolver dedups across roots before calling this loader.
func LoadAllocationEntries ¶
func LoadAnnouncements ¶
LoadAnnouncements is the never-invoked loader for the announcement resource.
func LoadAttributes ¶
func LoadAuditEvents ¶
func LoadAvailableTools ¶
func LoadCarriers ¶
LoadCarriers fetches carriers by ID via BatchGetCarriersByIDs. Each loaded carrier is mapped to a clean *apiresource.Carrier with no FK fields. FK info (owner account_id, service_level_ids preview, has_more flag) is stashed in the request-scoped LoadMeta side-table for SubField closures to read back.
func LoadCatalogCategories ¶
func LoadCatalogProductLines ¶
func LoadChildAccounts ¶
LoadChildAccounts fetches child account relations by relation_id via BatchGetChildAccountsByIDs. The inline Account is built directly from the proto's denormalized account fields — no expandable sub-resources.
func LoadConsumptions ¶
func LoadContactMatches ¶
LoadContactMatches satisfies the resourcekit Definition's required loader for the contact_match resource. Contact matches are only ever produced as the top-level result of the find-by-email endpoint — they are never referenced by ID as a sub-resource — so this loader is never invoked and returns an empty result.
func LoadConversationLinks ¶
LoadConversationLinks is the never-invoked loader for the conversation_link resource. Links are only ever produced as the roots of the conversation-links endpoints, never fetched by id as an include target, so this loader is never invoked.
func LoadConversations ¶
LoadConversations fetches conversations by ID via BatchGetConversations (access-gated server-side) and builds base Conversation references, stashing their expandable sub-objects (participants, topic, last_message) so deeper includes on an expanded conversation resolve. Display-name hydration is best-effort and only applied at the top level by the conversations endpoint.
func LoadCreatedBySalesOrders ¶
func LoadCreatedBySalesOrders(ctx context.Context, orderIDs []string) (map[string]any, *apierror.APIError)
LoadCreatedBySalesOrders resolves the creator of each sales order from its `create` audit event (via platform-service), returning one CreatedBy per order id. Orders with no create event (e.g. system/EDI-created) resolve to a system CreatedBy with no actor, so the field is always present once included.
func LoadCustomerPricingFindings ¶
func LoadCustomerPricingFindings(_ context.Context, _ []string) (map[string]any, *apierror.APIError)
LoadCustomerPricingFindings exists only so the finding can register its expandable sub-resources. A finding is computed per request and has no row to fetch, so it is never loaded as anyone's child.
func LoadCustomerProductLineAccess ¶
func LoadCustomerProductLineAccess(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)
LoadCustomerProductLineAccess fetches access records by customer_id via BatchGetCustomerProductLineAccessByIDs. Inline Customer shell and inline ProductLines list — no expandable sub-resources.
func LoadCustomers ¶
LoadCustomers fetches customers by ID via BatchGetCustomersByIDs and builds expandable Customer references with real header data. Nested sub-resources (addresses, defaults, …) are their own expandable relations and are not populated here.
func LoadDCLocations ¶
LoadDCLocations fetches DC locations by ID via BatchGetDCLocationsByIDs. The inline DCLocationCustomer is materialized from the denormalized proto customer_id/customer_name pair — not via an expandable SubField.
func LoadDeliveries ¶
func LoadDemandOverrides ¶
func LoadDepartments ¶
func LoadEDIRuns ¶
LoadEDIRuns fetches EDI runs by ID via BatchGetEDIRunsByIDs. Pure leaf — no nested fields at all.
func LoadEmailDomains ¶
LoadEmailDomains fetches email domains by ID for expansion as a sub-resource (an email inbox's ?include=email_domain). EmailBridgeService exposes no batch get, so domains are fetched one at a time; in practice each inbox carries a single domain id and the resolver dedups across roots before calling this loader.
func LoadEmailInboxes ¶
LoadEmailInboxes exists only to satisfy the resourcekit registration for email inboxes, which are returned as endpoint roots and never fetched as an expandable sub-resource of another type. It must never be invoked.
func LoadEmailLogs ¶
func LoadEnterpriseInquiries ¶
func LoadInventoryChangeLogs ¶
func LoadInventoryItems ¶
func LoadInvoices ¶
LoadInvoices fetches invoices by ID via GetInvoice and builds expandable Invoice references with real header data. There is no batch RPC for invoices, so each ID is fetched individually. Nested sub-resources (lines, allocations, customer, …) are their own expandable relations and are not populated here.
func LoadItemCategories ¶
func LoadItemInventories ¶
func LoadJobs ¶
LoadJobs exists to satisfy the registry's Load hook. Nothing embeds a job as a sub-resource — a job is only ever the root of its own response — so the resolver never batches a job by id, and there is no BatchGetJobsByIDs to call if it did.
func LoadLocations ¶
func LoadMachines ¶
func LoadMaterials ¶
func LoadMessageAttachments ¶
LoadMessageAttachments is the never-invoked loader for the message_attachment resource. Attachments arrive inline on their parent message and are resolved by traversal (message ?include=attachments), never fetched by id, so this loader is never invoked.
func LoadMessageReports ¶
LoadMessageReports is the never-invoked loader for the message_report resource.
func LoadMessages ¶
LoadMessages fetches chat messages by ID via BatchGetMessages (access-gated server-side) and builds base Message references, stashing their expandable sub-objects (sender, author, resource, attachments) so deeper includes on an expanded message resolve. Used for a message's reply_to and a conversation's last_message expansions. Display-name hydration is best-effort and applied at the top level by the messages endpoint.
func LoadMessagingBlocks ¶
LoadMessagingBlocks is the never-invoked loader for the messaging_block resource.
func LoadNotifications ¶
LoadNotifications is the never-invoked loader for the notification resource.
func LoadOpenCreditEntries ¶
func LoadOrderDiscounts ¶
LoadOrderDiscounts fetches order discounts by ID via BatchGetOrderDiscountsByIDs (CoreSalesService). Pure leaf — no expandable sub-resources, so no LoadMeta is needed.
func LoadPaymentTerms ¶
LoadPaymentTerms fetches payment terms by ID via BatchGetPaymentTermsByIDs. Stashes owner_account_id in LoadMeta so the SubField closures can build the Owner shell and (on owner.account) write the loaded Account.
func LoadPermissionGroups ¶
func LoadPickLines ¶
Satisfies Register's required Load but is never invoked: pick lines are expandable only by traversal from their pick (attached inline via ExtractRefs), never loaded by their own id.
func LoadPicks ¶
LoadPicks fetches picks by ID via GetPick and builds expandable Pick references with real header data. There is no batch RPC for picks, so each ID is fetched individually. Nested sub-resources (lines, sales_order, customer, departments) are their own expandable relations and are not populated here.
func LoadPortalDomains ¶
LoadPortalDomains fetches portal domains by ID for expansion as a sub-resource.
func LoadPricingPlans ¶
func LoadPriorities ¶
LoadPriorities fetches priorities by ID via BatchGetPrioritiesByIDs. Priority is a system-only resource — Owner is always SystemOwner — so no FK metadata needs to be stashed in LoadMeta.
func LoadProductLines ¶
LoadProductLines fetches product lines by ID via BatchGetProductLinesByIDs. Stashes owner_account_id and the pre-built UnitGroup in LoadMeta for SubField closures.
func LoadProductTypes ¶
LoadProductTypes fetches product types by ID via BatchGetProductTypesByIDs. ProductType is a system-only lookup with no expandable sub-resources, so no LoadMeta is required.
func LoadProductionFlows ¶
func LoadProductionRuns ¶
LoadProductionRuns fetches production runs by ID via GetProductionRun and builds reference values with real header data (number, started/completed timestamps) for the sales order's related.production_run. There is no batch RPC, so each ID is fetched individually. The responsible_user FK id is stashed so a nested responsible_user include can resolve.
func LoadProductionSteps ¶
func LoadProductions ¶
func LoadProducts ¶
func LoadProperties ¶
func LoadPublicAccounts ¶
func LoadPurchaseOrders ¶
LoadPurchaseOrders fetches purchase orders by ID via BatchGetPurchaseOrdersByIDs and builds expandable PurchaseOrder references with real header data. Nested sub-resources (lines, addresses, supplier, …) are their own expandable relations and are not populated here.
func LoadQuantities ¶
func LoadRealizedMarginFindings ¶
LoadRealizedMarginFindings is the same stub for realized-margin findings.
func LoadReceivableEntries ¶
func LoadReceivingOrderLines ¶
func LoadReceivingOrders ¶
LoadReceivingOrders fetches receiving orders by ID via GetReceivingOrder and builds expandable ReceivingOrder references with real header data. There is no batch RPC for receiving orders, so each ID is fetched individually. Nested sub-resources (lines, supplier, purchase_order) are their own expandable relations and are not populated here.
func LoadRegistrationFlows ¶
func LoadRequestLogs ¶
func LoadSalesOrderStatuses ¶
func LoadSalesOrders ¶
Fetches orders by ID as expandable references. Lines and customer stay unpopulated; the relations a nested order can expand are stashed alongside — see stashNestedSalesOrderMeta.
func LoadSalesTargets ¶
func LoadSandboxes ¶
LoadSandboxes fetches sandboxes by ID via BatchGetSandboxesByIDs. Stashes owner_account_id in LoadMeta so the `owner_account` SubField closure can build the Account expansion when requested.
func LoadScanningStations ¶
func LoadServiceLevels ¶
LoadServiceLevels fetches service levels by ID via BatchGetServiceLevelsByIDs. It builds clean *apiresource.ServiceLevel values and stashes each service level's owner_account_id in LoadMeta for the owner/owner.account sub-fields.
func LoadSettlementSummaries ¶
func LoadSettlements ¶
func LoadShipmentLines ¶
Satisfies Register's required Load but is never invoked: shipment lines are expandable only by traversal from their shipment (attached inline via ExtractRefs), never loaded by their own id.
func LoadShipments ¶
LoadShipments fetches shipments by ID via GetShipment and builds expandable Shipment references with real header data. There is no batch RPC for shipments, so each ID is fetched individually. Nested sub-resources (lines, freight, sales_order, …) are their own expandable relations and are not populated here.
func LoadShippingCases ¶
func LoadShippingTerms ¶
func LoadSupplierMaterials ¶
func LoadSuppliers ¶
func LoadSwitchPlanResponses ¶
func LoadSysProperties ¶
LoadSysProperties fetches sys properties by ID via BatchGetSysPropertiesByIDs. Inline SysPropertyType is built from denormalized proto fields. Account-scoped.
func LoadTenancies ¶
func LoadTerritories ¶
func LoadToolGroups ¶
func LoadTransactions ¶
func LoadUnitGroupUnits ¶
LoadUnitGroupUnits fetches unit group units by ID via BatchGetUnitGroupUnitsByIDs. Returns flat UnitGroupUnits without Unit populated — the unit SubField on UnitGroupUnit handles loading Unit when ?include=unit is requested.
func LoadUnitGroups ¶
LoadUnitGroups fetches unit groups by ID via BatchGetUnitGroupsByIDs. Stashes owner_account_id, base_unit_id, and pre-built associated units data in LoadMeta for SubField closures.
func LoadUnits ¶
LoadUnits fetches units by ID via BatchGetUnitsByIDs. Stashes owner_account_id in LoadMeta so the SubField closures can build the Owner shell and (on owner.account) write the loaded Account.
func LoadValidatedAddresses ¶
func LoadVolumeDiscounts ¶
func MachineDowntimeEventFromProto ¶
func MachineDowntimeEventFromProto(e *pb.MachineDowntimeEventInfo) *apiresource.MachineDowntimeEvent
func MachineFromProto ¶
func MachineFromProto(m *pb.MachineInfo) *apiresource.Machine
func MaterialFromProto ¶
func MaterialFromProto(m *pb.MaterialInfo) *apiresource.Material
MaterialFromProto builds the gated Material resource: the expandable item is left nil and populated only when explicitly requested via the include resolver. Use this — never the full MaterialPresenter — when building a JSON API response.
func OrderDiscountFromProto ¶
func OrderDiscountFromProto(d *pb.OrderDiscountInfo) *apiresource.OrderDiscount
func PartFromProto ¶
func PartFromProto(p *pb.PartInfo) *apiresource.Part
PartFromProto builds the gated Part resource: the expandable item is left nil and populated only when explicitly requested via the include resolver. Use this — never the full PartPresenter — when building a JSON API response.
func ProductFromProto ¶
func ProductFromProto(p *pb.ProductFullInfo) *apiresource.Product
ProductFromProto builds the gated Product resource: expandable fields (item, product_line) are left nil and populated only when explicitly requested via the include resolver. Use this — never the full ProductPresenter — when building a JSON API response.
func PropertyFromProto ¶
func PropertyFromProto(p *pb.PropertyInfo) *apiresource.Property
func ScanningStationFromLightProto ¶
func ScanningStationFromLightProto(ss *pb.LightScanningStationInfo) *apiresource.ScanningStation
func ScanningStationFromProto ¶
func ScanningStationFromProto(ss *pb.ScanningStationInfo) *apiresource.ScanningStation
func SetAgentClient ¶
func SetAgentClient(c agentpb.AgentServiceClient)
SetAgentClient is called once at startup with the AgentService client.
func SetAuditClient ¶
func SetAuditClient(c platformpb.AuditServiceClient)
SetAuditClient is called once at startup with the AuditService client.
func SetAuthClient ¶
func SetAuthClient(c authpb.AuthServiceClient)
SetAuthClient is called once at startup with the AuthService client.
func SetChatClient ¶
func SetChatClient(c notifpb.ChatServiceClient)
SetChatClient is called once at startup with the ChatService client.
func SetCoreClient ¶
func SetCoreClient(c pb.CoreServiceClient)
SetCoreClient is called once from the api-gateway wiring code with the shared CoreServiceClient wrapper. Calling it more than once overwrites the previous value — useful for tests that swap in mocks.
func SetCorePickingClient ¶
func SetCorePickingClient(c pb.CorePickingServiceClient)
SetCorePickingClient is called once at startup with the CorePickingService client.
func SetCoreProductionRunClient ¶
func SetCoreProductionRunClient(c pb.CoreProductionRunServiceClient)
SetCoreProductionRunClient is called once at startup with the CoreProductionRunService client.
func SetCorePurchaseClient ¶
func SetCorePurchaseClient(c pb.CorePurchaseServiceClient)
SetCorePurchaseClient is called once at startup with the CorePurchaseService client.
func SetCoreReceivingClient ¶
func SetCoreReceivingClient(c pb.CoreReceivingServiceClient)
SetCoreReceivingClient is called once at startup with the CoreReceivingService client.
func SetCoreSalesClient ¶
func SetCoreSalesClient(c pb.CoreSalesServiceClient)
SetCoreSalesClient is called once at startup with the CoreSalesService client.
func SetCoreShippingClient ¶
func SetCoreShippingClient(c pb.CoreShippingServiceClient)
SetCoreShippingClient is called once at startup with the CoreShippingService client.
func SetDemandOverrideClient ¶
func SetDemandOverrideClient(c pb.CoreDemandOverrideServiceClient)
SetDemandOverrideClient is called once at startup with the CoreDemandOverrideService client.
func SetEmailBridgeClient ¶
func SetEmailBridgeClient(c notifpb.EmailBridgeServiceClient)
SetEmailBridgeClient is called once at startup with the EmailBridgeService client.
func SetFulfillmentClient ¶
func SetFulfillmentClient(c pb.CoreFulfillmentServiceClient)
SetFulfillmentClient is called once at startup with the CoreFulfillmentService client.
func SetLoggingClient ¶
func SetLoggingClient(c platformpb.LoggingServiceClient)
SetLoggingClient is called once at startup with the LoggingService client.
func SetMachineDowntimeClient ¶
func SetMachineDowntimeClient(c pb.CoreMachineDowntimeServiceClient)
SetMachineDowntimeClient is called once at startup with the CoreMachineDowntimeService client.
func SetPortalDomainClient ¶
func SetPortalDomainClient(c pb.CorePortalDomainServiceClient)
SetPortalDomainClient is called once at startup with the CorePortalDomainService client.
func StashMaterialMeta ¶
func StashMaterialMeta(ctx context.Context, m *pb.MaterialInfo)
StashMaterialMeta records the id needed to populate a material's expandable item when the include resolver runs. Pair it with MaterialFromProto so includes work without leaking the nested item.
func StashPartMeta ¶
StashPartMeta records the id needed to populate a part's expandable item when the include resolver runs. Pair it with PartFromProto so includes work without leaking the nested item.
func StashProductMeta ¶
func StashProductMeta(ctx context.Context, p *pb.ProductFullInfo)
StashProductMeta records the ids needed to populate a product's expandable fields (item, product_line) when the include resolver runs. Pair it with ProductFromProto so includes work without leaking the nested resources.
Types ¶
type AccountUserName ¶
AccountUserName is a resolved display name + handle (email) + profile photo for an account user, plus the assigned role id (for callers that expose ?include=role on actors built from these ids).
type AgentDefinitionName ¶
AgentDefinitionName is the minimal display info for an agent participant actor.
Source Files
¶
- account_group_loader.go
- account_group_product_line_access_loader.go
- account_integration_loader.go
- account_loader.go
- account_price_loader.go
- account_status_loader.go
- account_user_loader.go
- actor_hydration.go
- actor_loader.go
- address_details_result_loader.go
- address_loader.go
- address_suggestion_loader.go
- adjustment_type_loader.go
- agent_definition_name_loader.go
- agent_loader.go
- agent_memory_loader.go
- agent_run_loader.go
- allocation_entry_loader.go
- api_key_loader.go
- attribute_loader.go
- audit_event_loader.go
- available_tool_loader.go
- billing_loader.go
- carrier_loader.go
- catalog_category_loader.go
- catalog_product_line_loader.go
- child_account_loader.go
- client.go
- consumption_loader.go
- contact_match_loader.go
- conversation_loader.go
- created_by_loader.go
- customer_loader.go
- customer_product_line_access_loader.go
- dc_location_loader.go
- delivery_loader.go
- demand_override_loader.go
- department_loader.go
- edi_run_loader.go
- email_domain_loader.go
- email_log_loader.go
- include_authz.go
- inventory_change_log_loader.go
- inventory_item_loader.go
- invoice_loader.go
- item_category_loader.go
- item_inventory_loader.go
- item_loader.go
- job_loader.go
- location_loader.go
- machine_downtime_loader.go
- machine_loader.go
- material_loader.go
- message_loader.go
- messaging_group_loader.go
- messaging_resource_loaders.go
- open_credit_entry_loader.go
- order_discount_loader.go
- part_loader.go
- payment_term_loader.go
- permission_group_loader.go
- pick_loader.go
- portal_domain_loader.go
- pricing_finding_loader.go
- priority_loader.go
- product_line_loader.go
- product_loader.go
- product_type_loader.go
- production_flow_loader.go
- production_run_loader.go
- production_step_loader.go
- property_loader.go
- purchase_order_loader.go
- quantity_loader.go
- rate_loader.go
- receivable_entry_loader.go
- receiving_order_line_loader.go
- receiving_order_loader.go
- registration_flow_loader.go
- request_log_loader.go
- role_loader.go
- sales_order_loader.go
- sales_order_status_loader.go
- sales_target_loader.go
- sandbox_loader.go
- scanning_station_loader.go
- service_level_loader.go
- settlement_loader.go
- settlement_summary_loader.go
- shipment_loader.go
- shipping_case_loader.go
- shipping_term_loader.go
- supplier_loader.go
- supplier_material_loader.go
- sys_property_loader.go
- tenancy_loader.go
- territory_loader.go
- transaction_allocation_loader.go
- transaction_loader.go
- unit_group_loader.go
- unit_loader.go
- user_loader.go
- validated_address_loader.go
- volume_discount_loader.go