2018-03-16 14:06:42 +00:00
|
|
|
module.exports = function(Self) {
|
2018-08-30 09:02:50 +00:00
|
|
|
/* Self.validateAsync('observationTypeFk', validateObservationUniqueness, {
|
|
|
|
message: `The observation type can't be repeated`
|
|
|
|
});
|
|
|
|
|
|
|
|
async function validateObservationUniqueness(err, done) {
|
|
|
|
let observationExists = await Self.findOne({
|
|
|
|
where: {
|
|
|
|
ticketFk: this.ticketFk,
|
|
|
|
observationTypeFk: this.observationTypeFk
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
if (observationExists)
|
|
|
|
err();
|
|
|
|
|
|
|
|
done();
|
|
|
|
} */
|
2018-03-16 14:06:42 +00:00
|
|
|
};
|