Skip to content

Commit

Permalink
MM-8: Add logic for tax class dictionary synchronization (#45)
Browse files Browse the repository at this point in the history
- Added support multi-page requests
- Added support search request to Magento 2
- Fixed issue with incorrect page data on "taxClasses\search" endpoint
- Added logic to support product tax class sync
  • Loading branch information
alexandr-parkhomenko authored May 28, 2020
1 parent e2ebbb0 commit 854eab6
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/Marello/Bundle/TaxBundle/Entity/TaxCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Marello\Bundle\TaxBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Marello\Bundle\TaxBundle\Model\ExtendTaxCode;
use Oro\Bundle\EntityConfigBundle\Metadata\Annotation as Oro;

/**
Expand All @@ -28,7 +29,7 @@
* }
* )
*/
class TaxCode
class TaxCode extends ExtendTaxCode
{
/**
* @var integer
Expand All @@ -47,6 +48,9 @@ class TaxCode
* defaultValues={
* "dataaudit"={
* "auditable"=true
* },
* "importexport"={
* "identity"=true
* }
* }
* )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class MarelloTaxBundleInstaller implements Installation
*/
public function getMigrationVersion()
{
return 'v1_3_1';
return 'v1_4';
}

/**
Expand Down Expand Up @@ -48,7 +48,7 @@ protected function createMarelloTaxTaxCodeTable(Schema $schema)
{
$table = $schema->createTable('marello_tax_tax_code');
$table->addColumn('id', 'integer', ['autoincrement' => true]);
$table->addColumn('code', 'string', ['notnull' => true, 'length' => 32]);
$table->addColumn('code', 'string', ['notnull' => true, 'length' => 255]);
$table->addColumn('description', 'string', ['notnull' => false, 'length' => 255]);
$table->addColumn('data', 'json_array', ['notnull' => false, 'comment' => '(DC2Type:json_array)']);
$table->setPrimaryKey(['id']);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace Marello\Bundle\TaxBundle\Migrations\Schema\v1_4;

use Doctrine\DBAL\Schema\Schema;

use Oro\Bundle\MigrationBundle\Migration\Migration;
use Oro\Bundle\MigrationBundle\Migration\QueryBag;

class MarelloTaxBundle implements Migration
{
/**
* {@inheritDoc}
*/
public function up(Schema $schema, QueryBag $queries)
{
/** Tables generation **/
$this->updateMarelloTaxCodeTable($schema);
}

/**
* {@inheritDoc}
*/
protected function updateMarelloTaxCodeTable(Schema $schema)
{
$table = $schema->getTable('marello_tax_tax_code');
$table->changeColumn('code', ['length' => 255]);
}
}
17 changes: 17 additions & 0 deletions src/Marello/Bundle/TaxBundle/Model/ExtendTaxCode.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Marello\Bundle\TaxBundle\Model;

class ExtendTaxCode
{
/**
* Constructor
*
* The real implementation of this method is auto generated.
*
* IMPORTANT: If the derived class has own constructor it must call parent constructor.
*/
public function __construct()
{
}
}

0 comments on commit 854eab6

Please sign in to comment.