Skip to content

NumberRuleOptions

Defined in: packages/ddd-core/domain/rules/number.rule.ts:7

Options of numberRule.

readonly optional error?: ValueViolationError

Defined in: packages/ddd-core/domain/rules/number.rule.ts:28

Builds the error thrown for a violation. Defaults to InvalidValueException.


readonly field: string

Defined in: packages/ddd-core/domain/rules/number.rule.ts:9

Field name reported in the violation and in the default message.


readonly optional integer?: boolean

Defined in: packages/ddd-core/domain/rules/number.rule.ts:19

true accepts safe integers only (Number.isSafeInteger), so the value survives a round trip through JSON and a bigint column.


readonly optional max?: number

Defined in: packages/ddd-core/domain/rules/number.rule.ts:23

Largest accepted value, inclusive.


readonly optional min?: number

Defined in: packages/ddd-core/domain/rules/number.rule.ts:21

Smallest accepted value, inclusive.


readonly optional required?: boolean

Defined in: packages/ddd-core/domain/rules/number.rule.ts:14

false accepts null and undefined, and normalizes them to null. Defaults to true: they are a required violation.