resourceloaders

package
v1.0.0 Latest Latest
Warning

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

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

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

View Source
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 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 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 LoadAPIKeys(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

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

func LoadAccountGroups(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

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 LoadAccountPrices(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadAccountStatuses

func LoadAccountStatuses(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

LoadAccountStatuses fetches account statuses by ID via BatchGetAccountStatusesByIDs. System-only resource — no LoadMeta needed.

func LoadAccountUsageResponses

func LoadAccountUsageResponses(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

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 LoadAccountUsers(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

func LoadAccounts

func LoadAccounts(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

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 LoadActors(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadAddressDetailsResults

func LoadAddressDetailsResults(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadAddressSuggestions

func LoadAddressSuggestions(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadAddresses

func LoadAddresses(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

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 LoadAdjustmentTypes(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

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

func LoadAgentDefinitions(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

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

func LoadAgentMemories(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

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

func LoadAgentRuns(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

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 LoadAllocationEntries(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadAnnouncements

func LoadAnnouncements(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

LoadAnnouncements is the never-invoked loader for the announcement resource.

func LoadAttributes

func LoadAttributes(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

func LoadAuditEvents

func LoadAuditEvents(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadAvailableTools

func LoadAvailableTools(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadBillingPortalSessions

func LoadBillingPortalSessions(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadCarriers

func LoadCarriers(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

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 LoadCatalogCategories(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadCatalogProductLines

func LoadCatalogProductLines(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadChildAccounts

func LoadChildAccounts(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

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 LoadConsumptions(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadContactMatches

func LoadContactMatches(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

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(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

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

func LoadConversations(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

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

func LoadCustomers(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

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

func LoadDCLocations(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

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 LoadDeliveries(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadDemandOverrides

func LoadDemandOverrides(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

func LoadDepartments

func LoadDepartments(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

func LoadEDIRuns

func LoadEDIRuns(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

LoadEDIRuns fetches EDI runs by ID via BatchGetEDIRunsByIDs. Pure leaf — no nested fields at all.

func LoadEmailDomains

func LoadEmailDomains(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

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

func LoadEmailInboxes(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

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 LoadEmailLogs(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadEnsureBillingCustomerResponses

func LoadEnsureBillingCustomerResponses(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadEnterpriseInquiries

func LoadEnterpriseInquiries(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadInventoryChangeLogs

func LoadInventoryChangeLogs(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadInventoryItems

func LoadInventoryItems(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadInvoices

func LoadInvoices(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

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 LoadItemCategories(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

func LoadItemInventories

func LoadItemInventories(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadItems

func LoadItems(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

func LoadJobs

func LoadJobs(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

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 LoadLocations(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

func LoadMachineDowntimeEvents

func LoadMachineDowntimeEvents(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

func LoadMachines

func LoadMachines(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

func LoadMaterials

func LoadMaterials(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

func LoadMessageAttachments

func LoadMessageAttachments(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

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

func LoadMessageReports(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

LoadMessageReports is the never-invoked loader for the message_report resource.

func LoadMessages

func LoadMessages(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

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

func LoadMessagingBlocks(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

LoadMessagingBlocks is the never-invoked loader for the messaging_block resource.

func LoadNotifications

func LoadNotifications(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

LoadNotifications is the never-invoked loader for the notification resource.

func LoadOpenCreditEntries

func LoadOpenCreditEntries(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadOrderDiscounts

func LoadOrderDiscounts(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

LoadOrderDiscounts fetches order discounts by ID via BatchGetOrderDiscountsByIDs (CoreSalesService). Pure leaf — no expandable sub-resources, so no LoadMeta is needed.

func LoadParts

func LoadParts(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

func LoadPaymentTerms

func LoadPaymentTerms(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

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 LoadPermissionGroups(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

func LoadPickLines

func LoadPickLines(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

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

func LoadPicks(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

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 LoadPlanChangeProrations

func LoadPlanChangeProrations(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadPortalDomains

func LoadPortalDomains(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

LoadPortalDomains fetches portal domains by ID for expansion as a sub-resource.

func LoadPricingPlans

func LoadPricingPlans(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadPriorities

func LoadPriorities(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

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

func LoadProductLines(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

LoadProductLines fetches product lines by ID via BatchGetProductLinesByIDs. Stashes owner_account_id and the pre-built UnitGroup in LoadMeta for SubField closures.

func LoadProductTypes

func LoadProductTypes(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

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 LoadProductionFlows(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadProductionRuns

func LoadProductionRuns(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

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 LoadProductionSteps(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadProductions

func LoadProductions(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadProducts

func LoadProducts(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

func LoadProperties

func LoadProperties(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

func LoadPublicAccounts

func LoadPublicAccounts(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadPurchaseOrders

func LoadPurchaseOrders(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

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 LoadQuantities(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadRates

func LoadRates(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadRealizedMarginFindings

func LoadRealizedMarginFindings(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

LoadRealizedMarginFindings is the same stub for realized-margin findings.

func LoadReceivableEntries

func LoadReceivableEntries(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadReceivingOrderLines

func LoadReceivingOrderLines(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadReceivingOrders

func LoadReceivingOrders(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

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 LoadRegistrationFlows(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadRequestLogs

func LoadRequestLogs(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

func LoadRoles

func LoadRoles(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

func LoadSalesOrderStatuses

func LoadSalesOrderStatuses(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

func LoadSalesOrders

func LoadSalesOrders(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

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 LoadSalesTargets(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadSandboxes

func LoadSandboxes(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

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 LoadScanningStations(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

func LoadServiceLevels

func LoadServiceLevels(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

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 LoadSettlementSummaries(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadSettlements

func LoadSettlements(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadShipmentLines

func LoadShipmentLines(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

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

func LoadShipments(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

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 LoadShippingCases(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadShippingTerms

func LoadShippingTerms(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

func LoadSpendingCapResponses

func LoadSpendingCapResponses(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadSupplierMaterials

func LoadSupplierMaterials(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadSuppliers

func LoadSuppliers(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadSwitchPlanResponses

func LoadSwitchPlanResponses(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadSysProperties

func LoadSysProperties(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

LoadSysProperties fetches sys properties by ID via BatchGetSysPropertiesByIDs. Inline SysPropertyType is built from denormalized proto fields. Account-scoped.

func LoadTenancies

func LoadTenancies(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadTerritories

func LoadTerritories(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

func LoadToolGroups

func LoadToolGroups(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadTransactionAllocations

func LoadTransactionAllocations(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadTransactions

func LoadTransactions(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadUnitGroupUnits

func LoadUnitGroupUnits(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

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

func LoadUnitGroups(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

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

func LoadUnits(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

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 LoadUsers

func LoadUsers(ctx context.Context, ids []string) (map[string]any, *apierror.APIError)

func LoadValidatedAddresses

func LoadValidatedAddresses(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

func LoadVolumeDiscounts

func LoadVolumeDiscounts(_ context.Context, _ []string) (map[string]any, *apierror.APIError)

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 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

func StashPartMeta(ctx context.Context, p *pb.PartInfo)

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

type AccountUserName struct {
	Name     *string
	Email    *string
	ImageURL *string
	RoleID   *string
}

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

type AgentDefinitionName struct {
	Name string
	Slug string
}

AgentDefinitionName is the minimal display info for an agent participant actor.

Source Files

Jump to

Keyboard shortcuts

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