Skip to content

Commit

Permalink
Merge pull request #316 from Jagadeeshftw/feat/add-new-models-for-nos…
Browse files Browse the repository at this point in the history
…tra-events

feat(models): add DebtMintEventModel and DebtBurnEventModel
  • Loading branch information
djeck1432 authored Nov 25, 2024
2 parents 755a83c + 2699e6f commit cab73b9
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions apps/data_handler/db/models/nostra_events.py
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)

0 comments on commit cab73b9

Please sign in to comment.