columna faltante del modelo

This commit is contained in:
2023-11-28 22:12:15 -03:00
parent bcdca32075
commit 094209823a
2 changed files with 10 additions and 1 deletions

View File

@ -5,4 +5,12 @@ use Incoviba\Model;
class TipoEstadoPago extends Model\Tipo
{
public bool $activo;
public function jsonSerialize(): mixed
{
return array_merge(parent::jsonSerialize(), [
'activo' => $this->activo
]);
}
}

View File

@ -16,7 +16,8 @@ class TipoEstadoPago extends Ideal\Repository
public function create(?array $data = null): Define\Model
{
$map = new Implement\Repository\MapperParser(['descripcion']);
$map = (new Implement\Repository\MapperParser(['descripcion']))
->register('active', (new Implement\Repository\Mapper\Boolean('active', 'activo', true)));
return $this->parseData(new Model\Venta\TipoEstadoPago(), $data, $map);
}
public function save(Define\Model $model): Define\Model