Skip to main content

CreateSparePartsMachineInput

Input for creating a new spare parts machine.

Defines all required information to register a new machine in the system including external references, localized content, hierarchical relationships, and associated spare parts.

input CreateSparePartsMachineInput {
externalReference: ExternalReferenceInput!
name: [LocalizedStringInput!]!
description: [LocalizedStringInput!]
machines: [CreateSparePartsMachineInput!]
parts: [CreateSparePartInput!]
slug: [LocalizedStringInput!]
useStandardSlugs: Boolean = false
}

Fields​

CreateSparePartsMachineInput.externalReference ● ExternalReferenceInput! non-null input​

External system reference for the machine.

Links this machine to its counterpart in external systems for data synchronization and cross-platform integration.

CreateSparePartsMachineInput.name ● [LocalizedStringInput!]! non-null input​

Localized names for the machine.

Collection of translated machine names in multiple languages. Each entry must have unique language codes within the array, and each value is limited to 255 characters.

CreateSparePartsMachineInput.description ● [LocalizedStringInput!] list input​

Detailed descriptions of the machine.

Comprehensive information about the machine's purpose, specifications, and usage in multiple languages. Each entry must have unique language codes within the array.

CreateSparePartsMachineInput.machines ● [CreateSparePartsMachineInput!] list input​

Child machines nested within this machine.

Hierarchical collection of sub-machines that belong to this parent machine, enabling complex equipment structures and organizational relationships. Each entry must be unique within the array.

CreateSparePartsMachineInput.parts ● [CreateSparePartInput!] list input​

Spare parts associated with this machine.

Collection of replacement components and parts that are compatible with or required for this machine's operation and maintenance. Each entry must be unique within the array.

CreateSparePartsMachineInput.slug ● [LocalizedStringInput!] list input​

URL-friendly identifiers for the machine, one per language.

A supplied slug is stored exactly as sent and always wins over generation, whatever useStandardSlugs says. It must be non-empty and either contain only lowercase letters (a-z), digits and single hyphens, not starting or ending with a hyphen, or be a slug the legacy algorithm generates unchanged, so a legacy slug read from this service can be sent back as it is: "pump-a", "a1" and "pump-(a)" are valid; "Pump (A)", "Pump-A", "pump a" and "" are not, and fail the request with a validation error before anything is written. A slug may be supplied for a language the machine has no name in. An entry whose value is null counts as not supplied. Each entry must have unique language codes within the array, and each value is limited to 255 characters.

Every language with a name but no supplied slug gets one generated from the name, by the algorithm useStandardSlugs selects: legacy by default ("Pump (A)" generates "pump-(a)"), standard when true ("Pump (A)" generates "pump-a"). See useStandardSlugs for which slugs machineUpsert keeps and which it regenerates.

Slugs are not unique: several machines may hold the same slug in the same language, whether it was supplied or generated, and no suffix is ever added to tell them apart. Keeping slugs unique is the caller's responsibility. Looking a machine up by slug and language returns the oldest machine that holds the slug.

CreateSparePartsMachineInput.useStandardSlugs ● Boolean scalar​

Chooses how slugs are generated from the name, for each language that has a name but no supplied slug. Optional; defaults to false.

  • false or omitted (legacy, how slugs have always been generated): the name is transliterated to ASCII, lowercased and its whitespace turned into hyphens, but punctuation such as parentheses, dots, underscores and exclamation marks is kept. "Pump (A)" generates "pump-(a)".
  • true (standard, the same algorithm as product slugs): every character that is not a letter, digit or whitespace is removed as well, so the result contains only lowercase letters, digits and single hyphens. "Pump (A)" generates "pump-a", "Größe 2" generates "grosse-2".

In both modes a generated slug is at most 255 characters, and a name that generates nothing (such as "!!!" in standard mode) leaves that language without a slug. A slug supplied in the slug field always wins over generation, in both modes.

Slugs are not unique: machines whose names generate the same slug all get that same slug, without a suffix. Keeping slugs unique is the caller's responsibility.

On machineUpsert of an existing machine, a supplied slug replaces the stored one, the stored slugs of languages that are not in the payload's name are kept, and a name sent with a null value removes its language's slug unless one is supplied. For each language in the payload's name that has no supplied slug:

  • true: the slug is regenerated with the standard algorithm, even if the name did not change, so a custom slug is overwritten unless it is sent again in the slug field.
  • false or omitted: the stored slug is kept, unchanged, when the name is unchanged or when the old and the new name generate the same slug in either algorithm (for example "Pump (A)" renamed to "Pump (a)"); otherwise it is regenerated with the legacy algorithm (for example "ABC-1000" renamed to "ABC-100" gets "abc-100").

Only the value on the top-level input is read. Nested machines are generated with the top-level choice. Setting true on a nested machine fails the request with BAD_USER_INPUT; false on a nested machine is ignored.

Member Of​

CreateSparePartsMachineInput input ● machineCreate mutation ● UpsertSparePartsMachineInput input