Skip to content
Open
Show file tree
Hide file tree
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 Jun 15, 2026
605aaf1
feat: 返品申請のイベントを追加(EccubeEvents 定数 / RefundRequestEvent) (#6820)
ttokoro20240902 Jun 15, 2026
3df39df
feat: 返品申請のステートマシンとサービスを追加 (#6820)
ttokoro20240902 Jun 15, 2026
e3125cc
feat: 返品申請のフォームタイプを追加(Front/Admin) (#6820)
ttokoro20240902 Jun 15, 2026
86ff9e7
feat: 返品申請のController・テンプレート・ナビ・翻訳を追加 (#6820)
ttokoro20240902 Jun 15, 2026
2451340
fix: 返品申請管理テンプレートのCSRFトークン処理を修正
ttokoro20240902 Jun 15, 2026
c3b14fa
feat: 返品申請のCSVエクスポート機能を追加 (#6820)
ttokoro20240902 Jun 15, 2026
6192079
test: 返品申請のPHPUnitテストを追加 (#6820)
ttokoro20240902 Jun 15, 2026
a2e8df9
test: 返品申請のE2Eテスト(Playwright)を追加 (#6820)
ttokoro20240902 Jun 15, 2026
8d9bc8e
test: 返品申請テストにファイル操作・CSV・セキュリティ検証を追加 (#6820)
ttokoro20240902 Jun 16, 2026
ab18371
fix: PHPStan・Rector指摘を修正(#6820)
ttokoro20240902 Jun 16, 2026
9d4e99e
fix: Rector残指摘とCodeRabbitレビュー指摘を修正 (#6820)
ttokoro20240902 Jun 16, 2026
c7c7ffd
fix: 返品申請の確認画面でエビデンスファイルが消える問題を修正 (#6820)
ttokoro20240902 Jun 16, 2026
c8fffcd
style: 返品申請の完了・履歴画面のレイアウトを中央寄せに修正 (#6820)
ttokoro20240902 Jun 16, 2026
bf3681a
style: 返品申請管理(管理画面)の検索結果ゼロ件メッセージを中央寄せに修正 (#6820)
ttokoro20240902 Jun 16, 2026
9905bb0
fix: 返品申請管理の一覧で初期表示時に常にゼロ件になる問題を修正 (#6820)
ttokoro20240902 Jun 16, 2026
1429c79
feat: 返品申請管理一覧に件数セレクタとページャを追加 (#6820)
ttokoro20240902 Jun 16, 2026
3084639
style: 返品申請管理一覧のレイアウトを受注管理一覧に合わせる (#6820)
ttokoro20240902 Jun 16, 2026
b8e580e
style: 返品申請管理一覧の結果領域・空表示領域に左右余白を追加 (#6820)
ttokoro20240902 Jun 16, 2026
f6328e3
style: 返品申請詳細画面の戻るボタン・保存ボタンを画面幅に合わせて配置 (#6820)
ttokoro20240902 Jun 16, 2026
fb62608
fix: CodeRabbit 残指摘と Rector 指摘を修正 (#6820)
ttokoro20240902 Jun 16, 2026
1ee17e1
fix: 返品申請ステータスCSVを definition.yml に登録 (#6820)
ttokoro20240902 Jun 16, 2026
34f86e1
fix: 返品申請詳細 E2E の card-body strict-mode violation を修正 (#6820)
ttokoro20240902 Jun 16, 2026
53e1f26
fix: 返品申請のレビュー指摘対応(履歴ボタン条件表示・遷移ガード・配信ヘッダ)
ttokoro20240902 Jun 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ jobs:
- admin-contents
- admin-basicinfo
- admin-system
- admin-refund-request
- front-top
- front-product
- front-customer
- front-other
- front-order
- front-mypage
- front-refund-request
- front-invoice
include:
- db: pgsql
Expand Down
94 changes: 94 additions & 0 deletions app/DoctrineMigrations/Version20260615000000.php
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)');
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
}
3 changes: 3 additions & 0 deletions app/config/eccube/packages/eccube.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ parameters:
eccube_twig_block_templates: []
eccube_save_image_dir: '%kernel.project_dir%/html/upload/save_image'
eccube_temp_image_dir: '%kernel.project_dir%/html/upload/temp_image'
# 返品申請のエビデンスファイル保存先。公開ドキュメントルート外(var/配下)に置き、配信はコントローラ経由(所有者チェック付き)に限定する
eccube_save_refund_request_file_dir: '%kernel.project_dir%/var/refund_request'
eccube_csv_size: 5 # post_max_size, upload_max_filesize に任せればよい?
eccube_csv_temp_realdir: '%kernel.cache_dir%/%kernel.environment%/eccube' # upload_tmp_dir に任せればよい?
eccube_csv_split_lines: 100
Expand Down Expand Up @@ -126,6 +128,7 @@ parameters:
eccube_forgot_mail_template_id: 6 #パスワードリセット
eccube_reset_complete_mail_template_id: 7 #パスワードリマインダー
eccube_shipping_notify_mail_template_id: 8 #出荷通知メール
eccube_refund_request_notify_mail_template_id: 10 #返品申請通知メール(管理者向け)
# メールアドレスをRFC準拠でチェックするか true: チェックする、false: チェックしない
eccube_rfc_email_check: false
eccube_email_len: 254
Expand Down
3 changes: 3 additions & 0 deletions app/config/eccube/packages/eccube_nav.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ parameters:
shipping_csv_import:
name: admin.order.shipping_csv_upload
url: admin_shipping_csv_import
refund_request:
name: admin.order.refund_request.list_title
url: admin_refund_request
customer:
name: admin.customer.customer_management
icon: fa-users
Expand Down
59 changes: 59 additions & 0 deletions app/config/eccube/packages/refund_request_state_machine.php
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,
],
],
],
],
]);
24 changes: 24 additions & 0 deletions e2e/setup-fixtures.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,29 @@
echo " Multi-cart test product already exists\n";
}

// --- 返品申請テスト用(発送済み注文を持つテスト会員) ---
$refundTestEmail = 'refund-test@test.test';
$existingRefundCustomer = $entityManager->getRepository(Customer::class)->findOneBy(['email' => $refundTestEmail]);
if (!$existingRefundCustomer) {
$refundCustomer = $generator->createCustomer($refundTestEmail);
$Status = $entityManager->getRepository(CustomerStatus::class)->find(CustomerStatus::ACTIVE);
$refundCustomer->setStatus($Status);
$entityManager->flush($refundCustomer);

$Delivery = $entityManager->getRepository(\Eccube\Entity\Delivery::class)->findAll()[0];
$Product = $entityManager->getRepository(\Eccube\Entity\Product::class)->find(2);
$Order = $generator->createOrder($refundCustomer, $Product->getProductClasses()->toArray(), $Delivery);
$DeliveredStatus = $entityManager->getRepository(OrderStatus::class)->find(OrderStatus::DELIVERED);
$Order->setOrderStatus($DeliveredStatus);
$Order->setOrderDate(new \DateTime());
foreach ($Order->getShippings() as $Shipping) {
$Shipping->setShippingDate(new \DateTime());
}
$entityManager->flush();
echo " Created refund test customer with delivered order: $refundTestEmail\n";
} else {
echo " Refund test customer already exists: $refundTestEmail\n";
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

echo "Fixtures setup complete.\n";
$kernel->shutdown();
Loading
Loading