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

33
app/Models/Security.php Normal file
View File

@@ -0,0 +1,33 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Security extends Model
{
protected $fillable = [
'code',
'type',
'source',
'name',
'latest_price',
'latest_price_at',
'change_amount',
'change_rate',
'meta',
];
protected $casts = [
'latest_price_at' => 'datetime',
'latest_price' => 'decimal:4',
'change_amount' => 'decimal:4',
'change_rate' => 'decimal:4',
'meta' => 'array',
];
public function historicPrices()
{
return $this->hasMany(SecurityPriceHistories::class, 'security_id', 'id');
}
}