Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
PyFund
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈涛
PyFund
Commits
7b495921
Commit
7b495921
authored
Mar 27, 2023
by
confusion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
staking bill 添加 status
parent
242b1cf0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
10 deletions
+18
-10
bill.py
model/bill.py
+2
-1
bill.py
schema/bill.py
+16
-9
No files found.
model/bill.py
View file @
7b495921
...
...
@@ -2,7 +2,7 @@ import datetime
from
pydantic
import
Field
from
model
import
MyBaseModel
from
schema.bill
import
PCFBillType
,
BillType
from
schema.bill
import
PCFBillType
,
BillType
,
StakingBillStatus
# 数据库类型 / 接口返回类型
...
...
@@ -36,6 +36,7 @@ class StakingBill(MyBaseModel):
user_id
:
str
bill_type
:
BillType
=
BillType
.
staking
status
:
StakingBillStatus
=
Field
(
...
,
description
=
'转账状态'
)
fund_id
:
str
=
Field
(
...
,
description
=
'基金id'
)
currency
:
str
=
Field
(
default
=
"ETH"
,
description
=
'币种'
)
volume
:
float
=
Field
(
default
=
32
,
description
=
'数量'
)
...
...
schema/bill.py
View file @
7b495921
...
...
@@ -38,6 +38,11 @@ class AllBillType(str, Enum):
return
list
(
map
(
lambda
c
:
c
.
value
,
BillType
))
class
StakingBillStatus
(
str
,
Enum
):
pending
=
"pending"
finish
=
'finish'
# 创建申购赎回记录
class
CreatePCFBill
(
BaseModel
):
fund_id
:
str
=
Field
(
...
,
description
=
'基金id'
)
...
...
@@ -63,6 +68,7 @@ class CreateExchangeBill(BaseModel):
class
CreateStakingBill
(
BaseModel
):
status
:
StakingBillStatus
=
Field
(
StakingBillStatus
.
pending
,
description
=
'转账状态'
)
fund_id
:
str
=
Field
(
...
,
description
=
'基金id'
)
currency
:
str
=
Field
(
default
=
"ETH"
,
description
=
'币种'
)
volume
:
float
=
Field
(
default
=
32
,
description
=
'数量'
)
...
...
@@ -87,8 +93,8 @@ class UpdatePCFBill(BaseModel):
price
:
Optional
[
float
]
=
Field
(
None
,
description
=
"价格"
)
fund_share
:
Optional
[
float
]
=
Field
(
None
,
description
=
"基金份额"
)
market_value
:
Optional
[
float
]
=
Field
(
None
,
description
=
"市值"
)
record_time
:
str
=
Field
(
default_factory
=
lambda
:
str
(
datetime
.
datetime
.
utcnow
()
.
date
()),
description
=
'记录时间'
)
remark
:
str
=
Field
(
default
=
""
,
description
=
"备注"
)
record_time
:
Optional
[
str
]
=
Field
(
default_factory
=
lambda
:
str
(
datetime
.
datetime
.
utcnow
()
.
date
()),
description
=
'记录时间'
)
remark
:
Optional
[
str
]
=
Field
(
default
=
""
,
description
=
"备注"
)
class
Config
:
orm_mode
=
True
...
...
@@ -101,19 +107,20 @@ class UpdateExchangeBill(BaseModel):
output_currency
:
Optional
[
str
]
=
Field
(
None
,
description
=
"输出币种"
)
output_price
:
Optional
[
float
]
=
Field
(
None
,
description
=
"输出币种价格"
)
output_volume
:
Optional
[
float
]
=
Field
(
None
,
description
=
"输出数量"
)
record_time
:
str
=
Field
(
default_factory
=
lambda
:
str
(
datetime
.
datetime
.
utcnow
()
.
date
()),
description
=
'记录时间'
)
remark
:
str
=
Field
(
default
=
""
,
description
=
"备注"
)
record_time
:
Optional
[
str
]
=
Field
(
default_factory
=
lambda
:
str
(
datetime
.
datetime
.
utcnow
()
.
date
()),
description
=
'记录时间'
)
remark
:
Optional
[
str
]
=
Field
(
default
=
""
,
description
=
"备注"
)
class
Config
:
orm_mode
=
True
class
UpdateStakingBill
(
BaseModel
):
status
:
Optional
[
StakingBillStatus
]
=
Field
(
None
,
description
=
'转账状态'
)
currency
:
Optional
[
str
]
=
Field
(
None
,
description
=
'币种'
)
volume
:
Optional
[
float
]
=
Field
(
None
,
description
=
'数量'
)
price
:
float
=
Field
(
None
,
description
=
"价格"
)
record_time
:
str
=
Field
(
default_factory
=
lambda
:
str
(
datetime
.
datetime
.
utcnow
()
.
date
()),
description
=
'记录时间'
)
remark
:
str
=
Field
(
default
=
""
,
description
=
"备注"
)
price
:
Optional
[
float
]
=
Field
(
None
,
description
=
"价格"
)
record_time
:
Optional
[
str
]
=
Field
(
default_factory
=
lambda
:
str
(
datetime
.
datetime
.
utcnow
()
.
date
()),
description
=
'记录时间'
)
remark
:
Optional
[
str
]
=
Field
(
default
=
""
,
description
=
"备注"
)
class
Config
:
orm_mode
=
True
...
...
@@ -123,8 +130,8 @@ class UpdateAdjustBill(BaseModel):
currency
:
Optional
[
str
]
=
Field
(
None
,
description
=
'币种'
)
volume
:
Optional
[
float
]
=
Field
(
None
,
description
=
'资产数量'
)
price
:
Optional
[
float
]
=
Field
(
None
,
description
=
"价格"
)
record_time
:
str
=
Field
(
default_factory
=
lambda
:
str
(
datetime
.
datetime
.
utcnow
()
.
date
()),
description
=
'记录时间'
)
remark
:
str
=
Field
(
default
=
""
,
description
=
"备注"
)
record_time
:
Optional
[
str
]
=
Field
(
default_factory
=
lambda
:
str
(
datetime
.
datetime
.
utcnow
()
.
date
()),
description
=
'记录时间'
)
remark
:
Optional
[
str
]
=
Field
(
default
=
""
,
description
=
"备注"
)
class
Config
:
orm_mode
=
True
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment