Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Jeremy Moore <jeremymoore@gmail.com>
  • Loading branch information
micahflee and jeremywmoore authored Sep 27, 2024
1 parent 5bd85ce commit 9737a42
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions hushline/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,13 +350,11 @@ class Tier(Model):
id: Mapped[int] = mapped_column(primary_key=True)
name: Mapped[str] = mapped_column(db.String(255), unique=True)
monthly_amount: Mapped[int] = mapped_column(db.Integer) # in cents USD
stripe_product_id = mapped_column(db.String(255), unique=True)
stripe_price_id = mapped_column(db.String(255), unique=True)
stripe_product_id: Mapped[Optional[str]] = mapped_column(db.String(255), unique=True)
stripe_price_id: Mapped[Optional[str]] = mapped_column(db.String(255), unique=True)

def __init__(self, name: str, monthly_amount: int) -> None:
super().__init__()
self.name = name
self.monthly_amount = monthly_amount
super().__init__(name=name, monthly_amount=monthly_amount)


class StripeEvent(Model):
Expand Down Expand Up @@ -387,8 +385,8 @@ class StripeInvoice(Model):
invoice_id: Mapped[str] = mapped_column(db.String(255), unique=True, index=True)
hosted_invoice_url: Mapped[str] = mapped_column(db.String(255))
total: Mapped[int] = mapped_column(db.Integer)
status: Mapped[StripeInvoiceStatusEnum] = mapped_column(
SQLAlchemyEnum(StripeInvoiceStatusEnum), nullable=True
status: Mapped[Optional[StripeInvoiceStatusEnum]] = mapped_column(
SQLAlchemyEnum(StripeInvoiceStatusEnum)
)
created_at: Mapped[datetime] = mapped_column(default=datetime.now)

Expand Down

0 comments on commit 9737a42

Please sign in to comment.