From a60182abc4b82a3cb239dabab5b7b3f872f1012f Mon Sep 17 00:00:00 2001 From: Matteo Date: Thu, 7 Nov 2024 11:11:10 +0100 Subject: [PATCH] feat: aggiunta risorsa api per pagamenti --- modules/pagamenti/src/API/v1/Pagamenti.php | 50 ++++++++++++++++++++++ update/2_6.sql | 5 ++- 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 modules/pagamenti/src/API/v1/Pagamenti.php diff --git a/modules/pagamenti/src/API/v1/Pagamenti.php b/modules/pagamenti/src/API/v1/Pagamenti.php new file mode 100644 index 000000000..d540dd7be --- /dev/null +++ b/modules/pagamenti/src/API/v1/Pagamenti.php @@ -0,0 +1,50 @@ +. + */ + +namespace Modules\Pagamenti\API\v1; + +use API\Interfaces\RetrieveInterface; +use API\Resource; +use Modules\Pagamenti\Pagamento; + +class Pagamenti extends Resource implements RetrieveInterface +{ + public function retrieve($request) + { + // Periodo per selezionare interventi + $user = \Auth::user(); + + $table = 'co_pagamenti'; + + $select = [ + 'co_pagamenti.*' + ]; + + $where = []; + + $group = 'co_pagamenti.id'; + + return [ + 'table' => $table, + 'select' => $select, + 'where' => $where, + 'group' => $group, + ]; + } +} \ No newline at end of file diff --git a/update/2_6.sql b/update/2_6.sql index 02350c106..9967a6e6d 100644 --- a/update/2_6.sql +++ b/update/2_6.sql @@ -96,4 +96,7 @@ UPDATE `zz_views_lang` SET `title` = 'emailto_Email' WHERE `zz_views_lang`.`id_r ALTER TABLE `mg_articoli` ADD `modello` VARCHAR(255) NULL AFTER `id_marchio`; -- Fix filtro segmento Non completate in Attività -UPDATE `zz_segments` SET `clause` = 'in_interventi.idstatointervento NOT IN(SELECT in_statiintervento.id FROM in_statiintervento WHERE is_completato=1)' WHERE `zz_segments`.`name` = 'Non completate' AND `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Interventi'); \ No newline at end of file +UPDATE `zz_segments` SET `clause` = 'in_interventi.idstatointervento NOT IN(SELECT in_statiintervento.id FROM in_statiintervento WHERE is_completato=1)' WHERE `zz_segments`.`name` = 'Non completate' AND `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Interventi'); + +INSERT INTO `zz_api_resources` (`id`, `version`, `type`, `resource`, `class`, `enabled`) VALUES +(NULL, 'v1', 'retrieve', 'pagamenti', 'Modules\\Pagamenti\\API\\v1\\Pagamenti', 1); \ No newline at end of file