salix/services/ticket/common/models/ticket-packaging.js

14 lines
395 B
JavaScript

module.exports = function(Self) {
Self.validateBinded('quantity', validateQuantity, {
message: 'Enter an integer different to zero',
allowNull: false,
allowBlank: false
});
function validateQuantity(quantity) {
return !isNaN(quantity) && quantity != 0;
}
Self.validatesPresenceOf('packagingFk', {message: 'The package cannot be blank'});
};