Commit a13bb987 authored by 陈涛's avatar 陈涛

净值记录增加fund_share字段

parent d32b2b97
......@@ -48,6 +48,7 @@ class StakingFund(BaseFundItem):
class StakingFundNav(StakingFund):
fund_id: str = Field(..., description="基金id")
fund_share: float = Field(None, description="基金份额")
record_date: datetime.datetime = Field(
default_factory=lambda: datetime.datetime.utcnow().replace(hour=0, minute=0, second=0, microsecond=0, tzinfo=pytz.UTC),
description="记录时间"
......
......@@ -97,6 +97,7 @@ async def calculate_nav(fund_id, calc_time: datetime.datetime = None, beach_serv
else:
fund_nav[key] = value
fund_nav["record_date"] = date
fund_nav["fund_share"] = total_fund_share
fund_nav["nav"] = net_value
insert = await nav_collect.insert_one(fund_nav)
if not insert.acknowledged:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment