Merge pull request 'feat: #8258 added uppercase validation on supplier create' (!3368) from 8258-uppercaseInputs into dev
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #3368
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
This commit is contained in:
PAU ROVIRA ROSALENY 2025-01-20 06:01:20 +00:00
commit 5ef1d615a7
2 changed files with 4 additions and 2 deletions

View File

@ -398,5 +398,6 @@
"Holidays to past days not available": "Las vacaciones a días pasados no están disponibles", "Holidays to past days not available": "Las vacaciones a días pasados no están disponibles",
"All tickets have a route order": "Todos los tickets tienen orden de ruta", "All tickets have a route order": "Todos los tickets tienen orden de ruta",
"Price cannot be blank": "Price cannot be blank", "Price cannot be blank": "Price cannot be blank",
"There are tickets to be invoiced": "La zona tiene tickets por facturar" "There are tickets to be invoiced": "La zona tiene tickets por facturar",
"Social name should be uppercase": "La razón social debe ir en mayúscula"
} }

View File

@ -28,6 +28,7 @@ module.exports = Self => {
delete args.ctx; delete args.ctx;
if (!args.name) throw new UserError('The social name cannot be empty'); if (!args.name) throw new UserError('The social name cannot be empty');
if (args.name !== args.name.toUpperCase()) throw new UserError('Social name should be uppercase');
const data = {...args, ...{nickname: args.name}}; const data = {...args, ...{nickname: args.name}};
const supplier = await models.Supplier.create(data, myOptions); const supplier = await models.Supplier.create(data, myOptions);