Skip to content

Component Record Fields

Krish Majumdar edited this page Jan 6, 2023 · 8 revisions

Common Record Fields

Every component record in the database will always contain the fields described below. Unless otherwise indicated, all fields are automatically added and/or updated by the database when the component is created or edited.

  • _id [string] : 24 alphanumeric characters, unique to each version of every component record
  • recordType: "component" [string] : indicates what type of record this is (fixed value)
  • componentUuid [string] : the full UUID, 32 alphanumeric characters, identical across all versions of a single component record
  • shortUuid [string] : the short UUID, 20 to 22 alphanumeric characters, translated directly from the componentUuid and only used in the component's QR code
  • formId [string] : the type form ID, value dependent on which component type form is used to create the component
  • formName [string] : the type form name, value dependent on the formId above
  • data [object] : contains the 'user-defined information' entered into the component type form during component creation and/or editing, except for the following sub-fields which are automatically set by the database:
    • data.submit: true [bool] : a flag to confirm submission of the record to the database (fixed value)
    • data.typeRecordNumber [integer] : a counter of which numbered component record this is of this particular component type (for example, the second component created with formId: X will have data.typeRecordNumber: 2, as will the second component created with formId: Y). This field is not present for components created through the M2M system.
  • insertion [object] :
    • insertion.insertDate [string] : the date and time when the component record was last edited
    • insertion.ip [string] : the IP address of the device from which the component record was last edited
    • user [object] :
      • user.user_id [string] : the Auth0 ID of the user who last edited the component record
      • user.displayName [string] : the Auth0 display name of the user who last edited the component record
      • user.emails [list of strings] : a list of all email addresses associated with the user who last edited the component record (from the user's Auth0 account)
  • validity [object] :
    • startDate [string] : the date and time when this version of the component record was created (i.e. when the component record was last edited)
    • version [integer] : the version number of this version of the component record
    • ancestor_id [string] : the _id string of the previous version of this component record (or null if this is the first version)

Optional Record Fields

In addition to the above fields, a component record may also contain one or more of the following fields, depending on the component type, from where in the interface it was created, and/or any actions that have been performed on it. As with the common fields, unless otherwise indicated, all fields are automatically added and/or updated by the database when the component is created or edited.

  • workflowId [string] : 24 alphanumeric characters, used only by components created via workflows, this contains the workflowId of the originating workflow
  • data.subComponent_fullUuids [array of strings] : used only by batch components, this contains the componentUuid of all sub-components in the batch (which are also themselves generated automatically by the database upon creation of the originating batch)
  • data.subComponent_shortUuids [array of strings] : used only by batch components, this contains the shortUuid of all sub-components in the batch (translated from the values in data.subComponent_fullUuids upon creation of the originating batch)
  • data.subComponent_typeRecordNumbers [array of integers] : used only by batch components, this contains the data.typeRecordNumber of all sub-components in the batch
  • data.fromBatch [string] : used only by components which are sub-components of a batch component, this is the componentUuid of the originating batch
  • reception [object] : used only by geometry boards, this object is automatically populated and/or updated for all geometry boards in a given 'board shipment' component when a 'board reception' action is performed on it
    • location [string] : the location at which this geometry board (shipment) was most recently received
    • date [string] : the date and time when this geometry board (shipment) was received at the location specified in reception.location
Clone this wiki locally