diff options
| author | Somhairle H. Marisol <[email protected]> | 2026-09-21 00:06:45 +0800 |
|---|---|---|
| committer | Somhairle H. Marisol <[email protected]> | 2026-09-21 00:06:45 +0800 |
| commit | 2ada70d6467aec11b45328112d598454ca50f2d6 (patch) | |
| tree | 5deab7d12095dfd0599c109edc2200a38258040e /src/FundLab.Api/FundLab.Api.fsproj | |
| parent | c60905e9e7f992a7f8c79c3812e92a44b2d606f5 (diff) | |
| download | fund-lab-2ada70d6467aec11b45328112d598454ca50f2d6.tar.gz | |
feat(api): 接入基金 PostgreSQL 持久化与幂等接口
[变更性质]
- 本提交新增基金创建与读取的 PostgreSQL 持久化能力,并完成 3a API 收口验证。
[新增功能]
- 提供带事务和幂等键的基金创建、重放、冲突检测及基金读取接口。
- 覆盖认证、JSON 输入、数值边界、进程重启持久化和 SQL 故障回滚测试。
[实现方案]
- 使用 Npgsql 建立 `funds` 与 `fund_idempotencies` 表,并以 advisory lock 串行化同一幂等键。
- 通过真实 Kestrel 子进程和临时 PostgreSQL 验证 HTTP 行为;同步更新环境、构建和交接文档。
[影响范围]
- API 新增 PostgreSQL 配置要求 `FUND_LAB_DATABASE_URL`,前端构建入口和本地验证命令同步明确。
- 本提交不包含 `docs/overnight-progress.md` 的现有 Hermes 修改。
Diffstat (limited to 'src/FundLab.Api/FundLab.Api.fsproj')
| -rw-r--r-- | src/FundLab.Api/FundLab.Api.fsproj | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/FundLab.Api/FundLab.Api.fsproj b/src/FundLab.Api/FundLab.Api.fsproj index 81952df..8a3f590 100644 --- a/src/FundLab.Api/FundLab.Api.fsproj +++ b/src/FundLab.Api/FundLab.Api.fsproj @@ -7,6 +7,7 @@ </PropertyGroup> <ItemGroup> <PackageReference Include="Giraffe" Version="6.0.0" /> + <PackageReference Include="Npgsql" Version="8.0.8" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\FundLab.Domain\FundLab.Domain.fsproj" /> @@ -14,6 +15,7 @@ <ItemGroup> <Compile Include="Authentication.fs" /> <Compile Include="Health.fs" /> + <Compile Include="Persistence.fs" /> <Compile Include="App.fs" /> <Compile Include="Program.fs" /> </ItemGroup> |
