Member Junction
    Preparing search index...

    Built-in server driver for MJ: Comment Types code 'FIELD_SUGGESTION'.

    Responsibilities:

    1. Validates that suggestions target a real field (AnchorType === 'Field', valid AnchorKey) on an entity that has opted into 'FIELD_SUGGESTION' via Configuration.Comments.AllowedCommentTypes.
    2. Enforces full entity Update, RLS, and FLS write permissions on OnAccept and OnReject.
    3. Applies SuggestedValue to the target record via a normal targetRecord.Save() as the accepting user on OnAccept, producing a standard Record Changes audit entry.
    4. Supersedes older pending suggestions when a newer pending suggestion is created for the same (LinkedEntityID, LinkedRecordID, AnchorKey) or when any save modifies the target field.

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    • Optional post-save hook invoked inside the active transaction (both direct Save()'s EntityTransactionScope and TransactionGroup.Submit()'s group transaction) after finalizeSave has applied server-returned values and marked entity.IsSaved = true, and before commit, so side-effect writes performed by the driver participate in the same atomic transaction and throwing aborts and rolls back the transaction (restoring entity's pre-save state).

      Parameters

      Returns void | Promise<void>

    • Optional pre-save hook invoked inside the active save transaction after validation succeeds and before ProviderToUse.Save() writes the row.

      Return false or a non-empty error message string (or throw an Error) to abort and roll back the save. Field mutations applied to entity here are included in the persisted write.

      Parameters

      Returns string | boolean | void | Promise<string | boolean | void>

    • Optional synchronous hook invoked when a caller modifies a field value via Set() (or a generated property setter) and the new value differs from the previous value. Not called during record hydration (InnerLoad, LoadFromData, SetMany).

      Parameters

      • entity: BaseEntity
      • fieldName: string
      • newValue: unknown
      • oldValue: unknown

      Returns void