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:
parent
389d5d1820
commit
e3dc1afd8e
165 changed files with 21914 additions and 3516 deletions
|
|
@ -22,7 +22,7 @@ class BookingPDFRepository extends BaseRepository
|
|||
public function __construct(Booking $model)
|
||||
{
|
||||
$this->model = $model;
|
||||
$this->prepath = Storage::disk('public')->getAdapter()->getPathPrefix();
|
||||
$this->prepath = Storage::disk('public')->path('');
|
||||
}
|
||||
|
||||
public function update($data)
|
||||
|
|
@ -63,13 +63,13 @@ class BookingPDFRepository extends BaseRepository
|
|||
{
|
||||
$document = new stdClass();
|
||||
$document->name = 'registration';
|
||||
$document->number = $this->model->lead_id;
|
||||
$document->number = $this->model->inquiry_id;
|
||||
$document->title = 'BUCHUNGSAUFTRAG';
|
||||
$document->voucher = null;
|
||||
$document->date = now();
|
||||
$document->total = $this->model->getPriceRaw();
|
||||
$dir = $this->getDirPath('pdf', 'booking', $document->date->format('Y'));
|
||||
$filename = "Buchnungsauftrag-" . $this->model->lead_id . ".pdf";
|
||||
$filename = "Buchnungsauftrag-" . $this->model->inquiry_id . ".pdf";
|
||||
$pdf_file = new CreatePDF('pdf.booking_registration');
|
||||
$data = [
|
||||
'booking' => $this->model,
|
||||
|
|
@ -85,7 +85,7 @@ class BookingPDFRepository extends BaseRepository
|
|||
{
|
||||
$document = new stdClass();
|
||||
$document->name = 'confirmation';
|
||||
$document->number = $this->model->lead_id;
|
||||
$document->number = $this->model->inquiry_id;
|
||||
$document->title = 'REISEBESTÄTIGUNG';
|
||||
$document->voucher = null;
|
||||
$document->date = now();
|
||||
|
|
@ -104,7 +104,7 @@ class BookingPDFRepository extends BaseRepository
|
|||
$document->final_payment_date = date('Y-m-d');
|
||||
}
|
||||
$dir = $this->getDirPath('pdf', 'booking', $document->date->format('Y'));
|
||||
$filename = "Reisebestätigung-" . $this->model->lead_id . ".pdf";
|
||||
$filename = "Reisebestätigung-" . $this->model->inquiry_id . ".pdf";
|
||||
|
||||
$pdf_file = new CreatePDF('pdf.booking_confirmation');
|
||||
$data = [
|
||||
|
|
@ -160,14 +160,14 @@ class BookingPDFRepository extends BaseRepository
|
|||
{
|
||||
$document = new stdClass();
|
||||
$document->name = 'voucher';
|
||||
$document->number = $this->model->lead_id;
|
||||
$document->number = $this->model->inquiry_id;
|
||||
$document->name = 'voucher';
|
||||
$document->title = $agency ? 'VOUCHER Agentur' : 'VOUCHER';
|
||||
$document->voucher = $agency ? 'agency' : 'client';
|
||||
$document->date = now();
|
||||
|
||||
$dir = $this->getDirPath('pdf', 'voucher', $document->date->format('Y'));
|
||||
$filename = ($agency ? 'VoucherAgentur' : 'Voucher') . "-" . $this->model->lead_id . ".pdf";
|
||||
$filename = ($agency ? 'VoucherAgentur' : 'Voucher') . "-" . $this->model->inquiry_id . ".pdf";
|
||||
|
||||
$pdf_file = new CreatePDF('pdf.booking_voucher');
|
||||
$data = [
|
||||
|
|
@ -224,7 +224,7 @@ class BookingPDFRepository extends BaseRepository
|
|||
//init document
|
||||
$document = new stdClass();
|
||||
$document->name = $identifier;
|
||||
$document->number = $this->model->lead_id;
|
||||
$document->number = $this->model->inquiry_id;
|
||||
$document->title = 'STORNOBESTÄTIGUNG';
|
||||
$document->voucher = null;
|
||||
$document->date = Carbon::parse($data['storno_print']);
|
||||
|
|
@ -253,7 +253,7 @@ class BookingPDFRepository extends BaseRepository
|
|||
|
||||
|
||||
$dir = $this->getDirPath('pdf', 'storno', $document->date->format('Y'));
|
||||
$filename = "Reisestornierung -" . $this->model->lead_id . ".pdf";
|
||||
$filename = "Reisestornierung -" . $this->model->inquiry_id . ".pdf";
|
||||
|
||||
$pdf_file = new CreatePDF('pdf.booking_storno');
|
||||
$data = [
|
||||
|
|
@ -288,7 +288,9 @@ class BookingPDFRepository extends BaseRepository
|
|||
$fill = [
|
||||
'booking_id' => $this->model->id,
|
||||
'customer_id' => $this->model->customer_id,
|
||||
'lead_id' => $this->model->lead_id,
|
||||
// booking_documents.lead_id ist ein Shadow-Feld von booking.inquiry_id;
|
||||
// die Spalte selbst wird von Phase 2 nicht umbenannt.
|
||||
'lead_id' => $this->model->inquiry_id,
|
||||
'identifier' => $identifier,
|
||||
'filename' => $filename,
|
||||
'dir' => $dir,
|
||||
|
|
|
|||
28
app/Repositories/ContactRepository.php
Normal file
28
app/Repositories/ContactRepository.php
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repositories;
|
||||
|
||||
use App\Models\Contact;
|
||||
|
||||
class ContactRepository extends BaseRepository
|
||||
{
|
||||
public function __construct(Contact $model)
|
||||
{
|
||||
$this->model = $model;
|
||||
}
|
||||
|
||||
public function updateContact(int|string $id, array $data): Contact
|
||||
{
|
||||
/** @var Contact $contact */
|
||||
$contact = Contact::findOrFail($id);
|
||||
$contact->fill($data);
|
||||
$contact->save();
|
||||
|
||||
return $contact;
|
||||
}
|
||||
|
||||
public function createContact(array $data): Contact
|
||||
{
|
||||
return Contact::create($data);
|
||||
}
|
||||
}
|
||||
|
|
@ -135,7 +135,8 @@ class CustomerMailRepository extends BaseRepository {
|
|||
$customer_mail->fill([
|
||||
'booking_id' => $booking->id,
|
||||
'customer_id' => $booking->customer_id,
|
||||
'lead_id' => $booking->lead_id,
|
||||
// customer_mails.lead_id-Spalte bleibt unverändert; Wert kommt aus booking.inquiry_id
|
||||
'lead_id' => $booking->inquiry_id,
|
||||
'is_answer' => $is_answer,
|
||||
'reply_id' => $reply_id,
|
||||
'email' => $mail_from,
|
||||
|
|
@ -153,7 +154,8 @@ class CustomerMailRepository extends BaseRepository {
|
|||
$customer_mail = CustomerMail::create([
|
||||
'booking_id' => $booking->id,
|
||||
'customer_id' => $booking->customer_id,
|
||||
'lead_id' => $booking->lead_id,
|
||||
// customer_mails.lead_id-Spalte bleibt unverändert; Wert kommt aus booking.inquiry_id
|
||||
'lead_id' => $booking->inquiry_id,
|
||||
'is_answer' => $is_answer,
|
||||
'reply_id' => $reply_id,
|
||||
'email' => $mail_from,
|
||||
|
|
@ -300,7 +302,7 @@ class CustomerMailRepository extends BaseRepository {
|
|||
$value->id = $customer_mail->booking_id;
|
||||
$value->booking = $booking;
|
||||
$value->show = 'single';
|
||||
$value->lead_title_id = " - (".$value->booking->lead_id.")";
|
||||
$value->lead_title_id = " - (".$value->booking->inquiry_id.")";
|
||||
|
||||
|
||||
$tmp = [];
|
||||
|
|
@ -342,7 +344,7 @@ class CustomerMailRepository extends BaseRepository {
|
|||
$value->booking = $booking;
|
||||
$value->show = 'single';
|
||||
$value->draft = true;
|
||||
$value->lead_title_id = " - (".$value->booking->lead_id.")";
|
||||
$value->lead_title_id = " - (".$value->booking->inquiry_id.")";
|
||||
|
||||
}else{
|
||||
//multi
|
||||
|
|
@ -379,8 +381,8 @@ class CustomerMailRepository extends BaseRepository {
|
|||
$value->draft = false;
|
||||
$value->booking = $booking;
|
||||
$value->message = "";
|
||||
$value->subject = " - (".$value->booking->lead_id.")";
|
||||
$value->lead_title_id = " - (".$value->booking->lead_id.")";
|
||||
$value->subject = " - (".$value->booking->inquiry_id.")";
|
||||
$value->lead_title_id = " - (".$value->booking->inquiry_id.")";
|
||||
$value->s_placeholder = "Betreff des Kunden";
|
||||
$value->m_placeholder = "Nachricht des Kunden";
|
||||
if(isset($data['customer_mail_id']) && $customer_mail = CustomerMail::find($data['customer_mail_id'])){
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ class LeadRepository extends BaseRepository {
|
|||
$data = [
|
||||
'booking_date' => date('Y-m-d'), //now
|
||||
'customer_id' => $this->model->customer->id,
|
||||
'lead_id' => $this->model->id,
|
||||
'inquiry_id' => $this->model->id,
|
||||
'new_drafts' => 1,
|
||||
'sf_guard_user_id' => $this->model->sf_guard_user_id,
|
||||
'branch_id' => 4,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue