Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add kyc status refused #343

Merged
merged 1 commit into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 47 additions & 34 deletions Setup/UpgradeSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace Pagarme\Pagarme\Setup;

use Magento\Framework\DB\Ddl\Table;
use Magento\Framework\Setup\UpgradeSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\Setup\UpgradeSchemaInterface;

class UpgradeSchema implements UpgradeSchemaInterface
{
Expand All @@ -14,9 +14,10 @@ class UpgradeSchema implements UpgradeSchemaInterface
* {@inheritdoc}
*/
public function upgrade(
SchemaSetupInterface $setup,
SchemaSetupInterface $setup,
ModuleContextInterface $context
) {
)
{
$setup->startSetup();
$version = $context->getVersion();
$installSchema = new InstallSchema();
Expand All @@ -27,41 +28,53 @@ public function upgrade(

if (version_compare($version, '2.2.5', '<')) {
$connection = $setup->getConnection();
$connection->addColumn(
$setup->getTable('pagarme_module_core_recurrence_products_plan'),
'apply_discount_in_all_product_cycles',
[
'type' => Table::TYPE_SMALLINT,
'length' => 1,
'nullable' => true,
'comment' => 'Apply products cycle to discount'
]
);
if ($connection->tableColumnExists(
'pagarme_module_core_recurrence_products_plan',
'apply_discount_in_all_product_cycles'
) === false) {
$connection->addColumn(
$setup->getTable('pagarme_module_core_recurrence_products_plan'),
'apply_discount_in_all_product_cycles',
[
'type' => Table::TYPE_SMALLINT,
'length' => 1,
'nullable' => true,
'comment' => 'Apply products cycle to discount'
]
);
}

$connection->addColumn(
$setup->getTable('pagarme_module_core_recurrence_products_subscription'),
'apply_discount_in_all_product_cycles',
[
'type' => Table::TYPE_SMALLINT,
'length' => 1,
'nullable' => true,
'comment' => 'Apply products cycle to discount'
]
);
if ($connection->tableColumnExists(
'pagarme_module_core_recurrence_products_subscription',
'apply_discount_in_all_product_cycles'
) === false) {
$connection->addColumn(
$setup->getTable('pagarme_module_core_recurrence_products_subscription'),
'apply_discount_in_all_product_cycles',
[
'type' => Table::TYPE_SMALLINT,
'length' => 1,
'nullable' => true,
'comment' => 'Apply products cycle to discount'
]
);
}
}

if (version_compare($context->getVersion(), '2.5.0', '<')) {
$setup->getConnection()->changeColumn(
$setup->getTable('pagarme_module_core_recipients'),
'document_type',
'type',
[
'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
'length' => 11,
'nullable' => 'false',
'comment' => 'Recipient document type: individual (CPF) or corporation (CNPJ)'
]
);
if ($setup->getConnection()->tableColumnExists('pagarme_module_core_recipients', 'type') === false) {
$setup->getConnection()->changeColumn(
$setup->getTable('pagarme_module_core_recipients'),
'document_type',
'type',
[
'type' => Table::TYPE_TEXT,
'length' => 11,
'nullable' => 'false',
'comment' => 'Recipient document type: individual (CPF) or corporation (CNPJ)'
]
);
}
}

$setup->endSetup();
Expand Down
3 changes: 2 additions & 1 deletion view/adminhtml/web/css/pagarme_style.css
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ table.table-cycles {
.data-grid td .recipient-status-disapproved,
.data-grid td .recipient-status-suspended,
.data-grid td .recipient-status-blocked,
.data-grid td .recipient-status-inactive {
.data-grid td .recipient-status-inactive,
.data-grid td .recipient-status-refused {
background-color: #f9d4d4;
border-color: #e22626;
color: #e22626;
Expand Down
3 changes: 3 additions & 0 deletions view/adminhtml/web/js/grid/columns/recipientStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ define([
case 'blocked':
statusLabel = 'Bloqueado'
break;
case 'refused':
statusLabel = 'Recusado'
break;
case 'inactive':
statusLabel = 'Inativo'
break;
Expand Down
Loading