feat: stripe integration
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
from database import Base
|
||||
from models.CustomBase import CustomBase
|
||||
from sqlalchemy import Column, Integer, String, ForeignKey
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
class PaymentLogs(Base, CustomBase):
|
||||
__tablename__ = "payment_logs"
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
customer_id = Column(String)
|
||||
account_id = Column(String)
|
||||
amount = Column(Integer)
|
||||
clinic_id = Column(Integer)
|
||||
unique_clinic_id = Column(String)
|
||||
payment_status = Column(String)
|
||||
metadata_logs = Column(String)
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
from database import Base
|
||||
from models.CustomBase import CustomBase
|
||||
from sqlalchemy import Column, Integer, String, ForeignKey
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
class StripeUsers(Base, CustomBase):
|
||||
__tablename__ = "stripe_users"
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
user_id = Column(Integer, ForeignKey('users.id'), nullable=False, unique=True)
|
||||
customer_id = Column(String)
|
||||
account_id = Column(String)
|
||||
|
||||
user = relationship("Users", back_populates="stripe_user")
|
||||
+4
-1
@@ -25,4 +25,7 @@ class Users(Base, CustomBase):
|
||||
|
||||
# Clinics created by this user
|
||||
created_clinics = relationship("Clinics", back_populates="creator")
|
||||
clinic_file_verifications = relationship("ClinicFileVerifications", back_populates="last_changed_by_user")
|
||||
clinic_file_verifications = relationship("ClinicFileVerifications", back_populates="last_changed_by_user")
|
||||
|
||||
# Stripe relationships
|
||||
stripe_user = relationship("StripeUsers", back_populates="user")
|
||||
+5
-1
@@ -16,6 +16,8 @@ from .ClinicFileVerifications import ClinicFileVerifications
|
||||
from .OTP import OTP
|
||||
from .ResetPasswordTokens import ResetPasswordTokens
|
||||
from .ClinicOffers import ClinicOffers
|
||||
from .StripeUsers import StripeUsers
|
||||
from .PaymentLogs import PaymentLogs
|
||||
|
||||
__all__ = [
|
||||
"Users",
|
||||
@@ -35,5 +37,7 @@ __all__ = [
|
||||
"ClinicFileVerifications",
|
||||
"OTP",
|
||||
"ResetPasswordTokens",
|
||||
"ClinicOffers"
|
||||
"ClinicOffers",
|
||||
"StripeUsers",
|
||||
"PaymentLogs"
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user