(20260623) Migrate to new server.
This commit is contained in:
@@ -189,6 +189,8 @@ async def request_oauth_authorization_url(
|
||||
"username": inbound_data.auth.username,
|
||||
"perTrade": inbound_data.get("perTrade", 0),
|
||||
"perCrore": inbound_data.get("perCrore", 0),
|
||||
"perCroreEq": inbound_data.get("perCroreEq", 0),
|
||||
"perCroreFut": inbound_data.get("perCroreFut", 0),
|
||||
"perLot": inbound_data.get("perLot", 0)
|
||||
},
|
||||
auth = inbound_data.auth.model_dump(),
|
||||
|
||||
@@ -86,6 +86,36 @@ class PaperTradingAuth(BaseModel):
|
||||
frozen = True
|
||||
)
|
||||
|
||||
perTrade: int | float = Field(
|
||||
description = "??",
|
||||
default = 0,
|
||||
frozen = True
|
||||
)
|
||||
|
||||
perLot: int | float = Field(
|
||||
description = "??",
|
||||
default = 0,
|
||||
frozen = True
|
||||
)
|
||||
|
||||
perCrore: int | float = Field(
|
||||
description = "??",
|
||||
default = 0,
|
||||
frozen = True
|
||||
)
|
||||
|
||||
perCroreEq: int | float = Field(
|
||||
description = "??",
|
||||
default = 0,
|
||||
frozen = True
|
||||
)
|
||||
|
||||
perCroreFut: int | float = Field(
|
||||
description = "??",
|
||||
default = 0,
|
||||
frozen = True
|
||||
)
|
||||
|
||||
# ┏┓ ┏•
|
||||
# ┃ ┏┓┏┓╋┓┏┓
|
||||
# ┗┛┗┛┛┗┛┗┗┫
|
||||
@@ -94,6 +124,17 @@ class PaperTradingAuth(BaseModel):
|
||||
class Config:
|
||||
extra = "forbid"
|
||||
|
||||
# ┏┓ ┏┓
|
||||
# ┃ ┓┏┏╋┏┓┏┳┓ ┣ ┓┏┏┓┏┏
|
||||
# ┗┛┗┻┛┗┗┛┛┗┗ ┻ ┗┻┛┗┗┛
|
||||
|
||||
@field_validator("perTrade", "perLot", "perCrore", "perCroreEq", "perCroreFut", mode = "before")
|
||||
@classmethod
|
||||
def ensure_number(cls, value):
|
||||
if value is None: value = 0
|
||||
if isinstance(value, str): value = float(value)
|
||||
return value
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -222,4 +263,12 @@ class TradingOAuthCallbackResponse(BaseModel):
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
pass
|
||||
my_obj = PaperTradingAuth(
|
||||
username = "Yatmesh",
|
||||
password = "yatmesh123",
|
||||
perTrade = 10.25,
|
||||
perCrore = "100.12345",
|
||||
perCroreEq = "0.12345",
|
||||
perLot = None
|
||||
)
|
||||
print(my_obj)
|
||||
|
||||
@@ -163,7 +163,8 @@ class AsyncMongoBase:
|
||||
self._host_name,
|
||||
self._port,
|
||||
maxPoolSize = self._max_connections,
|
||||
minPoolSize = self._max_connections
|
||||
minPoolSize = self._max_connections,
|
||||
# w = 1,
|
||||
)
|
||||
|
||||
# In the absense of a connection string,
|
||||
@@ -172,7 +173,8 @@ class AsyncMongoBase:
|
||||
self._client = AsyncIOMotorClient(
|
||||
self._connection_string,
|
||||
maxPoolSize = self._max_connections,
|
||||
minPoolSize = self._max_connections
|
||||
minPoolSize = self._max_connections,
|
||||
# w = 1,
|
||||
)
|
||||
|
||||
# Debugging print:
|
||||
|
||||
Reference in New Issue
Block a user