[FEAT] 實作公共事業費逾期提醒、租戶自訂通知設定及發送測試信功能
All checks were successful
ERP-Deploy-Demo / deploy-demo (push) Successful in 56s

This commit is contained in:
2026-03-05 16:01:00 +08:00
parent 016366407c
commit 07b7d9b327
15 changed files with 519 additions and 44 deletions

View File

@@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('utility_fees', function (Blueprint $table) {
// 1. 將費用日期改為可為空 (繳費日期)
$table->date('transaction_date')->nullable()->change();
// 2. 新增繳費期限
$table->date('due_date')->nullable()->after('transaction_date')->comment('繳費期限');
// 3. 新增繳費狀態
$table->enum('payment_status', ['pending', 'paid', 'overdue'])
->default('pending')
->after('amount')
->comment('繳費狀態');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('utility_fees', function (Blueprint $table) {
$table->date('transaction_date')->nullable(false)->change();
$table->dropColumn(['due_date', 'payment_status']);
});
}
};

View File

@@ -56,6 +56,28 @@ class SystemSettingSeeder extends Seeder
'type' => 'integer',
'description' => '每頁預設筆數',
],
// 📧 通知設定
[
'group' => 'notification',
'key' => 'notification.utility_fee_sender_email',
'value' => 'sky121113@gmail.com',
'type' => 'string',
'description' => '發送公共事業通知的 Gmail 帳號',
],
[
'group' => 'notification',
'key' => 'notification.utility_fee_sender_password',
'value' => 'qjxcedzcrjoyioxu',
'type' => 'string',
'description' => '發送公共事業通知的 Gmail 應用程式密碼',
],
[
'group' => 'notification',
'key' => 'notification.utility_fee_recipient_emails',
'value' => 'sky121113@gmail.com',
'type' => 'string',
'description' => '接收通知的 Email 清單 (多筆請用逗號分隔)',
],
];
foreach ($settings as $setting) {