From a712c7c683898e71279769215e99a34cf2ef2568 Mon Sep 17 00:00:00 2001 From: sheilagomes Date: Wed, 11 Sep 2024 13:47:04 -0300 Subject: [PATCH] Add Netherlands rules --- CHANGELOG.md | 4 +++ react/rules/NLD.js | 72 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 react/rules/NLD.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f13187..d1e958b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Added + +- Netherlands ('NLD') country rules. + ## [2.20.4] - 2024-06-04 ### Added diff --git a/react/rules/NLD.js b/react/rules/NLD.js new file mode 100644 index 0000000..1684448 --- /dev/null +++ b/react/rules/NLD.js @@ -0,0 +1,72 @@ +import msk from 'msk' +import { isPastDate } from '../utils/dateRules' + +export default { + country: 'NLD', + personalFields: [ + { + name: 'firstName', + maxLength: 100, + label: 'firstName', + required: true, + }, + { + name: 'lastName', + maxLength: 100, + label: 'lastName', + required: true, + }, + { + name: 'email', + maxLength: 100, + label: 'email', + hidden: true, + }, + { + name: 'document', + maxLength: 50, + label: 'document', + required: false, + }, + { + name: 'homePhone', + maxLength: 30, + label: 'homePhone', + }, + { + name: 'gender', + maxLength: 30, + label: 'gender', + }, + { + name: 'birthDate', + maxLength: 30, + label: 'birthDate', + type: 'date', + validate: isPastDate, + mask: (value) => msk.fit(value, '99.99.9999'), + }, + ], + businessFields: [ + { + name: 'corporateName', + maxLength: 100, + label: 'corporateName', + }, + { + name: 'tradeName', + maxLength: 100, + label: 'tradeName', + }, + { + name: 'corporateDocument', + maxLength: 30, + label: 'corporateDocument', + }, + { + name: 'businessPhone', + maxLength: 30, + label: 'businessPhone', + }, + ], +}