From 3249236fe77b285fd7fc17cbc9cbcd97f30c02cf Mon Sep 17 00:00:00 2001 From: "sosuke.iwabuchi" Date: Sat, 23 Mar 2024 09:11:50 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=83=87=E3=83=BC?= =?UTF-8?q?=E3=82=BF=E4=BD=9C=E6=88=90=E3=82=B3=E3=83=9E=E3=83=B3=E3=83=89?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Test/方式3疎通データ作成.php | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 app/Console/Commands/Test/方式3疎通データ作成.php diff --git a/app/Console/Commands/Test/方式3疎通データ作成.php b/app/Console/Commands/Test/方式3疎通データ作成.php new file mode 100644 index 0000000..d348009 --- /dev/null +++ b/app/Console/Commands/Test/方式3疎通データ作成.php @@ -0,0 +1,116 @@ +beginTransaction(); + + // 店舗作成 + $shop = new Shop(); + $shop->name = "方式3疎通確認用店舗"; + $shop->under_amount_when_auth = 0; + $shop->qr_service_expire_min = 0; + $shop->save(); + + // デポジット作成 + $deposit = new Deposit(); + $deposit->shop_id = $shop->id; + $deposit->deposit = 10000; + $deposit->save(); + + + // QRサービス券駐車場グループ作成 + $group = new ServiceParkingGroup(); + $group->name = "方式3疎通確認用QRサービス券駐車場グループ"; + $group->save(); + + // QRサービス券駐車場グループ紐づけ作成 + $groupRelation = new ServiceParkingGroupRelation(); + $groupRelation->qr_service_parking_group_id = $group->id; + $groupRelation->parking_management_code = "90002"; + $groupRelation->save(); + + $groupRelation = new ServiceParkingGroupRelation(); + $groupRelation->qr_service_parking_group_id = $group->id; + $groupRelation->parking_management_code = "90005"; + $groupRelation->save(); + + // 設定作成 + $setting = new AcquisitionAvailableSetting(); + $setting->shop_id = $shop->id; + $setting->shop_no = 30; + $setting->qr_service_parking_group_id = $group->id; + $setting->discount_ticket_code = 31; + $setting->save(); + + // サービス券取得用トークン作成 + $token = CreateLogic::getToken($shop->id); + + $this->info(sprintf("トークン %s", $token->token)); + $this->info(sprintf("%s/qr-service/acquitision/%s", config('app.url'), $token->token)); + + $db->commit(); + } catch (Exception $e) { + $db->rollBack(); + throw $e; + } + + return self::RESULTCODE_SUCCESS; + } +}