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
|
|
@ -8,42 +8,37 @@ use App\Services\BookingImport;
|
|||
|
||||
class BookingController extends Controller
|
||||
{
|
||||
private $successStatus = 200;
|
||||
private $successKey = 'f6077389c9ce710e554763a5de02c8ec';
|
||||
|
||||
protected $draftRepo;
|
||||
private int $successStatus = 200;
|
||||
private string $successKey;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
$this->successKey = config('app.success_key');
|
||||
}
|
||||
|
||||
public function import()
|
||||
{
|
||||
|
||||
$request = \Request::all();
|
||||
if(!isset($request['key']) || $request['key'] !== $this->successKey){
|
||||
if (!isset($request['key']) || $request['key'] !== $this->successKey) {
|
||||
return response()->json(['error' => "key"], 401);
|
||||
}
|
||||
$travel_booking = TravelBooking::find($request['travel_booking_id']);
|
||||
|
||||
//# vor testing
|
||||
//$travel_booking = TravelBooking::find(2922);
|
||||
if(!isset($travel_booking) || !$travel_booking){
|
||||
if (!$travel_booking) {
|
||||
return response()->json(['error' => 'no-booking-found'], $this->successStatus);
|
||||
}
|
||||
|
||||
$booking = BookingImport::importFrom($travel_booking);
|
||||
|
||||
$ret= [
|
||||
'url_v1' => make_old_url('/index.php/booking/'.$booking->id.'/edit'),
|
||||
$ret = [
|
||||
'url_v1' => make_old_url('/index.php/booking/' . $booking->id . '/edit'),
|
||||
'url_v3' => route('booking_detail', $booking->id),
|
||||
'lead_id' => $booking->lead_id
|
||||
// API-Feld bleibt `lead_id` aus Abwärtskompatibilität für API-Konsumenten;
|
||||
// Wert kommt nach Modul 3 Phase 2 aus booking.inquiry_id.
|
||||
'lead_id' => $booking->inquiry_id
|
||||
];
|
||||
return response()->json(['success' => "import", "ret" => $ret], $this->successStatus);
|
||||
//return response()->json(['error' => 'no-node'], $this->successStatus);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue