(20241228) Payments module revamped!

This commit is contained in:
2024-12-28 16:34:57 +05:30
parent 7ddae1707f
commit 5c17eb28ae
18 changed files with 1477 additions and 156 deletions
+25 -1
View File
@@ -230,7 +230,31 @@ class PGPaymentRequestData(BaseModel):
class PaymentRequestOneResult(BaseModel):
success: bool = Field(
description = "whether, or not, the sms was successfully sent",
description = "whether, or not, the payment was successfully requested",
default = False
)
message: str | None = Field(
description = "a brief message to summarize the result of the process",
default = None
)
# ┏┓ ┏•
# ┃ ┏┓┏┓╋┓┏┓
# ┗┛┗┛┛┗┛┗┗┫
# ┛
class Config:
extra = "forbid"
# ---------------------------------------------------------------------------------------------------------------------
class PaymentCallbackResult(BaseModel):
success: bool = Field(
description = "whether, or not, the payment event was noted",
default = False
)
+2 -1
View File
@@ -216,7 +216,8 @@ class CorePaymentModel(BaseModel):
description = "the id of the document in mongodb that holds this information",
frozen = True,
default = None,
alias = "_id"
alias = "_id",
exclude = True
)
user: CoreUserInfoModel = Field(
+6
View File
@@ -155,6 +155,10 @@ class TradingTick(BaseModel):
description = "the symbol of the instrument"
)
name: str = Field(
description = "the name of the co./underlying"
)
exchange: Literal["NSE", "NFO", "BSE", "BFO", "MCX", "CDS", "BCD"] = Field(
description = "the exchange on which this instrument is traded",
frozen = True
@@ -357,6 +361,7 @@ class TradingTick(BaseModel):
"segment": self.segment,
"type": self.type,
"symbol": self.symbol,
"name": self.name,
"expiry": date_time.to_timezone(
self.expiryTs,
timezone = self.expiryTz
@@ -398,6 +403,7 @@ class TradingTick(BaseModel):
modelled_ticks.append(
TradingTick(
symbol = tick_lookup["symbol"],
name = tick_lookup["name"],
exchange = tick_lookup["exchange"],
exchangeToken = tick_lookup["exchangeToken"],
broker = "zerodhaKite",