WriteValidation

@thotnr-aws-accl/custom-app-api / Exports / WriteValidation

Interface: WriteValidation

Represents a validation rule executed during data writes to an object.

Table of contents

Properties

Properties

description

description: string

Description of the validation.


enabled

enabled: boolean

Temporarily disables the validation without removing it.


errorLevel

errorLevel: WriteValidationErrorLevel

Error level of the validation (see WriteValidationErrorLevel).


errorMessage

errorMessage: string

The error message displayed to the user.


errorType

errorType: number

User-defined error type (must be > 10000). Numbers below 10000 are reserved for the platform.


externalId

externalId: string

A unique identifier for the validation across all instances. Currently unused but will support reuse across application contexts in the future.


id

Optional id: number

Provide this ID when updating an existing validation.


isAggregate

isAggregate: boolean

Indicates if this is an aggregate validation (applies to the entire batch, not individual records). Example predicate for aggregate validation: "(SELECT count(*) FROM {$.__citta_write_batch} alias) <> 20"


labels

labels: string[]

Labels defining where the validation is executed within the pipeline. During a write operation, validations matching the objectId and any of these labels are run.


metadata

metadata: object

Stores metadata for client-specific use.


name

name: string

Display name of the validation.


objectId

objectId: number

ID of the object the validation applies to.


objectSqlPredicate

objectSqlPredicate: string

A custom SQL-like predicate referencing objects instead of table names. Example predicate: "EXISTS (SELECT * FROM {$.__citta_object.} obj1 WHERE obj1. <> )"

  • {$.__citta_object.} refers to an object (case-insensitive).

Special reference:

  • {$.__citta_write_batch}: Accesses all records in the current batch for aggregate validations. Example for limiting uploads to 20 records: "(SELECT count(*) FROM {$.__citta_write_batch} alias) <> 20"


skipBatchOnAggregationError

Optional skipBatchOnAggregationError: boolean

If true, the entire batch is skipped if there is any aggregation error. If false, aggregation errors are logged but the batch is processed.

Last updated