-
Notifications
You must be signed in to change notification settings - Fork 718
feat: 返品申請機能を追加 #6838
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ttokoro20240902
wants to merge
24
commits into
4.4
Choose a base branch
from
feature/refund-request
base: 4.4
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: 返品申請機能を追加 #6838
Changes from 9 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
194534c
feat: 返品申請のデータ層を追加(Entity/Repository/初期データ/マイグレーション) (#6820)
ttokoro20240902 605aaf1
feat: 返品申請のイベントを追加(EccubeEvents 定数 / RefundRequestEvent) (#6820)
ttokoro20240902 3df39df
feat: 返品申請のステートマシンとサービスを追加 (#6820)
ttokoro20240902 e3125cc
feat: 返品申請のフォームタイプを追加(Front/Admin) (#6820)
ttokoro20240902 86ff9e7
feat: 返品申請のController・テンプレート・ナビ・翻訳を追加 (#6820)
ttokoro20240902 2451340
fix: 返品申請管理テンプレートのCSRFトークン処理を修正
ttokoro20240902 c3b14fa
feat: 返品申請のCSVエクスポート機能を追加 (#6820)
ttokoro20240902 6192079
test: 返品申請のPHPUnitテストを追加 (#6820)
ttokoro20240902 a2e8df9
test: 返品申請のE2Eテスト(Playwright)を追加 (#6820)
ttokoro20240902 8d9bc8e
test: 返品申請テストにファイル操作・CSV・セキュリティ検証を追加 (#6820)
ttokoro20240902 ab18371
fix: PHPStan・Rector指摘を修正(#6820)
ttokoro20240902 9d4e99e
fix: Rector残指摘とCodeRabbitレビュー指摘を修正 (#6820)
ttokoro20240902 c7c7ffd
fix: 返品申請の確認画面でエビデンスファイルが消える問題を修正 (#6820)
ttokoro20240902 c8fffcd
style: 返品申請の完了・履歴画面のレイアウトを中央寄せに修正 (#6820)
ttokoro20240902 bf3681a
style: 返品申請管理(管理画面)の検索結果ゼロ件メッセージを中央寄せに修正 (#6820)
ttokoro20240902 9905bb0
fix: 返品申請管理の一覧で初期表示時に常にゼロ件になる問題を修正 (#6820)
ttokoro20240902 1429c79
feat: 返品申請管理一覧に件数セレクタとページャを追加 (#6820)
ttokoro20240902 3084639
style: 返品申請管理一覧のレイアウトを受注管理一覧に合わせる (#6820)
ttokoro20240902 b8e580e
style: 返品申請管理一覧の結果領域・空表示領域に左右余白を追加 (#6820)
ttokoro20240902 f6328e3
style: 返品申請詳細画面の戻るボタン・保存ボタンを画面幅に合わせて配置 (#6820)
ttokoro20240902 fb62608
fix: CodeRabbit 残指摘と Rector 指摘を修正 (#6820)
ttokoro20240902 1ee17e1
fix: 返品申請ステータスCSVを definition.yml に登録 (#6820)
ttokoro20240902 34f86e1
fix: 返品申請詳細 E2E の card-body strict-mode violation を修正 (#6820)
ttokoro20240902 53e1f26
fix: 返品申請のレビュー指摘対応(履歴ボタン条件表示・遷移ガード・配信ヘッダ)
ttokoro20240902 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| /* | ||
| * This file is part of EC-CUBE | ||
| * | ||
| * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved. | ||
| * | ||
| * http://www.ec-cube.co.jp/ | ||
| * | ||
| * For the full copyright and license information, please view the LICENSE | ||
| * file that was distributed with this source code. | ||
| */ | ||
|
|
||
| namespace DoctrineMigrations; | ||
|
|
||
| use Doctrine\DBAL\Schema\Schema; | ||
| use Doctrine\Migrations\AbstractMigration; | ||
| use Eccube\Entity\Master\RefundRequestStatus; | ||
|
|
||
| /** | ||
| * 返品申請機能の初期データを既存環境へ投入する. | ||
| * | ||
| * - mtb_refund_request_status(返品申請ステータス・マスタ) | ||
| * - dtb_mail_template(管理者向け返品申請通知メール / id=10) | ||
| * - dtb_csv(商品CSV出力項目 refund_allowed / id=215) | ||
| * | ||
| * テーブル自体は Entity 属性+schema:update で反映されるため、ここでは INSERT のみを扱う。 | ||
| */ | ||
| final class Version20260615000000 extends AbstractMigration | ||
| { | ||
| public function up(Schema $schema): void | ||
| { | ||
| $lang = env('ECCUBE_LOCALE'); | ||
|
|
||
| // mtb_refund_request_status | ||
| $statuses = [ | ||
| RefundRequestStatus::NEW => $lang === 'en' ? 'New' : '新規申請', | ||
| RefundRequestStatus::PROCESSING => $lang === 'en' ? 'Processing' : '処理中', | ||
| RefundRequestStatus::ACCEPTED => $lang === 'en' ? 'Accepted' : '承認済', | ||
| RefundRequestStatus::DECLINED => $lang === 'en' ? 'Declined' : '却下', | ||
| RefundRequestStatus::INFO_REQUESTED => $lang === 'en' ? 'Information Requested' : '追加情報依頼', | ||
| ]; | ||
| $sortNo = 0; | ||
| foreach ($statuses as $id => $name) { | ||
| $exists = $this->connection->fetchOne( | ||
| 'SELECT COUNT(*) FROM mtb_refund_request_status WHERE id = :id', | ||
| ['id' => $id] | ||
| ); | ||
| if ($exists == 0) { | ||
| $this->addSql( | ||
| "INSERT INTO mtb_refund_request_status (id, name, sort_no, discriminator_type) VALUES (?, ?, ?, 'refundrequeststatus')", | ||
| [$id, $name, $sortNo] | ||
| ); | ||
| } | ||
| $sortNo++; | ||
| } | ||
|
|
||
| // dtb_mail_template(管理者向け返品申請通知メール) | ||
| $mailExists = $this->connection->fetchOne( | ||
| 'SELECT COUNT(*) FROM dtb_mail_template WHERE id = 10' | ||
| ); | ||
| if ($mailExists == 0) { | ||
| $name = $lang === 'en' ? 'Refund Request Notification' : '返品申請通知メール'; | ||
| $subject = $lang === 'en' ? 'A refund request has been submitted' : '返品申請を受け付けました'; | ||
| $this->addSql( | ||
| 'INSERT INTO dtb_mail_template (id, creator_id, name, file_name, mail_subject, deletable, create_date, update_date, discriminator_type) ' | ||
| ."VALUES (10, null, ?, 'Mail/refund_request_notify.twig', ?, false, '2017-03-07 10:14:52', '2017-03-07 10:14:52', 'mailtemplate')", | ||
| [$name, $subject] | ||
| ); | ||
| } | ||
|
|
||
| // dtb_csv(商品CSV出力項目 refund_allowed) | ||
| $csvExists = $this->connection->fetchOne( | ||
| 'SELECT COUNT(*) FROM dtb_csv WHERE id = 215' | ||
| ); | ||
| if ($csvExists == 0) { | ||
| $dispName = $lang === 'en' ? 'Refund Allowed Flag' : '返品許可フラグ'; | ||
| $this->addSql( | ||
| 'INSERT INTO dtb_csv (id, csv_type_id, creator_id, entity_name, field_name, reference_field_name, disp_name, sort_no, enabled, create_date, update_date, discriminator_type) ' | ||
| ."VALUES (215, 1, null, 'Eccube\\Entity\\Product', 'refund_allowed', null, ?, 33, false, '2017-03-07 10:14:00', '2017-03-07 10:14:00', 'csv')", | ||
| [$dispName] | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| public function down(Schema $schema): void | ||
| { | ||
| $this->addSql('DELETE FROM dtb_csv WHERE id = 215'); | ||
| $this->addSql('DELETE FROM dtb_mail_template WHERE id = 10'); | ||
| $this->addSql('DELETE FROM mtb_refund_request_status WHERE id IN (1, 2, 3, 4, 5)'); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
app/config/eccube/packages/refund_request_state_machine.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| <?php | ||
|
|
||
| /* | ||
| * This file is part of EC-CUBE | ||
| * | ||
| * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved. | ||
| * | ||
| * http://www.ec-cube.co.jp/ | ||
| * | ||
| * For the full copyright and license information, please view the LICENSE | ||
| * file that was distributed with this source code. | ||
| */ | ||
|
|
||
| use Eccube\Entity\Master\RefundRequestStatus as Status; | ||
| use Eccube\Service\RefundRequestStateMachineContext; | ||
|
|
||
| $container->loadFromExtension('framework', [ | ||
| 'workflows' => [ | ||
| 'refund_request' => [ | ||
| 'type' => 'state_machine', | ||
| 'marking_store' => [ | ||
| 'type' => 'method', | ||
| ], | ||
| 'supports' => [ | ||
| RefundRequestStateMachineContext::class, | ||
| ], | ||
| 'initial_marking' => (string) Status::NEW, | ||
| 'places' => [ | ||
| (string) Status::NEW, | ||
| (string) Status::PROCESSING, | ||
| (string) Status::ACCEPTED, | ||
| (string) Status::DECLINED, | ||
| (string) Status::INFO_REQUESTED, | ||
| ], | ||
| 'transitions' => [ | ||
| 'start_processing' => [ | ||
| 'from' => (string) Status::NEW, | ||
| 'to' => (string) Status::PROCESSING, | ||
| ], | ||
| 'accept' => [ | ||
| 'from' => (string) Status::PROCESSING, | ||
| 'to' => (string) Status::ACCEPTED, | ||
| ], | ||
| 'decline' => [ | ||
| 'from' => (string) Status::PROCESSING, | ||
| 'to' => (string) Status::DECLINED, | ||
| ], | ||
| 'request_info' => [ | ||
| 'from' => (string) Status::PROCESSING, | ||
| 'to' => (string) Status::INFO_REQUESTED, | ||
| ], | ||
| 'resume_processing' => [ | ||
| 'from' => (string) Status::INFO_REQUESTED, | ||
| 'to' => (string) Status::PROCESSING, | ||
| ], | ||
| ], | ||
| ], | ||
| ], | ||
| ]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.