salix/services/ticket/common/models/ticketPackaging.js

16 lines
444 B
JavaScript
Raw Normal View History

2018-03-21 10:08:59 +00:00
module.exports = function(Self) {
require('../methods/packaging/crudTicketPackaging')(Self);
Self.validateBinded('quantity', validateQuantity, {
message: 'Quantity cannot be zero',
allowNull: false,
allowBlank: false
});
function validateQuantity(quantity) {
return !isNaN(quantity) && quantity != 0;
2018-03-21 10:08:59 +00:00
}
Self.validatesPresenceOf('packagingFk', {message: 'Package cannot be blank'});
};