(20260623) Migrate to new server.

This commit is contained in:
2026-06-23 17:06:44 +05:30
parent 7a73bee6d3
commit 122be77d19
3 changed files with 56 additions and 3 deletions
@@ -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(),
+50 -1
View File
@@ -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)
+4 -2
View File
@@ -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: