-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #316 from Jagadeeshftw/feat/add-new-models-for-nos…
…tra-events feat(models): add DebtMintEventModel and DebtBurnEventModel
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from decimal import Decimal | ||
from data_handler.db.models.event import EventBaseModel | ||
from sqlalchemy import Numeric, String | ||
from sqlalchemy.orm import Mapped, mapped_column | ||
|
||
|
||
class DebtMintEventModel(EventBaseModel): | ||
""" | ||
Database model for DebtMint event, inheriting from EventBaseModel. | ||
This model stores the user address and the amount minted. | ||
""" | ||
|
||
__tablename__ = "debt_mint_event" | ||
|
||
user: Mapped[str] = mapped_column(String, nullable=False) | ||
amount: Mapped[Decimal] = mapped_column(Numeric(38, 18), nullable=False) | ||
|
||
|
||
class DebtBurnEventModel(EventBaseModel): | ||
""" | ||
Database model for DebtBurn event, inheriting from EventBaseModel. | ||
This model stores the user address and the amount burned. | ||
""" | ||
|
||
__tablename__ = "debt_burn_event" | ||
|
||
user: Mapped[str] = mapped_column(String, nullable=False) | ||
amount: Mapped[Decimal] = mapped_column(Numeric(38, 18), nullable=False) |