From 05b12a6bb9a8bcbd87f2daf849c2d32ea7d203e1 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 16 Jul 2021 15:40:52 +1000 Subject: [PATCH] Refactor for hosted migration --- .../Controllers/Migration/StepsController.php | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Migration/StepsController.php b/app/Http/Controllers/Migration/StepsController.php index f39eb37a5a71..fe0541fd9180 100644 --- a/app/Http/Controllers/Migration/StepsController.php +++ b/app/Http/Controllers/Migration/StepsController.php @@ -72,10 +72,17 @@ class StepsController extends BaseController session()->put('MIGRATION_ENDPOINT', 'https://v5-app1.invoicing.co'); + + //refactor here to make this a little more magical + // return redirect( - url('/migration/auth') + url('/migration/companies') ); + // return redirect( + // url('/migration/auth') + // ); + // return redirect( // url('/migration/endpoint') // ); @@ -209,6 +216,28 @@ class StepsController extends BaseController ); } + if(Utils::isNinja()) + { + + //push a job with $request->all() and the auth()->user() reference; + // + //In that job we will + // + //Create data file + // + //Send along a custom protected route + // + //auth as the end user + //and process as per normal. + // + //we should include a success failure email to contact@ so we can follow up. + + if ($completeService->isSuccessful()) { + return view('migration.completed'); + } + + } + $completeService = (new CompleteService(session('MIGRATION_ACCOUNT_TOKEN'))); try {