2612-create-supplier #1089

Merged
joan merged 21 commits from 2612-create-supplier into dev 2022-10-25 10:42:10 +00:00
1 changed files with 10 additions and 6 deletions
Showing only changes of commit 594cee12f3 - Show all commits

View File

@ -20,13 +20,17 @@ module.exports = Self => {
message: 'The supplier name must be unique'
});
Self.validatesPresenceOf('city', {
message: 'City cannot be empty'
});
if (this.city) {
Self.validatesPresenceOf('city', {
message: 'City cannot be empty'
});
}
Self.validatesPresenceOf('nif', {
message: 'The nif cannot be empty'
});
if (this.nif) {
Self.validatesPresenceOf('nif', {
message: 'The nif cannot be empty'
});
}
Self.validatesUniquenessOf('nif', {
message: 'TIN must be unique'