fix: refs #7031 fix vnPrice
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Carlos Satorres 2024-12-05 08:31:09 +01:00
parent fad6f33b7c
commit 483966501a
4 changed files with 24 additions and 9 deletions

View File

@ -1,2 +1,2 @@
ALTER TABLE `zone` MODIFY COLUMN `price` DECIMAL(10,2) NOT NULL DEFAULT 0.00 CHECK (`price` > 0);
ALTER TABLE vn.`zone` MODIFY COLUMN `price` DECIMAL(10,2);

View File

@ -247,5 +247,6 @@
"The raid information is not correct": "The raid information is not correct",
"Payment method is required": "Payment method is required",
"Sales already moved": "Sales already moved",
"There are tickets to be invoiced": "There are tickets to be invoiced for this zone, please delete them first"
"There are tickets to be invoiced": "There are tickets to be invoiced for this zone, please delete them first",
"Price cannot be blank": "Price cannot be blank"
}

View File

@ -390,6 +390,6 @@
"The web user's email already exists": "El correo del usuario web ya existe",
"Sales already moved": "Ya han sido transferidas",
"The raid information is not correct": "La información de la redada no es correcta",
"There are tickets to be invoiced": "Hay tickets para esta zona, borralos primero"
"There are tickets to be invoiced": "Hay tickets para esta zona, borralos primero",
"Price cannot be blank": "Price cannot be blank"
}

View File

@ -14,4 +14,18 @@ module.exports = Self => {
Self.validatesPresenceOf('agencyModeFk', {
message: `Agency cannot be blank`
});
Self.validatesPresenceOf('price', {
message: 'Price cannot be blank'
});
Self.validateAsync('price', priceIsValid, {
message: 'Price must be greater than 0'
});
async function priceIsValid(err, done) {
if (this.price <= 0)
err();
done();
}
};