<feed xmlns='http://www.w3.org/2005/Atom'>
<title>fund-lab.git/tests/FundLab.Api.Tests/SipAdvanceTests.fs, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<id>http://git.somhairle.bid/fund-lab.git/atom?h=main</id>
<link rel='self' href='http://git.somhairle.bid/fund-lab.git/atom?h=main'/>
<link rel='alternate' type='text/html' href='http://git.somhairle.bid/fund-lab.git/'/>
<updated>2026-09-21T04:38:56+00:00</updated>
<entry>
<title>Drive SIP plans through the shared order pipeline (3d-6)</title>
<updated>2026-09-21T04:38:56+00:00</updated>
<author>
<name>Somhairle H. Marisol</name>
<email>muqiu-han@outlook.com</email>
</author>
<published>2026-09-21T04:38:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.somhairle.bid/fund-lab.git/commit/?id=d2a547b6a60ea769092894fff1f2b5105954f226'/>
<id>urn:sha1:d2a547b6a60ea769092894fff1f2b5105954f226</id>
<content type='text'>
Advance executes due periods as real subscription orders: each due
trade date claims a sip_executions row (PRIMARY KEY plan_id+trade_date
makes same-plan same-day runs atomic), places the order through
CreateSubscriptionOrder with a deterministic idempotency key
(sip:{plan}:{date}) and the period's trade date, then confirms through
the shared ConfirmSubscriptionOrder pipeline with key
sip-confirm:{plan}:{date} — identical freeze/fee/units math as manual
orders, nothing bypasses confirmation. Outcomes: succeeded,
pending_nav (cash stays frozen; later drives retry the confirmation
once the NAV lands), insufficient_cash (no order placed, period fails
visibly, reruns keep the marker), failed. Plans roll their
next_trade_date past the processed window and repeats of the same
endDate replay recorded executions instead of re-debiting.

Domain adds SipPolicy.advancePlan (due-date enumeration; weekends-only
trading-calendar approximation, noted in code). POST
/funds/{id}/sip/advance {endDate?, limit?} drives execution on demand
(no daemon). Plan responses/rows now carry last execution status/date;
front-end shows 已执行/待净值/现金不足 per plan. Optional
tradeDateOverride/anchorOverride keep manual flows untouched.
</content>
</entry>
</feed>
