Merge branch 'fronkdev' into 'master'

PreorderBilling WIP & Api changed

See merge request fronk/thetool!1127
This commit is contained in:
Frank Schubert
2025-03-20 15:03:17 +00:00
32 changed files with 2847 additions and 181 deletions
@@ -0,0 +1,65 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class CreatePreorderBilling extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$billing = $this->table('PreorderBilling');
$billing->addColumn("invoice_id", "integer", ["null" => true]);
$billing->addColumn("preorder_id", "integer", ["null" => false]);
$billing->addColumn("order_date", "date", ["null" => false]);
$billing->addColumn("start_date", "date", ["null" => false]);
$billing->addColumn("end_date", "date", ["null" => false]);
$billing->addColumn("owner_id", "integer", ["null" => false]);
$billing->addColumn("billingaddress_id", "integer", ["null" => false]);
$billing->addColumn("fibu_account_number", "integer", ["null" => false]);
$billing->addColumn("company", "string", ["null" => true, "default" => null, "length" => 1024]);
$billing->addColumn("firstname", "string", ["null" => true, "default" => null, "length" => 1024]);
$billing->addColumn("lastname", "string", ["null" => true, "default" => null, "length" => 1024]);
$billing->addColumn("street", "string", ["null" => false, "length" => 1024]);
$billing->addColumn("zip", "string", ["null" => false, "length" => 1024]);
$billing->addColumn("city", "string", ["null" => false, "length" => 1024]);
$billing->addColumn("country", "string", ["null" => true, "default" => null, "length" => 1024]);
$billing->addColumn("email", "string", ["null" => true, "default" => null, "length" => 1024]);
$billing->addColumn("uid", "string", ["null" => true, "default" => null, "length" => 1024]);
$billing->addColumn("billing_delivery", "enum", ["null" => false, "values" => "email,paper"]);
$billing->addColumn("product_id", "integer", ["null" => false]);
$billing->addColumn("product_name", "string", ["null" => false, "length" => 255]);
$billing->addColumn("product_info", "text", ["null" => true, "default" => null]);
$billing->addColumn("article_number", "string", ["null" => false, "length" => 32]);
$billing->addColumn("amount", "decimal", ["null" => false, "precision" => 9, "scale" => 6]);
$billing->addColumn("unit", "string", ["null" => false, "length" => 64]);
$billing->addColumn("price", "decimal", ["null" => false, "precision" => 14, "scale" => 4]);
$billing->addColumn("price_setup", "decimal", ["null" => false, "default" => 0, "precision" => 14, "scale" => 4]);
$billing->addColumn("vatrate", "decimal", ["null" => false, "precision" => 14, "scale" => 4]);
$billing->addColumn("billing_period", "integer", ["null" => false, "default" => 0]);
$billing->addColumn("create_by", "integer", ["null" => false]);
$billing->addColumn("edit_by", "integer", ["null" => false]);
$billing->addColumn("create", "integer", ["null" => false]);
$billing->addColumn("edit", "integer", ["null" => false]);
$billing->create();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$this->table("PreorderBilling")->drop()->save();
}
if($this->getEnvironment() == "addressdb") {
}
}
}
@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class PreorderProductPriceAddArticlenumber extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("PreorderProductPrice");
$table->addColumn("article_number", "string", ["limit" => 255, "null" => true, "after" => "netoperator_id"]);
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("PreorderProductPrice");
$table->removeColumn("article_number");
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
}
@@ -0,0 +1,46 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class CreatePreorderBillingCustomer extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table('PreorderBillingCustomer');
$table->addColumn("netowner_id", "string", ["limit" => 255, "null" => true, "default" => null]);
$table->addColumn("fibu_account_number", "string", ["limit" => 255, "null" => true, "default" => null]);
$table->addColumn("company", "string", ["limit" => 255, "null" => true, "default" => null]);
$table->addColumn("firstname", "string", ["limit" => 255, "null" => true, "default" => null]);
$table->addColumn("lastname", "string", ["limit" => 255, "null" => true, "default" => null]);
$table->addColumn("street", "string", ["limit" => 255, "null" => true, "default" => null]);
$table->addColumn("zip", "string", ["limit" => 255, "null" => true, "default" => null]);
$table->addColumn("city", "string", ["limit" => 255, "null" => true, "default" => null]);
$table->addColumn("country", "string", ["limit" => 255, "null" => true, "default" => null]);
$table->addColumn("phone", "string", ["limit" => 255, "null" => true, "default" => null]);
$table->addColumn("email", "string", ["limit" => 255, "null" => true, "default" => null]);
$table->addColumn("uid", "string", ["limit" => 255, "null" => true, "default" => null]);
$table->addColumn("create_by", "integer", ["null" => false]);
$table->addColumn("edit_by", "integer", ["null" => false]);
$table->addColumn("create", "integer", ["null" => false]);
$table->addColumn("edit", "integer", ["null" => false]);
$table->create();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$this->table('PreorderBillingCustomer')->drop()->save();
}
if($this->getEnvironment() == "addressdb") {
}
}
}
@@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class PreorderBillingAddCustomerId extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table('PreorderBilling');
$table->addColumn("preorderbillingcustomer_id", "integer", ["null" => true, "default" => null, "after" => "end_date"]);
$table->changeColumn("owner_id", "integer", ["null" => true, "default" => null]);
$table->changeColumn("billingaddress_id", "integer", ["null" => true, "default" => null]);
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table('PreorderBilling');
$table->removeColumn("preorderbillingcustomer_id");
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
}
@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class PreorderBillingAddAdbHausnummerId extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("PreorderBilling");
$table->addColumn("adb_wohneinheit_id", "integer", ["null" => false, "after" => "preorder_id"]);
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("PreorderBilling");
$table->removeColumn("adb_wohneinheit_id");
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
}
@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class PreorderBillingAddOaid extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("PreorderBilling");
$table->addColumn("oaid", "string", ["null" => false, "limit" => 64, "after" => "preorder_id"]);
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("PreorderBilling");
$table->removeColumn("oaid");
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
}
@@ -0,0 +1,38 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class PreorderHistoryAddChanged extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table('PreorderHistory');
$table->addColumn('changed', 'integer', ["null" => true, "after" => "new_value"]);
$table->update();
$builder = $this->getQueryBuilder();
$q = $builder->select("*")->from("PreorderHistory")->execute();
$this->query("UPDATE PreorderHistory SET `changed` = `create`");
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table('PreorderHistory');
$table->removeColumn('changed');
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
}