Skip to content

Commit

Permalink
rimosso codice inutile
Browse files Browse the repository at this point in the history
  • Loading branch information
esposimo committed Apr 7, 2024
1 parent 8f204c0 commit 1d37039
Show file tree
Hide file tree
Showing 17 changed files with 6 additions and 1,434 deletions.
12 changes: 0 additions & 12 deletions src/src/crawler/AbstractEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,6 @@ public function getIdCarrello(): string|null
{
return null;
}

/**
* @inheritDoc
*/
abstract public function getKey(int $index = 0): string|null;

/**
* @inheritDoc
*/
Expand All @@ -211,12 +205,6 @@ abstract public function transactionDetails(int $transfer, int $index = 0): Tran

abstract public function workflowEvent(int $index = 0): Workflow|null;


/**
* @inheritDoc
*/
abstract public function isValid(int $index = 0): bool;

/**
* @inheritDoc
*/
Expand Down
18 changes: 0 additions & 18 deletions src/src/crawler/EventInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,6 @@ public function getCcps() : array|null;
*/
public function getIdCarrello() : string|null;


/**
* Restituisce una chiave utile per storicizzare i dati in cache
* @param int $index
* @return string|null
*/
public function getKey(int $index = 0) : string|null;


/**
* Restituisce una istanza transaction per salvare la transazione sul db
* @param int $index
Expand All @@ -226,15 +217,6 @@ public function transactionDetails(int $transfer, int $index = 0) : TransactionD
*/
public function workflowEvent(int $index = 0) : Workflow|null;


/**
* Restituisce true/false se la transazione i-esima del carrello contiene elementi sufficienti
* @param int $index
* @return bool
*/
public function isValid(int $index = 0) : bool;


/**
* Restituisce l'istanza che gestisce il payload dell'evento
* @return MethodInterface
Expand Down
85 changes: 0 additions & 85 deletions src/src/crawler/PaymentListInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,91 +190,6 @@ public function isPaymentInCache(int $index = 0) : bool;
*/
public function isEnableSearch() : bool;


/**
* Restituisce true/false se è stato trovato il Payment sul DB
* @param int $index
* @return bool
*/
public function isFoundOnDb(int $index = 0) : bool;


/**
* Questo metodo viene eseguito quando vengono soddisfatte le seguenti condizioni (in cascata)
* Evento Valido
* Rappresenta un tentativo
* Il tentativo è in cache, ovvero ho già creato un tentativo di pagamento nella giornata odierna
* @param int $index
* @return void
*/
public function runAttemptAlreadyEvaluated(int $index = 0) : void;


/**
* <p>Questo metodo viene eseguito quando vengono soddisfatte le seguenti condizioni (in cascata)</p>
* <p>Evento Valido</p>
* <p>Rappresenta un tentativo</p>
* <p>Il tentativo non è in cache per la giornata odierna, quindi è la prima volta che vedo questo tentativo</p>
*
* <p>Restituisce un array nel seguente formato</p>
* <code>
* [
* 'date_event' => <data_evento> // Rappresenta la data del tentativo
* 'iuv' => <iuv> // Rappresenta lo iuv del tentativo
* 'pa_emittente' => <pa_emittente> // Rappresenta la pa emittente del tentativo
* 'token_ccp' => <token> // Rappresenta il token/ccp del tentativo
* 'id' => <id> // Rappresenta l'id univoco sulla tabella Transaction
* ]
* </code>
* @param int $index
* @return array
*/
public function runCreateAttempt(int $index = 0) : array;


/**
* Questo metodo viene eseguito quando vengono soddisfatte le seguenti condizioni
* Evento Valido
* Non rappresenta un tentativo
* Il Pagamento è in cache
* @param int $index
* @return void
*/
public function runPaymentAlreadyEvaluated(int $index = 0) : void;


/**
* <p>Questo metodo viene eseguito quando vengono soddisfatte le seguenti condizioni</p>
* <p>1. Evento Valido</p>
* <p>2. Non rappresenta un tentativo</p>
* <p>3. Il pagamento non è in cache</p>
*
* <p>Restituisce un array nel seguente formato</p>
* <code>
* [
* 'date_event' => <data_evento> // Rappresenta la data del tentativo
* 'iuv' => <iuv> // Rappresenta lo iuv del tentativo
* 'pa_emittente' => <pa_emittente> // Rappresenta la pa emittente del tentativo
* 'id' => <id> // Rappresenta l'id univoco sulla tabella Transaction
* ]
* </code>
* @return array
* /
*/
public function runCreatePayment(int $index = 0) : array;


/**
* Questo metodo viene eseguito quando vengono soddisfatte le seguenti condizioni
* Evento non valido
* Ricerca abilitata
* Trovato su DB
* @param int $index
* @return void
*/
public function runCopyPaymentToday(int $index = 0) : void;


/**
* Questo metodo viene eseguito quando vengono soddisfatte le seguenti condizioni
* Evento non valido
Expand Down
25 changes: 0 additions & 25 deletions src/src/crawler/events/req/activatePaymentNotice.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,6 @@ public function getBrokerPsp(): string|null
return $this->getMethodInterface()->getBrokerPsp();
}

/**
* @param int $index
* @return string
*/
public function getKey(int $index = 0): string
{
// TODO: Implement getKey() method.
}

/**
* @param int $index
* @return \pagopa\database\sherlock\Transaction|null
Expand Down Expand Up @@ -252,22 +243,6 @@ public function transaction(int $index = 0): Transaction|null
return $transaction;
}

/**
* @param int $index
* @return bool
*/
public function isValid(int $index = 0): bool
{
// un evento di activatePaymentNotice per essere valido deve contenere 4 valori
// data_event + iuv + pa_emittente + token_ccp
// se uno di questi 4 non è presente (=null) restituisco false
$iuv = $this->getIuv(0);
$pa = $this->getPaEmittente(0);
$token = $this->getPaymentToken(0);
$date = $this->getInsertedTimestamp()->format('Y-m-d');
return ($date && $iuv && $pa && $token);
}

/**
* @param int $index
* @return TransactionDetails|null
Expand Down
22 changes: 0 additions & 22 deletions src/src/crawler/events/req/nodoInviaCarrelloRPT.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,20 +152,6 @@ public function getBrokerPsp(): string|null
$e = explode('_', $broker, 2);
return $e[0];
}

/**
* @inheritDoc
*/
public function getKey(int $index = 0): string
{
$date = $this->getInsertedTimestamp()->format('Ymd');
$iuv = $this->getIuv($index);
$pa = $this->getPaEmittente($index);
$ccp = $this->getCcp($index);
$id_carrello = $this->getIdCarrello();
return base64_encode(sprintf('payment_%s_%s_%s_%s_%s', $date, $iuv, $pa, $ccp, $id_carrello));
}

/**
* @inheritDoc
*/
Expand Down Expand Up @@ -284,14 +270,6 @@ public function workflowEvent(int $index = 0): Workflow|null
return $workflow;
}

/**
* @inheritDoc
*/
public function isValid(int $index = 0): bool
{
return !empty($this->getColumn('sessionidoriginal'));
}

/**
* @inheritDoc
*/
Expand Down
19 changes: 0 additions & 19 deletions src/src/crawler/events/req/sendPaymentOutcome.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,6 @@ public function getBrokerPsp(): string|null
return $this->getMethodInterface()->getBrokerPsp();
}

/**
* @inheritDoc
*/
public function getKey(int $index = 0): string|null
{
// TODO: Implement getKey() method.
}

/**
* @inheritDoc
*/
Expand Down Expand Up @@ -202,17 +194,6 @@ public function workflowEvent(int $index = 0): Workflow|null
return $workflow;
}

/**
* @inheritDoc
*/
public function isValid(int $index = 0): bool
{
$iuv = $this->getIuv(0);
$pa = $this->getPaEmittente(0);
$token = $this->getPaymentToken(0);
return ($iuv && $pa && $token);
}

/**
* @inheritDoc
*/
Expand Down
22 changes: 0 additions & 22 deletions src/src/crawler/events/resp/activatePaymentNotice.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace pagopa\crawler\events\resp;

use pagopa\crawler\AbstractEvent;
use pagopa\crawler\FaultInterface;
use pagopa\crawler\MapEvents;
use pagopa\crawler\methods\resp\activatePaymentNotice as Payload;
use pagopa\database\sherlock\Transaction;
Expand Down Expand Up @@ -145,15 +144,6 @@ public function getBrokerPsp(): string|null
$canale = explode('_', $this->getCanale(), 2);
return $canale[0];
}

/**
* @inheritDoc
*/
public function getKey(int $index = 0): string
{
return '';
}

/**
* @inheritDoc
*/
Expand Down Expand Up @@ -262,18 +252,6 @@ public function workflowEvent(int $index = 0): Workflow|null
return $workflow;
}

/**
* @inheritDoc
*/
public function isValid(int $index = 0): bool
{
$iuv = $this->getIuv(0);
$pa = $this->getPaEmittente(0);
$token = $this->getPaymentToken(0);
$date = $this->getInsertedTimestamp()->format('Y-m-d');
return ($date && $iuv && $pa && $token);
}

/**
* @inheritDoc
*/
Expand Down
16 changes: 0 additions & 16 deletions src/src/crawler/events/resp/nodoInviaCarrelloRPT.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,6 @@ public function getBrokerPsp(): string|null
return $e[0];
}

/**
* @inheritDoc
*/
public function getKey(int $index = 0): string|null
{
return null;
}

/**
* @inheritDoc
*/
Expand All @@ -158,14 +150,6 @@ public function transaction(int $index = 0): Transaction|null
return null;
}

/**
* @inheritDoc
*/
public function isValid(int $index = 0): bool
{
return !empty($this->getColumn('sessionidoriginal'));
}

/**
* @inheritDoc
*/
Expand Down
21 changes: 0 additions & 21 deletions src/src/crawler/events/resp/sendPaymentOutcome.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
namespace pagopa\crawler\events\resp;

use pagopa\crawler\AbstractEvent;
use pagopa\crawler\FaultInterface;
use pagopa\crawler\MapEvents;
use pagopa\crawler\methods\MethodInterface;
use pagopa\crawler\methods\resp\sendPaymentOutcome as Payload;
use pagopa\database\sherlock\Transaction;
use pagopa\database\sherlock\TransactionDetails;
Expand Down Expand Up @@ -144,14 +142,6 @@ public function getBrokerPsp(): string|null
return $canale[0];
}

/**
* @inheritDoc
*/
public function getKey(int $index = 0): string|null
{
return '';
}

/**
* @inheritDoc
*/
Expand Down Expand Up @@ -198,17 +188,6 @@ public function workflowEvent(int $index = 0): Workflow|null
return $workflow;
}

/**
* @inheritDoc
*/
public function isValid(int $index = 0): bool
{
$iuv = $this->getIuv(0);
$pa = $this->getPaEmittente(0);
$token = $this->getPaymentToken(0);
return ($iuv && $pa && $token);
}

/**
* @inheritDoc
*/
Expand Down
Loading

0 comments on commit 1d37039

Please sign in to comment.