Add message if BIC already exist
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Jorge Padawan 2021-01-21 10:48:25 +01:00
parent fe6124b691
commit 05d6484a33
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,11 @@
module.exports = Self => {
Self.validatesPresenceOf('name', {
message: 'Name cannot be blank'
});
Self.validatesPresenceOf('bic', {
message: 'Swift / BIC cannot be empty'
});
Self.validatesUniquenessOf('bic', {
message: 'This BIC already exist.'
});
};

View File

@ -0,0 +1,29 @@
{
"name": "BankEntity",
"base": "VnModel",
"options": {
"mysql": {
"table": "bankEntity"
}
},
"properties": {
"id": {
"type": "Number",
"id": true,
"description": "Identifier"
},
"bic": {
"type": "String"
},
"name": {
"type": "String"
}
},
"relations": {
"country": {
"type": "belongsTo",
"model": "Country",
"foreignKey": "countryFk"
}
}
}