develop (#45)
Co-authored-by: Juan Pablo Vial <jpvialb@incoviba.cl> Reviewed-on: #45
This commit is contained in:
@ -5,6 +5,11 @@ use Psr\Http\Message\UploadedFileInterface;
|
||||
|
||||
interface Banco
|
||||
{
|
||||
/**
|
||||
* Process bank movements for database inserts
|
||||
* @param UploadedFileInterface $file
|
||||
* @return array
|
||||
*/
|
||||
public function process(UploadedFileInterface $file): array;
|
||||
|
||||
}
|
||||
|
@ -3,13 +3,42 @@ namespace Incoviba\Common\Define;
|
||||
|
||||
use PDO;
|
||||
use PDOStatement;
|
||||
use PDOException;
|
||||
|
||||
interface Connection
|
||||
{
|
||||
/**
|
||||
* @return Connection
|
||||
* @throws PDOException
|
||||
*/
|
||||
public function connect(): Connection;
|
||||
|
||||
/**
|
||||
* @param string $query
|
||||
* @return PDOStatement
|
||||
* @throws PDOException
|
||||
*/
|
||||
public function query(string $query): PDOStatement;
|
||||
|
||||
/**
|
||||
* @param string $query
|
||||
* @return PDOStatement
|
||||
* @throws PDOException
|
||||
*/
|
||||
public function prepare(string $query): PDOStatement;
|
||||
|
||||
/**
|
||||
* @param string $query
|
||||
* @param array|null $data
|
||||
* @return PDOStatement
|
||||
* @throws PDOException
|
||||
*/
|
||||
public function execute(string $query, ?array $data = null): PDOStatement;
|
||||
|
||||
/**
|
||||
* @return PDO
|
||||
* @throws PDOException
|
||||
*/
|
||||
public function getPDO(): PDO;
|
||||
public function getQueryBuilder(): Query\Builder;
|
||||
}
|
||||
|
@ -6,5 +6,5 @@ use Incoviba\Model;
|
||||
|
||||
interface Exporter
|
||||
{
|
||||
public function export(Model\Inmobiliaria $inmobiliaria, Model\Banco $banco, DateTimeInterface $mes, array $movimientos): string;
|
||||
public function export(Model\Inmobiliaria $inmobiliaria, Model\Contabilidad\Banco $banco, DateTimeInterface $mes, array $movimientos): string;
|
||||
}
|
||||
|
@ -2,8 +2,15 @@
|
||||
namespace Incoviba\Common\Define\Money;
|
||||
|
||||
use DateTimeInterface;
|
||||
use Incoviba\Common\Implement\Exception\EmptyResponse;
|
||||
|
||||
interface Provider
|
||||
{
|
||||
public function get(string $money_symbol, DateTimeInterface $dateTime): float;
|
||||
/**
|
||||
* @param string $money_symbol
|
||||
* @param ?DateTimeInterface $dateTime = null
|
||||
* @return float
|
||||
* @throws EmptyResponse
|
||||
*/
|
||||
public function get(string $money_symbol, ?DateTimeInterface $dateTime = null): float;
|
||||
}
|
||||
|
@ -1,11 +1,42 @@
|
||||
<?php
|
||||
namespace Incoviba\Common\Define;
|
||||
|
||||
use Incoviba\Common\Implement\Exception\EmptyResult;
|
||||
use PDOException;
|
||||
|
||||
interface Repository
|
||||
{
|
||||
/**
|
||||
* @param array|null $data
|
||||
* @return Model
|
||||
*/
|
||||
public function create(?array $data = null): Model;
|
||||
|
||||
/**
|
||||
* @param Model $model
|
||||
* @return Model
|
||||
* @throws PDOException
|
||||
*/
|
||||
public function save(Model $model): Model;
|
||||
|
||||
/**
|
||||
* @param array $data_row
|
||||
* @return Model
|
||||
*/
|
||||
public function load(array $data_row): Model;
|
||||
|
||||
/**
|
||||
* @param Model $model
|
||||
* @param array $new_data
|
||||
* @return Model
|
||||
* @throws EmptyResult
|
||||
*/
|
||||
public function edit(Model $model, array $new_data): Model;
|
||||
|
||||
/**
|
||||
* @param Model $model
|
||||
* @return void
|
||||
* @throws PDOException
|
||||
*/
|
||||
public function remove(Model $model): void;
|
||||
}
|
||||
|
Reference in New Issue
Block a user