Reorden Toku
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Incoviba\Repository\MediosPago\Toku;
|
||||
namespace Incoviba\Repository\Venta\MediosPago\Toku;
|
||||
|
||||
use DateTimeImmutable;
|
||||
use Incoviba\Common\Define;
|
||||
@ -20,7 +20,7 @@ class Customer extends Ideal\Repository
|
||||
return 'teku_customers';
|
||||
}
|
||||
|
||||
public function create(?array $data = null): Model\MediosPago\Toku\Customer
|
||||
public function create(?array $data = null): Model\Venta\MediosPago\Toku\Customer
|
||||
{
|
||||
$map = (new Implement\Repository\MapperParser(['toku_id']))
|
||||
->register('rut', (new Implement\Repository\Mapper())
|
||||
@ -30,9 +30,9 @@ class Customer extends Ideal\Repository
|
||||
return $this->personaService->getById($rut);
|
||||
})
|
||||
);
|
||||
return $this->parseData(new Model\MediosPago\Toku\Customer(), $data, $map);
|
||||
return $this->parseData(new Model\Venta\MediosPago\Toku\Customer(), $data, $map);
|
||||
}
|
||||
public function save(Define\Model $model): Model\MediosPago\Toku\Customer
|
||||
public function save(Define\Model $model): Model\Venta\MediosPago\Toku\Customer
|
||||
{
|
||||
$model->id = $this->saveNew(
|
||||
['rut', 'toku_id', 'created_at'],
|
||||
@ -40,17 +40,17 @@ class Customer extends Ideal\Repository
|
||||
);
|
||||
return $model;
|
||||
}
|
||||
public function edit(Define\Model $model, array $new_data): Model\MediosPago\Toku\Customer
|
||||
public function edit(Define\Model $model, array $new_data): Model\Venta\MediosPago\Toku\Customer
|
||||
{
|
||||
return $this->update($model, ['rut', 'toku_id', 'updated_at'], array_merge($new_data, ['updated_at' => (new DateTimeImmutable())->format('Y-m-d H:i:s.u')]));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $rut
|
||||
* @return Model\MediosPago\Toku\Customer
|
||||
* @return \Incoviba\Model\Venta\MediosPago\Toku\Customer
|
||||
* @throws Implement\Exception\EmptyResult
|
||||
*/
|
||||
public function fetchByRut(string $rut): Model\MediosPago\Toku\Customer
|
||||
public function fetchByRut(string $rut): Model\Venta\MediosPago\Toku\Customer
|
||||
{
|
||||
if (str_contains($rut, '-')) {
|
||||
$rut = str_replace('-', '', $rut);
|
||||
@ -68,10 +68,10 @@ class Customer extends Ideal\Repository
|
||||
|
||||
/**
|
||||
* @param string $toku_id
|
||||
* @return Model\MediosPago\Toku\Customer
|
||||
* @return \Incoviba\Model\Venta\MediosPago\Toku\Customer
|
||||
* @throws Implement\Exception\EmptyResult
|
||||
*/
|
||||
public function fetchByTokuId(string $toku_id): Model\MediosPago\Toku\Customer
|
||||
public function fetchByTokuId(string $toku_id): Model\Venta\MediosPago\Toku\Customer
|
||||
{
|
||||
$query = $this->connection->getQueryBuilder()
|
||||
->select()
|
@ -1,12 +1,12 @@
|
||||
<?php
|
||||
namespace Incoviba\Repository\MediosPago\Toku;
|
||||
namespace Incoviba\Repository\Venta\MediosPago\Toku;
|
||||
|
||||
use DateTimeImmutable;
|
||||
use Incoviba\Common\Define;
|
||||
use Incoviba\Common\Ideal;
|
||||
use Incoviba\Common\Implement;
|
||||
use Incoviba\Repository;
|
||||
use Incoviba\Model;
|
||||
use Incoviba\Repository;
|
||||
|
||||
class Invoice extends Ideal\Repository
|
||||
{
|
||||
@ -19,7 +19,7 @@ class Invoice extends Ideal\Repository
|
||||
{
|
||||
return 'toku_invoices';
|
||||
}
|
||||
public function create(?array $data = null): Model\MediosPago\Toku\Invoice
|
||||
public function create(?array $data = null): Model\Venta\MediosPago\Toku\Invoice
|
||||
{
|
||||
$map = (new Implement\Repository\MapperParser(['toku_id']))
|
||||
->register('cuota_id', (new Implement\Repository\Mapper())
|
||||
@ -27,9 +27,9 @@ class Invoice extends Ideal\Repository
|
||||
->setFunction(function($data) {
|
||||
return $this->cuotaRepository->fetchById($data['cuota_id']);
|
||||
}));
|
||||
return $this->parseData(new Model\MediosPago\Toku\Invoice(), $data, $map);
|
||||
return $this->parseData(new Model\Venta\MediosPago\Toku\Invoice(), $data, $map);
|
||||
}
|
||||
public function save(Define\Model $model): Model\MediosPago\Toku\Invoice
|
||||
public function save(Define\Model $model): Model\Venta\MediosPago\Toku\Invoice
|
||||
{
|
||||
$model->id = $this->saveNew(
|
||||
['cuota_id', 'toku_id', 'created_at'],
|
||||
@ -37,17 +37,17 @@ class Invoice extends Ideal\Repository
|
||||
);
|
||||
return $model;
|
||||
}
|
||||
public function edit(Define\Model $model, array $new_data): Model\MediosPago\Toku\Invoice
|
||||
public function edit(Define\Model $model, array $new_data): Model\Venta\MediosPago\Toku\Invoice
|
||||
{
|
||||
return $this->update($model, ['cuota_id', 'toku_id', 'updated_at'], array_merge($new_data, ['updated_at' => (new DateTimeImmutable())->format('Y-m-d H:i:s.u')]));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $cuota_id
|
||||
* @return Model\MediosPago\Toku\Invoice
|
||||
* @return \Incoviba\Model\Venta\MediosPago\Toku\Invoice
|
||||
* @throws Implement\Exception\EmptyResult
|
||||
*/
|
||||
public function fetchByCuota(int $cuota_id): Model\MediosPago\Toku\Invoice
|
||||
public function fetchByCuota(int $cuota_id): Model\Venta\MediosPago\Toku\Invoice
|
||||
{
|
||||
$query = $this->connection->getQueryBuilder()
|
||||
->select()
|
||||
@ -58,10 +58,10 @@ class Invoice extends Ideal\Repository
|
||||
|
||||
/**
|
||||
* @param string $toku_id
|
||||
* @return Model\MediosPago\Toku\Invoice
|
||||
* @return \Incoviba\Model\Venta\MediosPago\Toku\Invoice
|
||||
* @throws Implement\Exception\EmptyResult
|
||||
*/
|
||||
public function fetchByTokuId(string $toku_id): Model\MediosPago\Toku\Invoice
|
||||
public function fetchByTokuId(string $toku_id): Model\Venta\MediosPago\Toku\Invoice
|
||||
{
|
||||
$query = $this->connection->getQueryBuilder()
|
||||
->select()
|
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
namespace Incoviba\Repository\MediosPago\Toku;
|
||||
namespace Incoviba\Repository\Venta\MediosPago\Toku;
|
||||
|
||||
use DateTimeImmutable;
|
||||
use Incoviba\Common\Ideal;
|
||||
use Incoviba\Common\Define;
|
||||
use Incoviba\Common\Ideal;
|
||||
use Incoviba\Common\Implement;
|
||||
use Incoviba\Model;
|
||||
use Incoviba\Repository;
|
||||
@ -20,7 +20,7 @@ class Subscription extends Ideal\Repository
|
||||
return 'toku_subscriptions';
|
||||
}
|
||||
|
||||
public function create(?array $data = null): Model\MediosPago\Toku\Subscription
|
||||
public function create(?array $data = null): Model\Venta\MediosPago\Toku\Subscription
|
||||
{
|
||||
$map = (new Implement\Repository\MapperParser(['toku_id']))
|
||||
->register('venta_id', (new Implement\Repository\Mapper())
|
||||
@ -28,9 +28,9 @@ class Subscription extends Ideal\Repository
|
||||
->setFunction(function($data) {
|
||||
return $this->ventaRepository->fetchById($data['venta_id']);
|
||||
}));
|
||||
return $this->parseData(new Model\MediosPago\Toku\Subscription(), $data, $map);
|
||||
return $this->parseData(new Model\Venta\MediosPago\Toku\Subscription(), $data, $map);
|
||||
}
|
||||
public function save(Define\Model $model): Model\MediosPago\Toku\Subscription
|
||||
public function save(Define\Model $model): Model\Venta\MediosPago\Toku\Subscription
|
||||
{
|
||||
$model->id = $this->saveNew(
|
||||
['venta_id', 'toku_id', 'created_at'],
|
||||
@ -38,12 +38,12 @@ class Subscription extends Ideal\Repository
|
||||
);
|
||||
return $model;
|
||||
}
|
||||
public function edit(Define\Model $model, array $new_data): Model\MediosPago\Toku\Subscription
|
||||
public function edit(Define\Model $model, array $new_data): Model\Venta\MediosPago\Toku\Subscription
|
||||
{
|
||||
return $this->update($model, ['venta_id', 'toku_id', 'updated_at'], array_merge($new_data, ['updated_at' => (new DateTimeImmutable())->format('Y-m-d H:i:s.u')]));
|
||||
}
|
||||
|
||||
public function fetchByVenta(int $venta_id): Model\MediosPago\Toku\Subscription
|
||||
public function fetchByVenta(int $venta_id): Model\Venta\MediosPago\Toku\Subscription
|
||||
{
|
||||
$query = $this->connection->getQueryBuilder()
|
||||
->select()
|
||||
@ -51,7 +51,7 @@ class Subscription extends Ideal\Repository
|
||||
->where('venta_id = :venta_id');
|
||||
return $this->fetchOne($query, compact('venta_id'));
|
||||
}
|
||||
public function fetchByTokuId(string $toku_id): Model\MediosPago\Toku\Subscription
|
||||
public function fetchByTokuId(string $toku_id): Model\Venta\MediosPago\Toku\Subscription
|
||||
{
|
||||
$query = $this->connection->getQueryBuilder()
|
||||
->select()
|
Reference in New Issue
Block a user