diff --git a/app/Http/Controllers/Web/Custom/HelloTechno/CreateReceiptIssuingOrderController.php b/app/Http/Controllers/Web/Custom/HelloTechno/CreateReceiptIssuingOrderController.php index 90ad209..d8a6c2c 100644 --- a/app/Http/Controllers/Web/Custom/HelloTechno/CreateReceiptIssuingOrderController.php +++ b/app/Http/Controllers/Web/Custom/HelloTechno/CreateReceiptIssuingOrderController.php @@ -7,11 +7,13 @@ use App\Http\Controllers\Web\IParam; use App\Http\Controllers\Web\WebController; use App\Logic\ReceiptIssuingOrder\Custom\HelloTechno\CreateManager; use App\Models\ReceiptIssuingOrder as Order; +use App\Models\ReceiptIssuingHTParkingCustomOrder as HT; +use App\Util\Custom\HelloTechno\API; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; -class CreateReceiptIssuingOrderController extends WebController +class CreateReceiptIssuingOrderController extends HelloTechnoController { public function name(): string { @@ -27,7 +29,7 @@ class CreateReceiptIssuingOrderController extends WebController protected CreateReceiptIssuingOrderParam $param, private CreateManager $manager ) { - $this->middleware('auth:sanctum'); + parent::__construct(); $this->roleAllow(UserRole::NORMAL_ADMIN); } @@ -40,11 +42,21 @@ class CreateReceiptIssuingOrderController extends WebController { $param = $this->param; - // TODO 顧客情報取得 - // TODO 駐車場情報取得 + // 顧客情報取得 + // $customer = collect(API::getCustomers($param->customerCode)) + // ->where('customer_code', $param->customerCode) + // ->firstOrFail(); + // 駐車場情報取得 + // $parking = collect(API::getParkings($param->customerCode, $param->parkingManagementCode)) + // ->where('parking_management_code', $param->parkingManagementCode) + // ->firstOrFail(); $orderData = [ ...$param->toArray(), + // HT::COL_NAME_CUSTOMER_NAME => $customer['name'], + // HT::COL_NAME_PARKING_NAME => $parking['name'], + HT::COL_NAME_CUSTOMER_NAME => "TODOテスト運営会社", + HT::COL_NAME_PARKING_NAME => "TODOテスト駐車場", Order::COL_NAME_HANDLER_ID => Auth::id(), Order::COL_NAME_SUMMARY_KEY1 => $param->customerCode, Order::COL_NAME_SUMMARY_KEY2 => $param->parkingManagementCode, diff --git a/app/Http/Controllers/Web/Custom/HelloTechno/CustomersController.php b/app/Http/Controllers/Web/Custom/HelloTechno/CustomersController.php index d0c2696..bfc3c66 100644 --- a/app/Http/Controllers/Web/Custom/HelloTechno/CustomersController.php +++ b/app/Http/Controllers/Web/Custom/HelloTechno/CustomersController.php @@ -2,15 +2,13 @@ namespace App\Http\Controllers\Web\Custom\HelloTechno; -use App\Codes\Custom; use App\Codes\UserRole; use App\Http\Controllers\Web\IParam; -use App\Http\Controllers\Web\WebController; use App\Util\Custom\HelloTechno\API; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; -class CustomersController extends WebController +class CustomersController extends HelloTechnoController { public function name(): string { @@ -25,9 +23,8 @@ class CustomersController extends WebController public function __construct( protected CustomersParam $param, ) { - $this->middleware('auth:sanctum'); + parent::__construct(); $this->roleAllow(UserRole::NORMAL_ADMIN); - $this->customAllow = [Custom::HELLO_TECHNO]; } protected function getParam(): IParam diff --git a/app/Http/Controllers/Web/Custom/HelloTechno/HelloTechnoController.php b/app/Http/Controllers/Web/Custom/HelloTechno/HelloTechnoController.php new file mode 100644 index 0000000..563a08d --- /dev/null +++ b/app/Http/Controllers/Web/Custom/HelloTechno/HelloTechnoController.php @@ -0,0 +1,17 @@ +middleware('auth:sanctum'); + $this->customAllow = [Custom::HELLO_TECHNO]; + } +} diff --git a/app/Http/Controllers/Web/Custom/HelloTechno/ParkingsController.php b/app/Http/Controllers/Web/Custom/HelloTechno/ParkingsController.php index 228b4c4..44b52ee 100644 --- a/app/Http/Controllers/Web/Custom/HelloTechno/ParkingsController.php +++ b/app/Http/Controllers/Web/Custom/HelloTechno/ParkingsController.php @@ -2,18 +2,13 @@ namespace App\Http\Controllers\Web\Custom\HelloTechno; -use App\Codes\Custom; use App\Codes\UserRole; use App\Http\Controllers\Web\IParam; -use App\Http\Controllers\Web\WebController; -use App\Logic\ReceiptIssuingOrder\CreateManager; use App\Util\Custom\HelloTechno\API; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; -use Illuminate\Support\Facades\Http; -use Illuminate\Support\Facades\Log; -class ParkingsController extends WebController +class ParkingsController extends HelloTechnoController { public function name(): string { @@ -28,9 +23,8 @@ class ParkingsController extends WebController public function __construct( protected ParkingsParam $param, ) { - $this->middleware('auth:sanctum'); + parent::__construct(); $this->roleAllow(UserRole::NORMAL_ADMIN); - $this->customAllow = [Custom::HELLO_TECHNO]; } protected function getParam(): IParam diff --git a/app/Http/Controllers/Web/Custom/HelloTechno/ReceiptIssuingOrdersController.php b/app/Http/Controllers/Web/Custom/HelloTechno/ReceiptIssuingOrdersController.php new file mode 100644 index 0000000..1ec3683 --- /dev/null +++ b/app/Http/Controllers/Web/Custom/HelloTechno/ReceiptIssuingOrdersController.php @@ -0,0 +1,49 @@ +roleAllow(UserRole::NORMAL_ADMIN); + } + + protected function getParam(): IParam + { + return $this->param; + } + + protected function run(Request $request): JsonResponse + { + $param = $this->param; + + $list = $this->repository->get($param->toArray()); + + + return $this->successResponse([ + 'records' => $list + ]); + } +} diff --git a/app/Http/Controllers/Web/Custom/HelloTechno/ReceiptIssuingsOrdersParam.php b/app/Http/Controllers/Web/Custom/HelloTechno/ReceiptIssuingsOrdersParam.php new file mode 100644 index 0000000..f2efb3c --- /dev/null +++ b/app/Http/Controllers/Web/Custom/HelloTechno/ReceiptIssuingsOrdersParam.php @@ -0,0 +1,32 @@ + $this->str(true), + HT::COL_NAME_CUSTOMER_NAME => $this->str(true), + HT::COL_NAME_PARKING_MANAGEMENT_CODE => $this->str(true), + HT::COL_NAME_PARKING_NAME => $this->str(true), + HT::COL_NAME_ADJUST_SEQ_NO => $this->numeric(true), + ], + $this->sortableRules(), + ); + } +} diff --git a/app/Http/Controllers/Web/ReceiptIssuingOrder/DownloadController.php b/app/Http/Controllers/Web/ReceiptIssuingOrder/DownloadController.php new file mode 100644 index 0000000..ed2df57 --- /dev/null +++ b/app/Http/Controllers/Web/ReceiptIssuingOrder/DownloadController.php @@ -0,0 +1,41 @@ +param; + } + + protected function run(Request $request): Response + { + $param = $this->param; + + return $this->manager->initByToken($param->accessToken)->service(); + } +} diff --git a/app/Http/Controllers/Web/ReceiptIssuingOrder/DownloadParam.php b/app/Http/Controllers/Web/ReceiptIssuingOrder/DownloadParam.php new file mode 100644 index 0000000..608a516 --- /dev/null +++ b/app/Http/Controllers/Web/ReceiptIssuingOrder/DownloadParam.php @@ -0,0 +1,21 @@ + $this->str(), + + ]; + } +} diff --git a/app/Http/Controllers/Web/ReceiptIssuingOrder/TokenCheckController.php b/app/Http/Controllers/Web/ReceiptIssuingOrder/TokenCheckController.php new file mode 100644 index 0000000..355351b --- /dev/null +++ b/app/Http/Controllers/Web/ReceiptIssuingOrder/TokenCheckController.php @@ -0,0 +1,45 @@ +param; + } + + protected function run(Request $request): JsonResponse + { + $param = $this->param; + + if (!$this->manager->check($param->accessToken)) { + return $this->failedResponse(); + } + return $this->successResponse(); + } +} diff --git a/app/Http/Controllers/Web/ReceiptIssuingOrder/TokenCheckParam.php b/app/Http/Controllers/Web/ReceiptIssuingOrder/TokenCheckParam.php new file mode 100644 index 0000000..b6cfc74 --- /dev/null +++ b/app/Http/Controllers/Web/ReceiptIssuingOrder/TokenCheckParam.php @@ -0,0 +1,21 @@ + $this->str(), + + ]; + } +} diff --git a/app/Http/Controllers/Web/WebController.php b/app/Http/Controllers/Web/WebController.php index fa6877e..65b4f80 100644 --- a/app/Http/Controllers/Web/WebController.php +++ b/app/Http/Controllers/Web/WebController.php @@ -80,6 +80,10 @@ abstract class WebController extends BaseController */ private ResultCode|null $resultCode = ResultCode::SECCESS; + public function __construct() + { + } + /** * パラメータオブジェクト @@ -335,11 +339,7 @@ abstract class WebController extends BaseController $myCustoms = Auth::user()->contract->custom(); - - - foreach ($this->customAllow as $targetCustom) { - logger(['myCustoms' => $myCustoms, 'target' => $targetCustom]); if (in_array($targetCustom, $myCustoms, true)) { return true; } diff --git a/app/Logic/ReceiptIssuingOrder/CreateManager.php b/app/Logic/ReceiptIssuingOrder/CreateManager.php index 38ec74c..6db995a 100644 --- a/app/Logic/ReceiptIssuingOrder/CreateManager.php +++ b/app/Logic/ReceiptIssuingOrder/CreateManager.php @@ -6,6 +6,7 @@ use App\Codes\ReceiptIssuingOrderStatus; use App\Codes\SMSSendPurpose; use App\Logic\SMS\SMSManager; use App\Models\ReceiptIssuingOrder; +use App\Util\DateUtil; use Illuminate\Support\Facades\View; use LogicException; @@ -16,6 +17,7 @@ class CreateManager extends ReceiptIssuingOrderManager protected ReceiptIssuingOrder $order, protected SMSManager $smsManager ) { + parent::__construct($order); } public function init() @@ -50,6 +52,7 @@ class CreateManager extends ReceiptIssuingOrderManager // モデル更新 $order->status = ReceiptIssuingOrderStatus::CREATED; + $order->order_datetime = DateUtil::now(); $this->refreshToken(); $contractId = $this->loginUser()->getContractId(); diff --git a/app/Logic/ReceiptIssuingOrder/PDFDownLoadManager.php b/app/Logic/ReceiptIssuingOrder/PDFDownLoadManager.php index 2324036..e745cc3 100644 --- a/app/Logic/ReceiptIssuingOrder/PDFDownLoadManager.php +++ b/app/Logic/ReceiptIssuingOrder/PDFDownLoadManager.php @@ -4,17 +4,16 @@ namespace App\Logic\ReceiptIssuingOrder; use App\Codes\ReceiptIssuingOrderStatus; use App\Exceptions\AppCommonException; -use App\Logic\SMS\SMSManager; use App\Models\ReceiptIssuingOrder; use PDF; -class UpdateManager extends ReceiptIssuingOrderManager +class PDFDownLoadManager extends ReceiptIssuingOrderManager { public function __construct( protected ReceiptIssuingOrder $order, - protected SMSManager $smsManager ) { + parent::__construct($order); } public function initByToken(string $token) @@ -36,7 +35,7 @@ class UpdateManager extends ReceiptIssuingOrderManager return $this; } - protected function service() + public function service() { $order = $this->order; @@ -48,6 +47,7 @@ class UpdateManager extends ReceiptIssuingOrderManager ->inline(); $order->status = ReceiptIssuingOrderStatus::DOWNLOAD_DONE; + $order->save(); return $ret; } diff --git a/app/Logic/ReceiptIssuingOrder/ReceiptIssuingOrderManager.php b/app/Logic/ReceiptIssuingOrder/ReceiptIssuingOrderManager.php index 895af74..fcfbd6a 100644 --- a/app/Logic/ReceiptIssuingOrder/ReceiptIssuingOrderManager.php +++ b/app/Logic/ReceiptIssuingOrder/ReceiptIssuingOrderManager.php @@ -15,8 +15,9 @@ abstract class ReceiptIssuingOrderManager protected bool $initialized = false; - protected function __construct(protected ReceiptIssuingOrder $order) - { + public function __construct( + protected ReceiptIssuingOrder $order, + ) { } protected function fetch(string $receiptIssuingOrderId) @@ -39,10 +40,6 @@ abstract class ReceiptIssuingOrderManager protected function checkToken(string $token): bool { - if ($this->order->isNotSavedModel()) { - throw new LogicException("初期化不良"); - } - $order = ReceiptIssuingOrder::whereAccessToken($token) ->first(); diff --git a/app/Logic/ReceiptIssuingOrder/TokenCheckManager.php b/app/Logic/ReceiptIssuingOrder/TokenCheckManager.php new file mode 100644 index 0000000..20030d9 --- /dev/null +++ b/app/Logic/ReceiptIssuingOrder/TokenCheckManager.php @@ -0,0 +1,20 @@ +checkToken($token); + } +} diff --git a/app/Logic/ReceiptIssuingOrder/UpdateManager.php b/app/Logic/ReceiptIssuingOrder/UpdateManager.php index 3b9fdda..2ae8406 100644 --- a/app/Logic/ReceiptIssuingOrder/UpdateManager.php +++ b/app/Logic/ReceiptIssuingOrder/UpdateManager.php @@ -13,6 +13,7 @@ class UpdateManager extends ReceiptIssuingOrderManager protected ReceiptIssuingOrder $order, protected SMSManager $smsManager ) { + parent::__construct($order); } public function initByToken(string $token) diff --git a/app/Models/ReceiptIssuingHTParkingCustomOrder.php b/app/Models/ReceiptIssuingHTParkingCustomOrder.php index 6c1e7ea..923ad0f 100644 --- a/app/Models/ReceiptIssuingHTParkingCustomOrder.php +++ b/app/Models/ReceiptIssuingHTParkingCustomOrder.php @@ -11,6 +11,9 @@ class ReceiptIssuingHTParkingCustomOrder extends AppModel const COL_NAME_CUSTOMER_CODE = "customer_code"; const COL_NAME_PARKING_MANAGEMENT_CODE = "parking_management_code"; const COL_NAME_ADJUST_SEQ_NO = "adjust_seq_no"; + const COL_NAME_CUSTOMER_NAME = "customer_name"; + const COL_NAME_PARKING_NAME = "parking_name"; + public function getModelName(): string { diff --git a/app/Models/User.php b/app/Models/User.php index 632f0ca..5035fa7 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -13,6 +13,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Query\Builder; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; +use Illuminate\Support\Facades\DB; use Laravel\Sanctum\HasApiTokens; class User extends Authenticatable implements IModelFeature @@ -22,6 +23,7 @@ class User extends Authenticatable implements IModelFeature const COL_NAME_ID = 'id'; const COL_NAME_ROLE = 'role'; const COL_NAME_EMAIL = 'email'; + const COL_NAME_NAME = 'name'; /** * The attributes that should be hidden for serialization. diff --git a/app/Repositories/BaseRepository.php b/app/Repositories/BaseRepository.php index 92e2e1f..b66521f 100644 --- a/app/Repositories/BaseRepository.php +++ b/app/Repositories/BaseRepository.php @@ -17,7 +17,7 @@ abstract class BaseRepository const MAX_LIMIT = 500; - protected static function sort(Builder $query, array $condition) + protected function sort(Builder $query, array $condition) { $target = data_get($condition, self::CONDITION_SORT_TARGET); $order = data_get($condition, self::CONDITION_SORT_ORDER); @@ -25,24 +25,26 @@ abstract class BaseRepository return; } - if ($order === self::ORDER_ASC) { + if ($order === static::ORDER_ASC) { $query->orderBy($target); } - if ($order === self::ORDER_DESC) { + if ($order === static::ORDER_DESC) { $query->orderByDesc($target); } } - protected static function limit(Builder $query, array $condition, int $default = self::MAX_LIMIT) + protected function limit(Builder $query, array $condition, ?int $default = null) { - $limit = data_get($condition, self::CONDITION_LIMIT, $default) ?? $default; + + + $limit = data_get($condition, self::CONDITION_LIMIT, $default) ?? $default ?? static::MAX_LIMIT; $limit = min($limit, self::MAX_LIMIT); $query->limit($limit); } - protected static function where(Builder $query, array $condition, string $conditionKey, string|null $columnName = null): bool + protected function where(Builder $query, array $condition, string $conditionKey, string|null $columnName = null): bool { $ret = data_get($condition, $conditionKey); @@ -53,7 +55,7 @@ abstract class BaseRepository return false; } } - protected static function whereIn(Builder $query, array $condition, string $conditionKey, string|null $columnName = null): bool + protected function whereIn(Builder $query, array $condition, string $conditionKey, string|null $columnName = null): bool { $ret = data_get($condition, $conditionKey); @@ -64,4 +66,10 @@ abstract class BaseRepository return false; } } + + protected function makeColumnName(array $targets, ?string $as = null): string + { + $as = $as ? " as {$as}" : ""; + return implode('.', $targets) . $as; + } } diff --git a/app/Repositories/Custom/HelloTechno/ReceiptIssuingOrderRepository.php b/app/Repositories/Custom/HelloTechno/ReceiptIssuingOrderRepository.php new file mode 100644 index 0000000..da01bbb --- /dev/null +++ b/app/Repositories/Custom/HelloTechno/ReceiptIssuingOrderRepository.php @@ -0,0 +1,113 @@ + + */ + public function get(array $condition): Collection + { + $order = ReceiptIssuingOrder::getBuilder(static::TABLE_ORDER); + + $table = $order + ->joinSub(CustomOrder::getBuilder(), static::TABLE_CUSTOM_ORDER, function (JoinClause $join) { + $join->on( + $this->makeColumnName([static::TABLE_ORDER, ReceiptIssuingOrder::COL_NAME_ID]), + $this->makeColumnName([static::TABLE_CUSTOM_ORDER, CustomOrder::COL_NAME_RECEIPT_ISSUING_ORDER_ID]) + ); + }) + ->leftJoinSub(User::getBuilder(), static::TABLE_HANDLER, function (JoinClause $join) { + $join->on( + $this->makeColumnName([static::TABLE_ORDER, ReceiptIssuingOrder::COL_NAME_HANDLER_ID]), + $this->makeColumnName([static::TABLE_HANDLER, CustomOrder::COL_NAME_ID]) + ); + }); + + // -----検索条件 + + // 運営会社 + $this->where($table, $condition, $this->makeColumnName([static::TABLE_CUSTOM_ORDER, CustomOrder::COL_NAME_CUSTOMER_CODE])); + $customerName = data_get($condition, static::CONDITION_CUSTOMER_NAME); + if ($customerName) { + $table->where($this->makeColumnName([static::TABLE_CUSTOM_ORDER, CustomOrder::COL_NAME_CUSTOMER_NAME]), 'like', "%{$customerName}%"); + } + + // 駐車場 + $this->where($table, $condition, $this->makeColumnName([static::TABLE_CUSTOM_ORDER, CustomOrder::COL_NAME_PARKING_MANAGEMENT_CODE])); + $parkihngName = data_get($condition, static::CONDITION_PARKING_MANAGEMENT_NAME); + if ($parkihngName) { + $table->where($this->makeColumnName([static::TABLE_CUSTOM_ORDER, CustomOrder::COL_NAME_PARKING_NAME]), 'like', "%{$parkihngName}%"); + } + + + // ステータス + $this->where($table, $condition, $this->makeColumnName([static::TABLE_ORDER, ReceiptIssuingOrder::COL_NAME_STATUS])); + + + + $table->select($this->columns()); + + $main = DB::table($table, "main"); + + // ソート + $this->sort($main, $condition); + $main->orderBy(static::CONDITION_ID); + + // リミット + $this->limit($main, $condition); + + + return ReceiptIssuingOrderRepositoryData::makeList($main->get()); + } + + private function columns() + { + $order = static::TABLE_ORDER; + $custom = static::TABLE_CUSTOM_ORDER; + $handler = static::TABLE_HANDLER; + $columns = [ + $this->makeColumnName([$order, ReceiptIssuingOrder::COL_NAME_ID], 'id'), + $this->makeColumnName([$order, ReceiptIssuingOrder::COL_NAME_STATUS], 'status'), + $this->makeColumnName([$order, ReceiptIssuingOrder::COL_NAME_ORDER_DATETIME], 'order_datetime'), + $this->makeColumnName([$custom, CustomOrder::COL_NAME_CUSTOMER_CODE], 'customer_code'), + $this->makeColumnName([$custom, CustomOrder::COL_NAME_PARKING_MANAGEMENT_CODE], 'parking_management_code'), + $this->makeColumnName([$custom, CustomOrder::COL_NAME_CUSTOMER_NAME], 'customer_name'), + $this->makeColumnName([$custom, CustomOrder::COL_NAME_PARKING_NAME], 'parking_name'), + $this->makeColumnName([$handler, User::COL_NAME_ID], 'handler_id'), + $this->makeColumnName([$handler, User::COL_NAME_NAME], 'handler_name'), + + ]; + + + return $columns; + } +} diff --git a/app/Repositories/Custom/HelloTechno/ReceiptIssuingOrderRepositoryData.php b/app/Repositories/Custom/HelloTechno/ReceiptIssuingOrderRepositoryData.php new file mode 100644 index 0000000..96f6866 --- /dev/null +++ b/app/Repositories/Custom/HelloTechno/ReceiptIssuingOrderRepositoryData.php @@ -0,0 +1,11 @@ +failed()) { - throw $res->throw(); + try { + $res = Http::get($url, $query); + if ($res->failed()) { + throw $res->throw(); + } + $data = $res->json(); + + if (data_get($data, static::RESULT_CODE) !== static::RESULT_CODE_SUCCESS) { + Log::error("HT RESPONSE ERROR"); + Log::error($data); + throw new AppCommonException('HT API 失敗'); + } + return data_get($data, static::FIELD_DATA, []); + } catch (Exception $e) { + Log::error("HelloTechno API エラー URL:${url}]"); + throw $e; } - $data = $res->json(); - - if (data_get($data, static::RESULT_CODE) !== static::RESULT_CODE_SUCCESS) { - Log::error("HT RESPONSE ERROR"); - Log::error($data); - throw new AppCommonException('HT API 失敗'); - } - - return data_get($data, static::FIELD_DATA, []); } } diff --git a/app/Util/MigrationHelper.php b/app/Util/MigrationHelper.php index 80ac21a..95c3ecf 100644 --- a/app/Util/MigrationHelper.php +++ b/app/Util/MigrationHelper.php @@ -127,10 +127,13 @@ class MigrationHelper return $this; } - public function userId(bool $nullable = false) + public function userId(bool $nullable = false, ?string $columnName = null, ?string $comment = null) { - $this->table->uuid(ColumnName::USER_ID)->comment("ユーザーID")->nullable($nullable); - $this->table->foreign(ColumnName::USER_ID)->references(ColumnName::ID)->on(User::getTableName()); + + $columnName = $columnName ?? ColumnName::USER_ID; + $comment = $comment ?? "ユーザーID"; + $this->table->uuid($columnName)->comment($comment)->nullable($nullable); + $this->table->foreign($columnName)->references(ColumnName::ID)->on(User::getTableName()); return $this; } diff --git a/composer.json b/composer.json index ccf1a34..4b9de2d 100644 --- a/composer.json +++ b/composer.json @@ -16,6 +16,7 @@ "require-dev": { "barryvdh/laravel-ide-helper": "^2.13", "fakerphp/faker": "^1.9.1", + "itsgoingd/clockwork": "^5.1", "laravel/pint": "^1.0", "laravel/sail": "^1.18", "mockery/mockery": "^1.4.4", diff --git a/composer.lock b/composer.lock index 065bf66..5002687 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "830b2086d431430c84cff2228ec2809a", + "content-hash": "edf71dac141191fd318aa91cb311db2a", "packages": [ { "name": "barryvdh/laravel-snappy", @@ -6425,6 +6425,74 @@ }, "time": "2020-07-09T08:09:16+00:00" }, + { + "name": "itsgoingd/clockwork", + "version": "v5.1.12", + "source": { + "type": "git", + "url": "https://github.com/itsgoingd/clockwork.git", + "reference": "c9dbdbb1f0efd19bb80f1080ef63f1b9b1bc3b1b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/itsgoingd/clockwork/zipball/c9dbdbb1f0efd19bb80f1080ef63f1b9b1bc3b1b", + "reference": "c9dbdbb1f0efd19bb80f1080ef63f1b9b1bc3b1b", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=5.6" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Clockwork\\Support\\Laravel\\ClockworkServiceProvider" + ], + "aliases": { + "Clockwork": "Clockwork\\Support\\Laravel\\Facade" + } + } + }, + "autoload": { + "psr-4": { + "Clockwork\\": "Clockwork/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "itsgoingd", + "email": "itsgoingd@luzer.sk", + "homepage": "https://twitter.com/itsgoingd" + } + ], + "description": "php dev tools in your browser", + "homepage": "https://underground.works/clockwork", + "keywords": [ + "Devtools", + "debugging", + "laravel", + "logging", + "lumen", + "profiling", + "slim" + ], + "support": { + "issues": "https://github.com/itsgoingd/clockwork/issues", + "source": "https://github.com/itsgoingd/clockwork/tree/v5.1.12" + }, + "funding": [ + { + "url": "https://github.com/itsgoingd", + "type": "github" + } + ], + "time": "2022-12-13T00:04:12+00:00" + }, { "name": "laravel/pint", "version": "v1.8.0", diff --git a/database/migrations/2023_04_15_150500_create_users_table.php b/database/migrations/2023_04_15_150500_create_users_table.php index d492c5b..de365d2 100644 --- a/database/migrations/2023_04_15_150500_create_users_table.php +++ b/database/migrations/2023_04_15_150500_create_users_table.php @@ -37,6 +37,7 @@ return new class extends Migration $table->string('email')->comment("Email")->nullable(); $table->string('password')->comment("ログインパスワード")->nullable(); $table->unsignedTinyInteger("role")->comment("認可")->nullable(); + $table->string('name')->comment("氏名")->nullable(); $helper->index(1, [ColumnName::CONTRACT_ID]); diff --git a/database/migrations/2023_04_15_152400_create_receipt_issuing_orders_table.php b/database/migrations/2023_04_15_152400_create_receipt_issuing_orders_table.php index 1b6d069..9a3416e 100644 --- a/database/migrations/2023_04_15_152400_create_receipt_issuing_orders_table.php +++ b/database/migrations/2023_04_15_152400_create_receipt_issuing_orders_table.php @@ -32,9 +32,9 @@ return new class extends Migration return function (Blueprint $table, MigrationHelper $helper) { $helper->baseColumn() - ->contractId(); + ->contractId() + ->userId(true, "handler_id", "担当者ID"); - $table->string("handler_id")->comment("担当者ID")->nullable(); $table->datetime("order_datetime")->comment("依頼日時")->nullable(); $table->string("status")->comment("ステータス")->nullable(); $table->string("summary_key1")->comment("集計キー1")->nullable(); diff --git a/database/migrations/2023_04_24_160000_create_receipt_issuing_ht_custom_orders_table.php b/database/migrations/2023_04_24_160000_create_receipt_issuing_ht_custom_orders_table.php index 9a815f1..8a34b6e 100644 --- a/database/migrations/2023_04_24_160000_create_receipt_issuing_ht_custom_orders_table.php +++ b/database/migrations/2023_04_24_160000_create_receipt_issuing_ht_custom_orders_table.php @@ -37,6 +37,8 @@ return new class extends Migration $table->string("customer_code")->comment("顧客コード")->nullable(); $table->string("parking_management_code")->comment("駐車場管理コード")->nullable(); $table->unsignedInteger("adjust_seq_no")->comment("精算連番")->nullable(); + $table->string("customer_name")->comment("顧客名")->nullable(); + $table->string("parking_name")->comment("駐車場名")->nullable(); $helper->index(1, [ColumnName::RECEIPT_ISSUING_ORDER_ID]); }; diff --git a/database/seeders/TestUserSeeder.php b/database/seeders/TestUserSeeder.php index a44bb39..b218c8c 100644 --- a/database/seeders/TestUserSeeder.php +++ b/database/seeders/TestUserSeeder.php @@ -34,6 +34,7 @@ class TestUserSeeder extends Seeder User::factory()->for($contract)->create([ User::COL_NAME_EMAIL => $email, User::COL_NAME_ROLE => $role, + User::COL_NAME_NAME => $email . "太郎", ]); } } @@ -48,6 +49,7 @@ class TestUserSeeder extends Seeder User::factory()->for($contract)->create([ User::COL_NAME_EMAIL => $email, User::COL_NAME_ROLE => UserRole::NORMAL_ADMIN, + User::COL_NAME_NAME => $email . "太郎", ]); } } diff --git a/routes/api.php b/routes/api.php index a7f32eb..7c6a627 100644 --- a/routes/api.php +++ b/routes/api.php @@ -17,8 +17,15 @@ RouteHelper::get('/me', App\Http\Controllers\Web\Auth\MeController::class); RouteHelper::post('/login', App\Http\Controllers\Web\Auth\LoginController::class); RouteHelper::get('/logout', App\Http\Controllers\Web\Auth\LogoutController::class); +RouteHelper::get('/app-token-check', App\Http\Controllers\Web\ReceiptIssuingOrder\TokenCheckController::class); + + +RouteHelper::get('/receip/download', App\Http\Controllers\Web\ReceiptIssuingOrder\TokenCheckController::class); + + // Custom for HelloTechno RouteHelper::get('/custom/hello-techno/customers', App\Http\Controllers\Web\Custom\HelloTechno\CustomersController::class); RouteHelper::get('/custom/hello-techno/parkings', App\Http\Controllers\Web\Custom\HelloTechno\ParkingsController::class); // RouteHelper::get('/custom/hello-techno/adjust-data', App\Http\Controllers\Web\Custom\HelloTechno\CustomersController::class); +RouteHelper::get('/custom/hello-techno/receipt-issuing-orders', App\Http\Controllers\Web\Custom\HelloTechno\ReceiptIssuingOrdersController::class); RouteHelper::post('/custom/hello-techno/receipt-issuing-order/create', App\Http\Controllers\Web\Custom\HelloTechno\CreateReceiptIssuingOrderController::class); diff --git a/routes/web.php b/routes/web.php index cc31243..936a0e2 100644 --- a/routes/web.php +++ b/routes/web.php @@ -19,6 +19,8 @@ Route::get('pdf', 'App\Http\Controllers\PDFController@index'); RouteHelper::post('/receiptIssuingOrder/create', App\Http\Controllers\Web\ReceiptIssuingOrder\CreateController::class); +// 領収証ダウンロード +RouteHelper::get('/receipt/download', App\Http\Controllers\Web\ReceiptIssuingOrder\DownloadController::class); // ルーティングで適合しない場合はフロント側のRoutingにゆだねる RouteHelper::get('/{any?}', App\Http\Controllers\Web\IndexController::class)->where('any', '.*');