-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from offline-agency/feat-add-product-entity
feat: add Acquisti, Corrispettivi, Magazzino
- Loading branch information
Showing
6 changed files
with
312 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<?php | ||
|
||
namespace OfflineAgency\FattureInCloud\Entities; | ||
|
||
use Exception; | ||
use OfflineAgency\FattureInCloud\FattureInCloud; | ||
use OfflineAgency\FattureInCloud\Requests\Acquisti as Request; | ||
|
||
class Acquisti extends FattureInCloud | ||
{ | ||
/** | ||
* @param array $data | ||
* @return mixed|string | ||
* | ||
* @throws Exception | ||
*/ | ||
public function lista($data = []) | ||
{ | ||
Request::lista($data); | ||
|
||
return $this->auth->post('acquisti/lista', $data); | ||
} | ||
|
||
/** | ||
* @param array $data | ||
* @return mixed|string | ||
* | ||
* @throws Exception | ||
*/ | ||
public function dettagli($data = []) | ||
{ | ||
Request::dettagli($data); | ||
|
||
return $this->auth->post('acquisti/dettagli', $data); | ||
} | ||
|
||
/** | ||
* @param array $data | ||
* @return mixed|string | ||
* | ||
* @throws Exception | ||
*/ | ||
public function nuovo($data = []) | ||
{ | ||
Request::nuovo($data); | ||
|
||
return $this->auth->post('acquisti/nuovo', $data); | ||
} | ||
|
||
/** | ||
* @param array $data | ||
* @return mixed|string | ||
* | ||
* @throws Exception | ||
*/ | ||
public function modifica($data = []) | ||
{ | ||
Request::modifica($data); | ||
|
||
return $this->auth->post('acquisti/modifica', $data); | ||
} | ||
|
||
/** | ||
* @param array $data | ||
* @return mixed|string | ||
* | ||
* @throws Exception | ||
*/ | ||
public function elimina($data = []) | ||
{ | ||
Request::elimina($data); | ||
|
||
return $this->auth->post('acquisti/elimina', $data); | ||
} | ||
|
||
/** | ||
* @param array $data | ||
* @return mixed|string | ||
* | ||
* @throws Exception | ||
*/ | ||
public function info($data = []) | ||
{ | ||
Request::info($data); | ||
|
||
return $this->auth->post('acquisti/info', $data); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<?php | ||
|
||
namespace OfflineAgency\FattureInCloud\Entities; | ||
|
||
use OfflineAgency\FattureInCloud\FattureInCloud; | ||
use OfflineAgency\FattureInCloud\Requests\Corrispettivi as Request; | ||
|
||
class Corrispettivi extends FattureInCloud | ||
{ | ||
/** | ||
* @param array $data | ||
* @return mixed|string | ||
* | ||
* @throws Exception | ||
*/ | ||
public function lista($data = []) | ||
{ | ||
Request::lista($data); | ||
|
||
return $this->auth->post('corrispettivi/lista', $data); | ||
} | ||
|
||
/** | ||
* @param array $data | ||
* @return mixed|string | ||
* | ||
* @throws Exception | ||
*/ | ||
public function dettagli($data = []) | ||
{ | ||
Request::dettagli($data); | ||
|
||
return $this->auth->post('corrispettivi/dettagli', $data); | ||
} | ||
|
||
/** | ||
* @param array $data | ||
* @return mixed|string | ||
* | ||
* @throws Exception | ||
*/ | ||
public function nuovo($data = []) | ||
{ | ||
Request::nuovo($data); | ||
|
||
return $this->auth->post('corrispettivi/nuovo', $data); | ||
} | ||
|
||
/** | ||
* @param array $data | ||
* @return mixed|string | ||
* | ||
* @throws Exception | ||
*/ | ||
public function modifica($data = []) | ||
{ | ||
Request::modifica($data); | ||
|
||
return $this->auth->post('corrispettivi/modifica', $data); | ||
} | ||
|
||
/** | ||
* @param array $data | ||
* @return mixed|string | ||
* | ||
* @throws Exception | ||
*/ | ||
public function elimina($data = []) | ||
{ | ||
Request::elimina($data); | ||
|
||
return $this->auth->post('corrispettivi/elimina', $data); | ||
} | ||
|
||
/** | ||
* @param array $data | ||
* @return mixed|string | ||
* | ||
* @throws Exception | ||
*/ | ||
public function info($data = []) | ||
{ | ||
Request::info($data); | ||
|
||
return $this->auth->post('corrispettivi/info', $data); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace OfflineAgency\FattureInCloud\Entities; | ||
|
||
use Exception; | ||
use OfflineAgency\FattureInCloud\FattureInCloud; | ||
use OfflineAgency\FattureInCloud\Requests\Magazzino as Request; | ||
|
||
class Magazzino extends FattureInCloud | ||
{ | ||
/** | ||
* @param array $data | ||
* @return mixed|string | ||
* | ||
* @throws Exception | ||
*/ | ||
public function lista($data = []) | ||
{ | ||
Request::lista($data); | ||
|
||
return $this->auth->post('arrivimerce/lista', $data); | ||
} | ||
|
||
/** | ||
* @param array $data | ||
* @return mixed|string | ||
* | ||
* @throws Exception | ||
*/ | ||
public function dettagli($data = []) | ||
{ | ||
Request::dettagli($data); | ||
|
||
return $this->auth->post('arrivimerce/dettaglio', $data); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?php | ||
|
||
namespace OfflineAgency\FattureInCloud\Requests; | ||
|
||
use Exception; | ||
|
||
class Corrispettivi | ||
{ | ||
/** | ||
* @param array $data | ||
* @return array | ||
* | ||
* @throws Exception | ||
*/ | ||
public static function lista(array $data) | ||
{ | ||
$allowed = ['anno', 'tipo', 'data_inizio', 'data_fine', 'id']; | ||
|
||
$required = ['anno']; | ||
|
||
return Common::parseData($data, $allowed, $required); | ||
} | ||
|
||
/** | ||
* @param array $data | ||
* @return array | ||
* | ||
* @throws Exception | ||
*/ | ||
public static function nuovo(array $data) | ||
{ | ||
$allowed = ['tipo', 'data', 'protocollo_auto', 'protocollo', 'protocollo', 'desc', 'centro_ricavo', 'metodo', 'importi_ivati', 'lista_righe']; | ||
|
||
$required = ['tipo']; | ||
|
||
return Common::parseData($data, $allowed, $required); | ||
} | ||
|
||
/** | ||
* @param array $data | ||
* @return array | ||
* | ||
* @throws Exception | ||
*/ | ||
public static function modifica(array $data) | ||
{ | ||
$allowed = ['id', 'tipo', 'data', 'protocollo_auto', 'protocollo', 'protocollo', 'desc', 'centro_ricavo', 'metodo', 'importi_ivati', 'lista_righe']; | ||
|
||
$required = ['id', 'tipo']; | ||
|
||
return Common::parseData($data, $allowed, $required); | ||
} | ||
|
||
/** | ||
* @param array $data | ||
* @return array | ||
* | ||
* @throws Exception | ||
*/ | ||
public static function elimina(array $data) | ||
{ | ||
$allowed = ['id']; | ||
|
||
$required = ['id']; | ||
|
||
return Common::parseData($data, $allowed, $required); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace OfflineAgency\FattureInCloud\Requests; | ||
|
||
use Exception; | ||
|
||
class Magazzino | ||
{ | ||
public static function lista(array $data) | ||
{ | ||
$allowed = ['anno', 'data_inizio', 'data_fine', 'fornitore', 'id_fornitore', 'mostra_link_allegato']; | ||
|
||
$required = ['anno']; | ||
|
||
return Common::parseData($data, $allowed, $required); | ||
} | ||
|
||
/** | ||
* @param array $data | ||
* @return array | ||
* | ||
* @throws Exception | ||
*/ | ||
public static function dettagli(array $data) | ||
{ | ||
$allowed = ['id']; | ||
|
||
$required = ['id']; | ||
|
||
return Common::parseData($data, $allowed, $required); | ||
} | ||
} |