Workflow: Identifier Scan Flow

This flow describes what happens immediately after a QR or NFC identifier is scanned. The goal is to decide what the user sees next and which backend calls are triggered.

Resolver Contract

resolveIdentifier(code)  {
  type: "KNOWN_OBJECT" | "UNKNOWN_SPECIFIC" | "UNKNOWN_GENERAL" | "ERROR",
  objectId?: string,
  classId?: string,
  canEdit?: boolean
}

Branches

1. Unknown Tag

Variant UI Dialog Primary Buttons
Unknown, General Class “We don’t recognise this item.” Create new object (pre-attaches identifier) • Tag existing object (opens search)
Unknown, Specific Class Shows class name + placeholder image Create new object (pre-fills class) • Cancel

2. Known Object

User Rights Behaviour
canEdit = true Navigate straight to Object Detail with full edit actions
false Load Object Detail in Read-Only mode. Banner shows owning org. If object has sale/rent flags, show Purchase / Rent / Borrow CTA

3. Background Actions

  • Every scan triggers createScanEvent() (audit & analytics).

4. Error & Edge Cases

  • Invalid code → toast “Identifier not valid”.
  • Duplicate tag → list of candidate objects to pick from.
  • Offline – cache last success & queue events until online.

GraphQL Operations

  • query resolveIdentifier(code) – initial resolver.
  • mutation linkIdentifierToObject(id, objectId) – if user chooses Tag existing object.
  • mutation createObjectWithIdentifier(input) – if user creates new object from dialog.

Open Items / TODO

  • Rate-limit scan events for spamming protection.
  • Deep-link sharing of results (/o/:id vs modal).
  • UI wireframes (link to Figma) for all dialog variants.