Skip to content

Commit

Permalink
Add more properties to transaction (#47)
Browse files Browse the repository at this point in the history
* Add more properties to transaction
* Add more getter and setter for properties
  • Loading branch information
cn42 authored Jan 11, 2023
1 parent 6b4e35d commit f03730b
Show file tree
Hide file tree
Showing 3 changed files with 246 additions and 0 deletions.
54 changes: 54 additions & 0 deletions lib/Jejik/MT940/Parser/AbstractParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,12 @@ protected function transaction(array $lines): TransactionInterface
->setMref($this->mref($lines))
->setCred($this->cred($lines))
->setSvwz($this->svwz($lines))
->setPurp($this->purp($lines))
->setDebt($this->debt($lines))
->setCoam($this->coam($lines))
->setOamt($this->oamt($lines))
->setAbwa($this->abwa($lines))
->setAbwe($this->abwe($lines))
->setDescription($this->description($description));

return $transaction;
Expand Down Expand Up @@ -685,4 +691,52 @@ protected function svwz(array $lines): ?string
{
return null;
}

/**
* Parse purp for provided transaction lines
*/
protected function purp(array $lines): ?string
{
return null;
}

/**
* Parse debt for provided transaction lines
*/
protected function debt(array $lines): ?string
{
return null;
}

/**
* Parse coam for provided transaction lines
*/
protected function coam(array $lines): ?string
{
return null;
}

/**
* Parse oamt for provided transaction lines
*/
protected function oamt(array $lines): ?string
{
return null;
}

/**
* Parse abwa for provided transaction lines
*/
protected function abwa(array $lines): ?string
{
return null;
}

/**
* Parse abwe for provided transaction lines
*/
protected function abwe(array $lines): ?string
{
return null;
}
}
132 changes: 132 additions & 0 deletions lib/Jejik/MT940/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,36 @@ class Transaction implements TransactionInterface
*/
private $svwz;

/**
* @var string
*/
private $purp;

/**
* @var string
*/
private $debt;

/**
* @var string
*/
private $coam;

/**
* @var string
*/
private $oamt;

/**
* @var string
*/
private $abwa;

/**
* @var string
*/
private $abwe;

// }}}

// Getters and setters {{{
Expand Down Expand Up @@ -493,6 +523,108 @@ public function setSvwz(string $svwz = null): TransactionInterface
$this->svwz = $svwz;
return $this;
}

/**
* Get Purp for this transaction
*/
public function getPurp(): ?string
{
return ($this->purp !== null) ? trim($this->purp) : null;
}

/**
* Set Purp for this transaction
*/
public function setPurp(string $purp = null): TransactionInterface
{
$this->purp = $purp;
return $this;
}

/**
* Get Debt for this transaction
*/
public function getDebt(): ?string
{
return ($this->debt !== null) ? trim($this->debt) : null;
}

/**
* Set Debt for this transaction
*/
public function setDebt(string $debt = null): TransactionInterface
{
$this->debt = $debt;
return $this;
}

/**
* Get Coam for this transaction
*/
public function getCoam(): ?string
{
return ($this->coam !== null) ? trim($this->coam) : null;
}

/**
* Set Coam for this transaction
*/
public function setCoam(string $coam = null): TransactionInterface
{
$this->coam = $coam;
return $this;
}

/**
* Get Oamt for this transaction
*/
public function getOamt(): ?string
{
return ($this->oamt !== null) ? trim($this->oamt) : null;
}

/**
* Set Oamt for this transaction
*/
public function setOamt(string $oamt = null): TransactionInterface
{
$this->oamt = $oamt;
return $this;
}

/**
* Get Abwa for this transaction
*/
public function getAbwa(): ?string
{
return ($this->abwa !== null) ? trim($this->abwa) : null;
}

/**
* Set Abwa for this transaction
*/
public function setAbwa(string $abwa = null): TransactionInterface
{
$this->abwa = $abwa;
return $this;
}

/**
* Get Abwe for this transaction
*/
public function getAbwe(): ?string
{
return ($this->abwe !== null) ? trim($this->abwe) : null;
}

/**
* Set Abwe for this transaction
*/
public function setAbwe(string $abwe = null): TransactionInterface
{
$this->abwe = $abwe;
return $this;
}

// }}}
}
60 changes: 60 additions & 0 deletions lib/Jejik/MT940/TransactionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,4 +234,64 @@ public function getSvwz(): ?string;
* Set Svwz for this transaction
*/
public function setSvwz(string $svwz = null): TransactionInterface;

/**
* Get Purp for this transaction
*/
public function getPurp(): ?string;

/**
* Set Purp for this transaction
*/
public function setPurp(string $purp = null): TransactionInterface;

/**
* Get Debt for this transaction
*/
public function getDebt(): ?string;

/**
* Set Debt for this transaction
*/
public function setDebt(string $debt = null): TransactionInterface;

/**
* Get Coam for this transaction
*/
public function getCoam(): ?string;

/**
* Set Coam for this transaction
*/
public function setCoam(string $coam = null): TransactionInterface;

/**
* Get Oamt for this transaction
*/
public function getOamt(): ?string;

/**
* Set Oamt for this transaction
*/
public function setOamt(string $oamt = null): TransactionInterface;

/**
* Get Abwa for this transaction
*/
public function getAbwa(): ?string;

/**
* Set Abwa for this transaction
*/
public function setAbwa(string $abwa = null): TransactionInterface;

/**
* Get Abwe for this transaction
*/
public function getAbwe(): ?string;

/**
* Set Abwe for this transaction
*/
public function setAbwe(string $abwe = null): TransactionInterface;
}

0 comments on commit f03730b

Please sign in to comment.