AlmondTill/G3N API

On this page

deactivateTrainingRequirement

mutation · in the family Training requirement

What it does

Take a training rule out of force — kept, not counted, until reactivated.

Deactivate a TrainingRequirement by id; requires the unrestricted capability + the record's CURRENT revision. Deny-by-default + the referential_integrity / authority / occ guards. The optional reason rides the transition events.

What happens

Reversible.

Who may call it

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

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.
reasonStringnoNo further notes.

Returns

TrainingRequirement TrainingRequirement! — A TrainingRequirement (🎓 — THE TRAINING PROGRAM, THE WIRE): 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

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

Variables:

{
  "id": "01900000-0000-7000-8000-37386ae00000",
  "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

{
  "data": {
    "deactivateTrainingRequirement": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "TE-EXMP-0000-000F",
      "type": "TrainingRequirement",
      "caption": "Blue jeans",
      "status": "active",
      "parentId": "01900000-0000-7000-8000-065235280000",
      "rootId": "01900000-0000-7000-8000-a093dd800000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "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