functional-models
    Preparing search index...

    Function NaturalIdProperty

    • An id that is naturally formed by other properties within a model. Instead of having a "globally unique" id the model is unique because the composition of values of properties.

      Parameters

      • propertyKeys: readonly string[]

        A list (in order) of property keys needed to make the id. These keys can take nested paths if a property is an object, array, or even a model instance object. Example: 'nested.path.here'. Note: If ANY of the properties are undefined, the key becomes undefined. This is to ensure key structure integrity. Additionally, if the property key points to a referenced model 1 of 2 things will happen.

        1. If the key is not nested (Example: model.myReferenceObj) then the key to the referenced model will be used.
        2. If the key IS nested (Example: model.myReferenceObj.name) then the instance will be retrieved and then the property for that model instance is used.
      • joiner: string

        A string that will be passed to ".join()" for creating a single string.

      • config: PropertyConfig<string> = {}
      • additionalMetadata: {} = {}

      Returns Readonly<
          {
              createGetter: (
                  value: string,
                  modelData: Readonly,
                  modelInstance: ModelInstance<
                      Readonly<{ [s: string]: any }>,
                      object,
                      object,
                  >,
              ) => ValueGetter<string, Readonly<{ [s: string]: any }>, object, object>;
              getChoices: () => readonly ChoiceTypes[];
              getConfig: () => object;
              getConstantValue: () => undefined | string;
              getDefaultValue: () => undefined | string;
              getPropertyType: () => string;
              getValidator: (
                  valueGetter: ValueGetter<
                      string,
                      Readonly<{ [s: string]: any }>,
                      object,
                      object,
                  >,
              ) => PropertyValidator<Readonly<{ [s: string]: any }>>;
          },
      >