AlmondTill/G3N API

doomTrainingRequirement

mutation · in the family Training requirement

What it does

Permanently retire a training rule.

Doom (terminal) a TrainingRequirement (active|inactive→doomed) — certificates already issued stand; the rule simply stops binding anyone. Requires the unrestricted capability + the current revision.

Before you call

A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.

Capability area: Training — Courses, tests, certificates and the training rules of your team.

Roles that may call it:

What happens

Permanent; certificates already issued stand.

Arguments

NameTypeRequiredNotes
idID ID!yesThe id of the record.
revisionID ID!yesThe revision id you read on the record; the change is refused if an edit landed in the meantime.
reasonStringno

Concurrency

Send the record’s current revision from your last read as revision. A stale revision is refused as CONFLICT/REVISION_STALE — read the record again and retry with the new value.

Returns

TrainingRequirement TrainingRequirement! — A TrainingRequirement: the owner's rule that people holding a role copied from the canned template roleTemplateKey must hold a valid TrainingCertificate for the course courseKey — a live play key of the Playbook registry. graceDays (0..365, default 14) = the days after the role grant before the requirement falls due; passMark (1..100, default 80) = the mark a sitting must reach — the strictest rule binding the person for the course wins at an attempt's start. The pair (roleTemplateKey, courseKey) is immutable after birth and unique among the org's non-doomed rules (a duplicate refuses CONFLICT/IDENTITY_TAKEN); at most 100 rules per org (CONFLICT/TRAINING_CAP past it). NOT searchable (no filter roster until the face).

Example request

graphql
mutation ExampleDoomTrainingRequirement($id: ID!, $revision: ID!, $reason: String) {
  doomTrainingRequirement(id: $id, revision: $revision, reason: $reason) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    roleTemplateKey
    courseKey
    graceDays
    passMark
    note
  }
}

Variables:

json
{
  "id": "01900000-0000-7000-8000-a9a88e920000",
  "revision": "01900000-0000-7000-8000-b7960e180000",
  "reason": "Correcting a miscount."
}

Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.

Example response

json
{
  "data": {
    "doomTrainingRequirement": {
      "id": "01900000-0000-7000-8000-a9a88e920000",
      "sysId": "TE-EXMP-0000-000F",
      "type": "TrainingRequirement",
      "caption": "Blue jeans",
      "status": "doomed",
      "parentId": "01900000-0000-7000-8000-eacdfcfd0000",
      "rootId": "01900000-0000-7000-8000-a1295a650000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-53c6eea90000",
      "roleTemplateKey": "<role template key>",
      "courseKey": "<course key>",
      "graceDays": 1,
      "passMark": 1,
      "note": "Restock before the weekend."
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer