@@ -47,7 +47,7 @@ class TillerClient | |||
var $restaurantToken; | |||
var $urlApi = 'https://app.tillersystems.com/api/'; | |||
public function __construct(string $providerToken, string $restaurantToken) | |||
public function __construct(string $providerToken = null, string $restaurantToken = null) | |||
{ | |||
$this->curl = new curl\Curl(); | |||
$this->providerToken = $providerToken; |
@@ -11,7 +11,7 @@ use common\logic\Producer\Producer\Service\ProducerSolver; | |||
class TillerManager extends AbstractManager | |||
{ | |||
protected bool $tillerActivated; | |||
protected ?bool $tillerActivated; | |||
protected ProducerSolver $producerSolver; | |||
protected TillerClient $tillerClient; | |||
protected OrderSolver $orderSolver; |
@@ -43,14 +43,14 @@ class m161012_074719_infos_boulanger extends Migration | |||
{ | |||
public function up() | |||
{ | |||
$this->addColumn('user', 'id_etablissement', Schema::TYPE_INTEGER) ; | |||
//$this->addColumn('user', 'id_etablissement', Schema::TYPE_INTEGER) ; | |||
//$this->addColumn('user', 'nom_magasin', Schema::TYPE_STRING) ; | |||
//$this->addColumn('user', 'siret', Schema::TYPE_STRING) ; | |||
} | |||
public function down() | |||
{ | |||
$this->dropColumn('user', 'id_etablissement') ; | |||
//$this->dropColumn('user', 'id_etablissement') ; | |||
//$this->dropColumn('user', 'nom_magasin') ; | |||
//$this->dropColumn('user', 'siret') ; | |||
} |
@@ -42,7 +42,7 @@ use yii\db\Schema; | |||
class m171227_090138_champs_priorite_developpement extends Migration { | |||
public function up() { | |||
$this->addColumn('developpement_priorite','priorite',Schema::TYPE_STRING.' DEFAULT \''.DeveloppementPriorite::PRIORITE_NORMALE.'\''); | |||
$this->addColumn('developpement_priorite','priorite',Schema::TYPE_STRING); | |||
} | |||
public function down() { |
@@ -37,6 +37,7 @@ termes. | |||
*/ | |||
use yii\db\Migration; | |||
use yii\db\Schema; | |||
class m181107_104051_add_champs_commande_deleted extends Migration | |||
{ |
@@ -1,6 +1,7 @@ | |||
<?php | |||
use yii\db\Migration; | |||
use yii\db\Schema; | |||
class m181220_080234_translate_database extends Migration | |||
{ |
@@ -1,6 +1,7 @@ | |||
<?php | |||
use yii\db\Migration; | |||
use yii\db\Schema; | |||
class m190109_080828_add_field_subscription_order extends Migration { | |||
@@ -5,10 +5,7 @@ use yii\db\Migration; | |||
class m190205_164612_ajout_produit_don_aux_distributions_existantes extends Migration { | |||
public function up() { | |||
$distributionsArray = common\logic\Distribution\Distribution\Distribution::find()->all() ; | |||
foreach($distributionsArray as $distribution) { | |||
} | |||
} | |||
public function down() { |
@@ -10,41 +10,7 @@ class m190226_084104_lien_utilisateur_point_de_vente extends Migration | |||
{ | |||
public function up() | |||
{ | |||
$producersArray = Producer::find()->all() ; | |||
foreach($producersArray as $producer) { | |||
$pointsSaleArray = PointSale::find() | |||
->where([ | |||
'id_producer' => $producer->id | |||
]) | |||
->all(); | |||
foreach($pointsSaleArray as $pointSale) { | |||
$usersArray = UserModel::find()->innerJoin( | |||
'order', | |||
'user.id = order.id_user AND order.id_point_sale = :id_point_sale', | |||
[':id_point_sale' => $pointSale->id] | |||
) | |||
->groupBy('user.id') | |||
->all(); | |||
foreach($usersArray as $user) { | |||
$userPointSale = UserPointSale::find() | |||
->where([ | |||
'id_user' => $user->id, | |||
'id_point_sale' => $pointSale->id | |||
])->one() ; | |||
if(!$userPointSale) { | |||
$userPointSale = new UserPointSale() ; | |||
$userPointSale->id_user = $user->id ; | |||
$userPointSale->id_point_sale = $pointSale->id ; | |||
$userPointSale->save() ; | |||
} | |||
} | |||
} | |||
} | |||
} | |||
public function down() |
@@ -2,25 +2,11 @@ | |||
use yii\db\Migration; | |||
use yii\db\mysql\Schema; | |||
use common\logic\Subscription\ProductSubscription\ProductSubscription; | |||
use common\logic\Product\Product\Product; | |||
class m190515_122438_ajout_champs_price_product_subscription extends Migration { | |||
public function up() { | |||
$this->addColumn('product_subscription', 'price', Schema::TYPE_FLOAT. ' DEFAULT 0') ; | |||
$productsSubscriptionsArray = ProductSubscription::find()->all() ; | |||
$productsArray = Product::find()->all() ; | |||
foreach($productsSubscriptionsArray as $productSubscription) { | |||
foreach($productsArray as $product) { | |||
if($productSubscription->id_product == $product->id) { | |||
$productSubscription->price = $product->price ; | |||
$productSubscription->save() ; | |||
} | |||
} | |||
} | |||
} | |||
public function down() { |
@@ -2,7 +2,7 @@ | |||
use yii\db\Migration; | |||
use yii\db\mysql\Schema; | |||
use common\logic\Producer\Producer\Producer; | |||
use common\logic\Producer\Producer\Model\Producer; | |||
class m190522_091006_option_comportement_annulation_commande extends Migration { | |||
@@ -17,19 +17,4 @@ class m200108_145508_module_bl_devis_factures_suppression_price_unit_step_produc | |||
return false; | |||
} | |||
/* | |||
// Use up()/down() to run migration code without a transaction. | |||
public function up() | |||
{ | |||
} | |||
public function down() | |||
{ | |||
echo "m200108_145508_module_bl_devis_factures_suppression_price_unit_step_product_subscription cannot be reverted.\n"; | |||
return false; | |||
} | |||
*/ | |||
} |
@@ -21,19 +21,4 @@ class m200108_195657_module_bl_devis_factures_order_status_history extends Migra | |||
return 'false'; | |||
} | |||
/* | |||
// Use up()/down() to run migration code without a transaction. | |||
public function up() | |||
{ | |||
} | |||
public function down() | |||
{ | |||
echo "m200108_195657_module_bl_devis_factures_order_status_history cannot be reverted.\n"; | |||
return false; | |||
} | |||
*/ | |||
} |
@@ -2,7 +2,7 @@ | |||
use yii\db\Migration; | |||
use yii\db\Schema; | |||
use common\logic\Document\Document\Document | |||
use common\logic\Document\Document\Model\Document; | |||
class m200109_092028_module_bl_devis_factures_champs_status_document extends Migration | |||
{ |
@@ -8,7 +8,6 @@ class m200109_152833_module_bl_devis_factures_order_status_history_add_origin ex | |||
public function safeUp() | |||
{ | |||
$this->addColumn('order_status_history', 'origin', Schema::TYPE_STRING); | |||
} | |||
public function safeDown() |
@@ -1,5 +1,6 @@ | |||
<?php | |||
use common\logic\User\User\Model\User; | |||
use yii\db\Migration; | |||
use yii\db\Schema; | |||
@@ -7,7 +8,7 @@ class m200117_144356_user_ajout_champs_type extends Migration | |||
{ | |||
public function safeUp() | |||
{ | |||
$this->addColumn('user', 'type', Schema::TYPE_STRING.' DEFAULT \''.UserModel::TYPE_INDIVIDUAL.'\''); | |||
$this->addColumn('user', 'type', Schema::TYPE_STRING.' DEFAULT \''.User::TYPE_INDIVIDUAL.'\''); | |||
$this->addColumn('user', 'name_legal_person', Schema::TYPE_STRING) ; | |||
} | |||
@@ -6,9 +6,7 @@ class m200117_161844_order_existantes_set_status extends Migration | |||
{ | |||
public function safeUp() | |||
{ | |||
Order::updateAll([ | |||
'status' => 'tmp-order' | |||
]) ; | |||
} | |||
public function safeDown() |
@@ -2,7 +2,7 @@ | |||
use yii\db\Migration; | |||
use yii\db\Schema; | |||
use common\logic\Producer\Producer\Producer; | |||
use common\logic\Producer\Producer\Model\Producer; | |||
class m200601_073309_add_producer_options extends Migration | |||
{ |
@@ -16,19 +16,4 @@ class m200624_083903_product_distribution_change_column_quantity_max extends Mig | |||
return false; | |||
} | |||
/* | |||
// Use up()/down() to run migration code without a transaction. | |||
public function up() | |||
{ | |||
} | |||
public function down() | |||
{ | |||
echo "m200624_083903_product_distribution_change_column_quantity_max cannot be reverted.\n"; | |||
return false; | |||
} | |||
*/ | |||
} |
@@ -1,6 +1,7 @@ | |||
<?php | |||
use yii\db\Migration; | |||
use yii\db\Schema; | |||
class m201026_074711_option_email_confirm_producer extends Migration | |||
{ |
@@ -1,6 +1,7 @@ | |||
<?php | |||
use yii\db\Migration; | |||
use yii\db\Schema; | |||
class m201218_071628_add_option_export_csv extends Migration | |||
{ |
@@ -1,6 +1,7 @@ | |||
<?php | |||
use yii\db\Migration; | |||
use yii\db\Schema; | |||
class m201230_102708_add_option_export_csv extends Migration | |||
{ |
@@ -1,6 +1,7 @@ | |||
<?php | |||
use yii\db\Migration; | |||
use yii\db\Schema; | |||
class m210303_090805_add_group_user_specific_prices extends Migration | |||
{ |
@@ -1,6 +1,7 @@ | |||
<?php | |||
use yii\db\Migration; | |||
use yii\db\Schema; | |||
class m210317_122616_option_order_reference_type extends Migration | |||
{ |
@@ -1,6 +1,7 @@ | |||
<?php | |||
use yii\db\Migration; | |||
use yii\db\Schema; | |||
class m210318_102840_add_option_allow_order_guest extends Migration | |||
{ |
@@ -25,19 +25,4 @@ class m210914_132350_add_options_online_payment extends Migration | |||
$this->dropColumn('producer', 'option_stripe_public_key'); | |||
$this->dropColumn('producer', 'option_stripe_private_key'); | |||
} | |||
/* | |||
// Use up()/down() to run migration code without a transaction. | |||
public function up() | |||
{ | |||
} | |||
public function down() | |||
{ | |||
echo "m210914_132350_add_options_online_payment cannot be reverted.\n"; | |||
return false; | |||
} | |||
*/ | |||
} |
@@ -23,19 +23,4 @@ class m210915_064446_add_option_stripe_endpoint extends Migration | |||
{ | |||
$this->dropColumn('producer', 'option_stripe_endpoint_secret'); | |||
} | |||
/* | |||
// Use up()/down() to run migration code without a transaction. | |||
public function up() | |||
{ | |||
} | |||
public function down() | |||
{ | |||
echo "m210915_064446_add_option_stripe_endpoint cannot be reverted.\n"; | |||
return false; | |||
} | |||
*/ | |||
} |
@@ -23,19 +23,4 @@ class m210915_083421_add_option_stripe_mode_test extends Migration | |||
{ | |||
$this->dropColumn('producer', 'option_stripe_mode_test'); | |||
} | |||
/* | |||
// Use up()/down() to run migration code without a transaction. | |||
public function up() | |||
{ | |||
} | |||
public function down() | |||
{ | |||
echo "m210915_083421_add_option_stripe_mode_test cannot be reverted.\n"; | |||
return false; | |||
} | |||
*/ | |||
} |
@@ -27,19 +27,4 @@ class m220823_084928_add_option_notify_producer_order_summary extends Migration | |||
return false; | |||
} | |||
/* | |||
// Use up()/down() to run migration code without a transaction. | |||
public function up() | |||
{ | |||
} | |||
public function down() | |||
{ | |||
echo "m220823_084928_add_option_notify_producer_order_summary cannot be reverted.\n"; | |||
return false; | |||
} | |||
*/ | |||
} |
@@ -2,7 +2,7 @@ | |||
use yii\db\Migration; | |||
use yii\db\Schema; | |||
use common\logic\Producer\Producer\Producer; | |||
use common\logic\Producer\Producer\Model\Producer; | |||
/** | |||
* Class m220915_072309_producer_add_option_billing_frequency |
@@ -2,7 +2,7 @@ | |||
use yii\db\Migration; | |||
use yii\db\Schema; | |||
use common\logic\Producer\Producer\Producer; | |||
use common\logic\Producer\Producer\Model\Producer; | |||
/** | |||
* Class m220915_083713_producer_add_options_billing |
@@ -2,7 +2,7 @@ | |||
use yii\db\Migration; | |||
use yii\db\Schema; | |||
use common\logic\Document\Document\Document; | |||
use common\logic\Document\Document\Model\Document; | |||
/** | |||
* Class m220916_062206_add_column_document_tax_calculation_method |
@@ -23,19 +23,4 @@ class m221109_100033_producer_add_option_display_message_new_opendistrib_version | |||
{ | |||
$this->dropColumn('producer', 'option_display_message_new_opendistrib_version'); | |||
} | |||
/* | |||
// Use up()/down() to run migration code without a transaction. | |||
public function up() | |||
{ | |||
} | |||
public function down() | |||
{ | |||
echo "m221109_100033_producer_add_option_display_message_new_opendistrib_version cannot be reverted.\n"; | |||
return false; | |||
} | |||
*/ | |||
} |