-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved parsed banking transaction mails/parsed mail logs.
- Added ability to change parsed mail's state. - Added ability to change parsed mail's note. - Added ability to track source bank account (updated `CsobMailParser` & `TatraBankaMailParser` + logging through `MailProcessor`) - Refactored `ParsedMailLog`'s State constants/enum - Added `EnumHelper` to simplify work with enum especially with Nette forms (enum values listing) remp/respekt#189
- Loading branch information
1 parent
cb0507e
commit 8613cc0
Showing
18 changed files
with
398 additions
and
16 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,41 @@ | ||
<?php | ||
|
||
namespace Crm\PaymentsModule\Forms; | ||
|
||
use Crm\PaymentsModule\Models\ParsedMailLog\State; | ||
use Nette\Application\UI\Form; | ||
use Nette\Localization\Translator; | ||
use Tomaj\Form\Renderer\BootstrapRenderer; | ||
|
||
class ParsedMailLogFactory | ||
{ | ||
public function __construct( | ||
private readonly Translator $translator, | ||
) { | ||
} | ||
|
||
public function create(int $parsedMailLogId, array $defaults): Form | ||
{ | ||
$form = new Form; | ||
$form->setTranslator($this->translator); | ||
$form->setRenderer(new BootstrapRenderer()); | ||
|
||
// State | ||
$form->addSelect('state', 'payments.admin.parsed_mails.state.label', items: State::getFriendlyList()); | ||
|
||
// Note | ||
$form->addTextArea('note', 'payments.admin.parsed_mails.note.label') | ||
->setNullable() | ||
->setHtmlAttribute('rows', 4); | ||
|
||
// Buttons | ||
$form->addSubmit('save', 'payments.admin.parsed_mails_edit_form.save'); | ||
$form->addButton('cancel', 'payments.admin.parsed_mails_edit_form.cancel') | ||
->setHtmlAttribute('data-toggle', 'modal') | ||
->setHtmlAttribute('data-target', sprintf('#parsedMailLogEditModal%d', $parsedMailLogId)); | ||
|
||
$form->setDefaults($defaults); | ||
|
||
return $form; | ||
} | ||
} |
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
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,22 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Crm\PaymentsModule\Models\ParsedMailLog; | ||
|
||
use Crm\ApplicationModule\Helpers\EnumHelper; | ||
|
||
enum State: string | ||
{ | ||
use EnumHelper; | ||
|
||
case WITHOUT_VS = 'without_vs'; | ||
case ALREADY_PAID = 'already_paid'; | ||
case DUPLICATED_PAYMENT = 'duplicated_payment'; | ||
case CHANGED_TO_PAID = 'changed_to_paid'; | ||
case PAYMENT_NOT_FOUND = 'payment_not_found'; | ||
case DIFFERENT_AMOUNT = 'different_amount'; | ||
case AUTO_NEW_PAYMENT = 'auto_new_payment'; | ||
case NO_SIGN = 'no_sign'; | ||
case NOT_VALID_SIGN = 'no_valid_sign'; | ||
case ALREADY_REFUNDED = 'already_refunded'; | ||
} |
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
Oops, something went wrong.