feat: 前端分離+功能api化

1. 新增資產管理CRUD、googleOAuth登入
2. 更改原記帳controller
This commit is contained in:
2026-06-25 14:19:07 +08:00
parent 7bb931c97b
commit 85972f950c
70 changed files with 4754 additions and 1520 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::create('securities', function (Blueprint $table) {
$table->id();
$table->string('code', 20);
$table->enum('type', ['stock', 'etf', 'fund']);
$table->string('source', 20); // twse, tpex, cnyes
$table->string('name'); // 中文名稱/簡稱
$table->decimal('latest_price', 15, 4)->nullable(); // 最新報價/淨值
$table->timestamp('latest_price_at')->nullable(); // 最新報價/淨值時間
$table->decimal('change_amount', 15, 4)->nullable(); // 漲跌
$table->decimal('change_rate', 8, 4)->nullable(); // 漲跌幅(%)
$table->jsonb('meta')->nullable(); // 基金專屬額外資訊(category、riskLevel、isinCode...)
$table->timestamps();
$table->unique(['code', 'type']);
});
}
public function down(): void
{
Schema::dropIfExists('securities');
}
};