AlmondTill/G3N API

ConsentRecord

object type

A ConsentRecord — the proof-of-decision per (Consumer × Purpose): consumer-parented (parentId = the Consumer id — the LoyaltyMember construct-parented class), family document, sparse. The permanent (consumer × purpose) uniq pair marker is both the singleton guarantee AND the O(1) lookup (never released, never taken over; purge reaps). NO update op — the only writes are the 4 decide ops (grantConsent/withdrawConsent staff · grantMyConsent/withdrawMyConsent consumer) + the system doom; a same-decision re-capture is a capture-context revision under a new policyVersion. Capture context ∈ {policyVersion, captureSurface ∈ [storefront, pos, back_office, cli, import], captureLocale?} reflects the latest decision. Effective consent = resolveEffectiveConsent (the myConsents view): consumer doomed ⇒ denied · purpose inactive/doomed ⇒ denied · granted ⇒ allowed · withdrawn/doomed ⇒ denied · absent ⇒ opt_in? Denied: allowed. Audit rides existing machinery — NO bespoke ledger. NOT searchable.

Fields

FieldTypeNotes
idID ID!The record’s id — a UUID the platform assigned when the record was created; every reference to this record uses it.
sysIdString String!The human-readable id, shaped like CD-… — stable for the record’s life.
typeString String!The kind of record — always ConsentRecord here.
captionString String!The record’s display name — what people see it called.
statusString String!The record’s current state — one of granted, withdrawn or doomed.
parentIdID ID!The parent consumer; rootId = the org group. NOT the family root.
rootIdID ID!The id of your organization group — every record of yours carries the same one.
createdAtString String!When the record was created, as a UTC timestamp.
updatedAtString String!When the record last changed, as a UTC timestamp.
revisionNumInt Int!How many times this record has been edited; the first save is 0.
revisionID ID!The id of the record’s current edit — send it back with a change so an edit made in the meantime is refused instead of overwritten.
refCaptionsRefCaption [RefCaption!]!The captions of the records this one refers to, composed for you — one row per referenced id; see RefCaption.
purposeIdID ID!The ConsentPurpose this decision is FOR. Immutable at birth; the (parentId × purposeId) pair is singleton via the consentPair uniq marker.
policyVersionString String!The consent-notice/policy version presented at the latest decision. Re-consent under a NEW version with the same decision = the route-3 capture-context revision.
captureSurfaceString String!Where the latest decision was captured — storefront | pos | back_office | cli | import (canned v1 registry; 's banner vocabulary). The consumer channel is server-fixed storefront (a consumer session cannot claim an in-store capture); the staff lane requires one explicitly.
captureLocaleStringThe locale presented at the latest decision; absent ⇒ not recorded.

Used by