Make points per draw optional
dyb-tech.com/LaLiga-BackEnd/pipeline/head This commit looks good

This commit is contained in:
2024-07-25 01:08:32 +02:00
parent 25d3d7c12c
commit af3a0167e4
+2 -2
View File
@@ -71,7 +71,7 @@ class SeasonDto
{
$this->pointsPerWin = (int) $dataList['pointsPerWin'];
}
if (isset($dataList['pointsPerDraw']))
if (empty($dataList['pointsPerDraw']))
{
$this->pointsPerDraw = (int) $dataList['pointsPerDraw'];
}
@@ -206,7 +206,7 @@ class SeasonDto
{
$this->validationErrors[] = 'Los puntos por empate deben ser inferiores a los puntos por partido ganado.';
}
if (isset($this->pointsPerDraw, $this->pointsPerLoss) && ($this->pointsPerDraw < $this->pointsPerLoss))
if (isset($this->pointsPerDraw, $this->pointsPerLoss) && ($this->pointsPerDraw > 0) && ($this->pointsPerDraw < $this->pointsPerLoss))
{
$this->validationErrors[] = 'Los puntos por empate deben ser superiores a los puntos por partido perdido.';
}