/** * Custom validation rules for Magento 2 forms. * * This script modifies existing validation rules by removing certain rules * and adding custom logic where necessary. * * Author: Federico Esteche */ define([ 'Magento_Ui/js/lib/validation/validator', 'mage/translate' ], function (validator, $t) { 'use strict'; return function (target) { validator.addRule( 'validate-customer-status', function (value, params, data) { return !(data.customer && !data['is_active']); }, $t('The selected user is inactive. To continue, select another user or activate the current user.') ); // Note: The following rules have been intentionally removed: // - 'validate-async-company-email' // - 'validate-customer-company' return target; }; });