diff --git a/services/client/common/models/client.js b/services/client/common/models/client.js index 0340042d3..60bdb4163 100644 --- a/services/client/common/models/client.js +++ b/services/client/common/models/client.js @@ -24,9 +24,6 @@ module.exports = function(Self) { Self.validatesUniquenessOf('fi', { message: 'El NIF/CIF debe ser único' }); - Self.validatesPresenceOf('socialName', { - message: 'Debe especificarse la razón social' - }); Self.validatesUniquenessOf('socialName', { message: 'La razón social debe ser única' }); diff --git a/services/client/common/models/client.json b/services/client/common/models/client.json index 223d6ef8f..e2600e0b4 100644 --- a/services/client/common/models/client.json +++ b/services/client/common/models/client.json @@ -22,7 +22,8 @@ "description": "Fiscal indentifier" }, "socialName": { - "type": "string" + "type": "string", + "required": true }, "contact": { "type": "string" diff --git a/services/client/common/models/greuge.js b/services/client/common/models/greuge.js index 8b1fc594a..9cf127d41 100644 --- a/services/client/common/models/greuge.js +++ b/services/client/common/models/greuge.js @@ -2,9 +2,6 @@ module.exports = function(Self) { require('../methods/greuge/filter.js')(Self); require('../methods/greuge/totalGreuge.js')(Self); - Self.validatesPresenceOf('description', 'amount', 'greugeTypeFk', { - message: 'Este campo es obligatorio' - }); Self.validatesLengthOf('description', { max: 45, message: 'La description debe tener maximo 45 caracteres' diff --git a/services/client/common/models/greuge.json b/services/client/common/models/greuge.json index 37c2c000a..c7a407341 100644 --- a/services/client/common/models/greuge.json +++ b/services/client/common/models/greuge.json @@ -14,10 +14,12 @@ "description": "Identifier" }, "description": { - "type": "String" + "type": "String", + "required": true }, "amount": { - "type": "Number" + "type": "Number", + "required": true }, "shipped": { "type": "date" @@ -35,7 +37,8 @@ "greugeType": { "type": "belongsTo", "model": "GreugeType", - "foreignKey": "greugeTypeFk" + "foreignKey": "greugeTypeFk", + "required": true } } } \ No newline at end of file