Skip to main content

getItemId

@nmi-agro/fdm-source


@nmi-agro/fdm-source / fdm-rvo/src / getItemId

Function: getItemId()

getItemId(item): string

Defined in: fdm-rvo/src/utils.ts:23

Generates a stable unique identifier for a review item.

Priority:

  1. Local field DB id (b_id) — always present when localField exists.
  2. RVO crop field id (CropFieldID) — always present when rvoField exists.
  3. Deterministic composite from status, CropFieldVersion, and BeginDate — used only in the degenerate case where neither field is set.

The returned value is stable across renders for the same item, making it safe to use as a React key and for UserChoiceMap identity comparisons.

Parameters

item

RvoImportReviewItem<any>

The review item to generate an ID for.

Returns

string

A unique string identifier for the item.