# ERP Costing

Cost categories, centres, rates, operation cost mappings and recorded costs.

## Operations

```graphql
# ERP Costing (erp-costing)
# Cost categories, centres, rates, operation cost mappings and recorded costs.
# Query
compileSchemaXML: String!  # Compile standalone XML schema syntax into JSON Schema without persisting it; host restrictions apply when embedded
generateDefaultDataQuery: String  # Generate a default GraphQL data query for an event topic
getCostCategory: CostCategoryState  # Fetch a single cost category by ID
getCostCategoryBy: CostCategoryState  # Fetch a cost category by external ID or code
getCostRate: CostRateState  # Fetch a single cost rate by ID
getMagicQueryGraphQL: MagicQueryOperation!  # Resolves a Magic Query string to the real GraphQL operation and variables it runs, so consumers can graduate from the façade to raw GraphQL
getMagicQuerySchema: MagicQuerySchema!  # Returns the input JSON Schema and output introspection for a Magic Query noun, so consumers (especially LLMs) can learn its contract before calling magicQuery
getOperationCostMapping: OperationCostMappingState  # Fetch a single operation cost mapping by ID
getRecordedCost: RecordedCostState  # Fetch a single recorded cost by ID
helpChapter: HelpChapter  # Read a chapter of the current published manual edition
helpChapters: [HelpChapterInfo!]!  # List human-facing manual chapters from the running deployment
iacGuides: [IaCGuide!]!  # Every authoring guide, for a tool that syncs them to a folder
iacSchema: IaCSchemaDocument!  # The infrastructure-only view of this schema, for declarative tooling
iacSchemaDocument: IaCSchemaDocumentPayload!  # Fetch the JSON Schema document a SCHEMA-kind validator references, for declarative tooling
iacValidate: IaCValidationResult!  # Validate an infrastructure artifact
jobCostingSummary: JobCostingSummaryPayload!  # Get a costing summary for a job including material and operation costs
listCostCategories: CostCategoryConnection!  # List cost categories with pagination
listCostRates: CostRateConnection!  # List cost rates with pagination
listDataChangeEventTopics: [DataChangeEventGroup!]!  # List all valid data change event topics, grouped by resource
listMagicQueries: [MagicQueryInfo!]!  # Lists every available Magic Query noun with a short description and its options — the discovery entry point
listOperationCostMappings: OperationCostMappingConnection!  # List operation cost mappings
listRecordedCosts: RecordedCostConnection!  # List recorded costs with pagination
magicQuery: JSON!  # Executes a Magic Query string and returns the predefined query's JSON result
ping: String!  # Health check endpoint
quotingReadinessCheck: QuotingReadinessPayload!  # Check whether cost configuration is complete for automated quoting
renderSchemaXML: String!  # Render JSON Schema as native XML without dropping unsupported keywords or changing a saved document
schemaAuthoringCatalog: JSON!  # Compiler-owned vocabulary for the standalone XML JSON Schema dialect, including native form annotations
searchHelp: HelpSearchResult!  # Search human-facing manuals using shared semantic and text retrieval
# Mutation
createCostCategory: UpsertCostCategoryPayload!  # Create a new cost category, failing if the code is already taken
createCostRate: UpsertCostRatePayload!  # Create a new cost rate (always version 1)
createOperationCostMapping: UpsertOperationCostMappingPayload!  # Create a new operation cost mapping
createRecordedCost: UpsertRecordedCostPayload!  # Create a new recorded cost
deleteCostCategory: DeletePayload!  # Delete a cost category
deleteCostRate: DeletePayload!  # Delete a cost rate nothing depends on
deleteOperationCostMapping: DeletePayload!  # Delete an operation cost mapping
deleteRecordedCost: DeletePayload!  # Delete a recorded cost
exportCostConfiguration: ExportCostConfigurationPayload!  # Export the tenant's cost configuration (categories, rates, operation mappings) as a flat CSV string for spreadsheet editing
importCostConfiguration: ImportCostConfigurationPayload!  # Import cost configuration from a CSV string
updateCostCategory: UpsertCostCategoryPayload!  # Update a cost category in place
updateCostRate: UpsertCostRatePayload!  # Update a cost rate in place (does not create a new version, unlike upsertCostRate)
updateOperationCostMapping: UpsertOperationCostMappingPayload!  # Update an operation cost mapping
updateRecordedCost: UpsertRecordedCostPayload!  # Update a recorded cost
upsertCostCategory: UpsertCostCategoryPayload!  # Create or update a cost category
upsertCostRate: UpsertCostRatePayload!  # Create or update a cost rate
upsertOperationCostMapping: UpsertOperationCostMappingPayload!  # Create or update an operation cost mapping
upsertRecordedCost: UpsertRecordedCostPayload!  # Record an actual cost incurred
# Subscription
dataChangeEvents: DataChangeEvent!  # Subscribe to real-time data change events

# Call describe_operation(name) for arguments and input types.
```

## Exact schema

Download [complete SDL](/schemas/erp-costing.graphql) (218354 bytes). Use the SDL to validate operations; the digest omits argument signatures.

## Guides
- [Describe the parts to produce](/docs/data-model/production#describe-the-parts-to-produce)
- [Plan the production steps](/docs/data-model/production#plan-the-production-steps)
- [Schedule the work](/docs/data-model/production#schedule-the-work)
- [Coordinate people and milestones](/docs/data-model/production#coordinate-people-and-milestones)
- [Record progress on the shop floor](/docs/data-model/production#record-progress-on-the-shop-floor)
- [Review production and costs](/docs/data-model/production#review-production-and-costs)
- [Production API reference](/docs/data-model/production-reference)
- [Read the configured production resources](/docs/data-model/production#read-the-configured-production-resources)
- [Read configured costs and check quoting readiness](/docs/data-model/erp#read-configured-costs-and-check-quoting-readiness)
- [Record and review actual job costs](/docs/data-model/erp#record-and-review-actual-job-costs)
- [Invoices, credit notes and payments](/docs/data-model/erp#invoices-credit-notes-and-payments)
- [ERP API reference](/docs/data-model/erp-reference)
- [Business units and cost centres](/docs/data-model/erp#business-units-and-cost-centres)