WIP: Sicherheitsnetz vor Phase-1-R\u00fcckbau

Enth\u00e4lt gemischt: Laravel-10-Upgrade + Phase 1 (Contacts-Modul, Duplicats-Commands,
Soft-Delete+Merge-Fields) + Phase 2 Code-Umstellungen (inquiry_id, $table='contacts'/'inquiries')
+ Offers-Modul (Migrationen, Models, offer_id in Booking, offer-Disk in filesystems.php).

Phase 2 + Offers werden im folgenden Commit nach dev/backups/phase2-offers-2026-04-17/
verschoben, damit der Workspace auf Phase-1-only (= Test-System-Stand) reduziert ist
und direkt auf Live deploybar wird.

Tarball-Backup zus\u00e4tzlich unter: ../backups-safety/workspace-pre-phase1-rollback-2026-04-17.tar.gz

Made-with: Cursor
This commit is contained in:
Phase-1-Rollback-Agent 2026-04-17 13:40:31 +00:00
parent 389d5d1820
commit e3dc1afd8e
165 changed files with 21914 additions and 3516 deletions

View file

@ -0,0 +1,69 @@
<?php
namespace Database\Factories;
use App\Models\Booking;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Booking>
*/
class BookingFactory extends Factory
{
protected $model = Booking::class;
public function definition(): array
{
$start = fake()->dateTimeBetween('+1 month', '+6 months');
$end = fake()->dateTimeBetween($start, '+12 months');
return [
'customer_id' => CustomerFactory::new(),
'lead_id' => LeadFactory::new(),
'booking_date' => now()->format('Y-m-d'),
'start_date' => $start->format('Y-m-d'),
'end_date' => $end->format('Y-m-d'),
'sf_guard_user_id' => null,
'branch_id' => null,
'service_fee' => 0.0,
'travel_country_id' => null,
'travel_category_id' => null,
'pax' => 2,
'coupon_id' => null,
'title' => fake()->sentence(4),
'travel_number' => strtoupper(fake()->bothify('??####')),
'participant_name' => fake()->lastName(),
'participant_firstname' => fake()->firstName(),
'participant_birthdate' => fake()->dateTimeBetween('-60 years', '-18 years')->format('Y-m-d'),
'participant_salutation_id' => 1,
'ev_number' => '',
'merlin_knr' => '',
'merlin_order_number' => '',
'travel_company_id' => null,
'travel_documents' => false,
'price' => fake()->randomFloat(2, 500, 5000),
'price_total' => 0.0,
'deposit_total' => 0.0,
'final_payment' => 0.0,
'final_payment_date' => null,
'travelagenda_id' => null,
'website_id' => null,
'new_drafts' => false,
];
}
public function canceled(): static
{
return $this->state(fn (array $attributes) => [
'canceled' => 1.0,
]);
}
public function withPrice(float $price): static
{
return $this->state(fn (array $attributes) => [
'price' => $price,
'price_total' => $price,
]);
}
}

View file

@ -0,0 +1,50 @@
<?php
namespace Database\Factories;
use App\Models\Customer;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Customer>
*/
class CustomerFactory extends Factory
{
protected $model = Customer::class;
public function definition(): array
{
return [
'salutation_id' => 1,
'title' => '',
'name' => fake()->lastName(),
'firstname' => fake()->firstName(),
'birthdate' => fake()->dateTimeBetween('-80 years', '-18 years')->format('Y-m-d'),
'company' => '',
'street' => fake()->streetAddress(),
'zip' => fake()->postcode(),
'city' => fake()->city(),
'email' => fake()->unique()->safeEmail(),
'phone' => fake()->phoneNumber(),
'phonebusiness' => '',
'phonemobile' => fake()->phoneNumber(),
'fax' => '',
'bank' => '',
'bank_code' => '',
'bank_account_number' => '',
'credit_card_type_id' => null,
'credit_card_number' => '',
'credit_card_expiration_date'=> null,
'participants_remarks' => '',
'miscellaneous_remarks' => '',
'country_id' => null,
];
}
public function company(): static
{
return $this->state(fn (array $attributes) => [
'company' => fake()->company(),
]);
}
}

View file

@ -0,0 +1,60 @@
<?php
namespace Database\Factories;
use App\Models\Lead;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Lead>
*/
class LeadFactory extends Factory
{
protected $model = Lead::class;
public function definition(): array
{
$start = fake()->dateTimeBetween('+1 month', '+6 months');
$end = fake()->dateTimeBetween($start, '+12 months');
return [
'customer_id' => CustomerFactory::new(),
'request_date' => now()->format('Y-m-d'),
'travelperiod_start' => $start->format('Y-m-d'),
'travelperiod_end' => $end->format('Y-m-d'),
'travelperiod_length' => (int) $start->diff($end)->days,
'travelcountry_id' => null,
'travelagenda_id' => null,
'remarks' => '',
'sf_guard_user_id' => null,
'is_closed' => false,
'initialcontacttype_id' => null,
'searchengine_id' => null,
'searchengine_keywords' => '',
'status_id' => 1,
'next_due_date' => now()->addDays(7)->format('Y-m-d'),
'website_id' => null,
'travelcategory_id' => null,
'price' => 0.0,
'pax' => 2,
'participant_name' => fake()->lastName(),
'participant_firstname' => fake()->firstName(),
'participant_birthdate' => fake()->dateTimeBetween('-60 years', '-18 years')->format('Y-m-d'),
'participant_salutation_id' => 1,
];
}
public function closed(): static
{
return $this->state(fn (array $attributes) => [
'is_closed' => true,
]);
}
public function withPrice(float $price): static
{
return $this->state(fn (array $attributes) => [
'price' => $price,
]);
}
}

View file

@ -1,23 +1,43 @@
<?php
use Faker\Generator as Faker;
namespace Database\Factories;
/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| This directory should contain each of the model factory definitions for
| your application. Factories provide a convenient way to generate new
| model instances for testing / seeding your application's database.
|
*/
use App\User;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
$factory->define(App\User::class, function (Faker $faker) {
return [
'name' => $faker->name,
'email' => $faker->unique()->safeEmail,
'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret
'remember_token' => str_random(10),
];
});
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\User>
*/
class UserFactory extends Factory
{
protected $model = User::class;
public function definition(): array
{
return [
'name' => fake()->name(),
'email' => fake()->unique()->safeEmail(),
'password' => Hash::make('password'),
'remember_token' => Str::random(10),
'active' => 1,
'admin' => 0,
'confirmed' => 1,
];
}
public function admin(): static
{
return $this->state(fn (array $attributes) => [
'admin' => 1,
]);
}
public function inactive(): static
{
return $this->state(fn (array $attributes) => [
'active' => 0,
]);
}
}