feature/cuotas-abono-escritura #1

Merged
aldarien merged 15 commits from feature/cuotas-abono-escritura into develop 2024-11-28 19:24:49 -03:00
19 changed files with 282 additions and 2115 deletions
Showing only changes of commit b13f8a5b20 - Show all commits

View File

@ -8,6 +8,7 @@ class Cuota extends Ideal\Model
{
public Model\Venta $venta;
public Model\Venta\Pago $pago;
public int $numero;
public function jsonSerialize(): mixed
{

View File

@ -14,11 +14,12 @@ class Cuota extends Ideal\Repository
protected Repository\Venta\Pago $pagoRepository)
{
parent::__construct($connection);
$this->setTable('venta_abono_cuotas');
}
public function create(?array $data = null): Model\Venta\Abono\Cuota
{
$map = (new Implement\Repository\MapperParser())
$map = (new Implement\Repository\MapperParser(['numero']))
->register('venta_id', (new Implement\Repository\Mapper())
->setProperty('venta')
->setFunction(function($data) {
@ -36,13 +37,13 @@ class Cuota extends Ideal\Repository
public function save(Define\Model $model): Model\Venta\Abono\Cuota
{
$model->id = $this->saveNew(['venta_id', 'pago_id'], [$model->venta->id, $model->pago->id]);
$model->id = $this->saveNew(['venta_id', 'pago_id', 'numero'], [$model->venta->id, $model->pago->id, $model->numero]);
return $model;
}
public function edit(Define\Model $model, array $new_data): Model\Venta\Abono\Cuota
{
return $this->update($model, ['venta_id', 'pago_id'], $new_data);
return $this->update($model, ['venta_id', 'pago_id', 'numero'], $new_data);
}
/**