benefitsharing.py 701 B

12345678910111213141516
  1. import datetime
  2. import uuid
  3. from sqlalchemy import Column, String
  4. from sqlalchemy.orm import relation
  5. from sqlalchemy.sql.schema import ForeignKey
  6. from sqlalchemy.sql.sqltypes import Boolean, DateTime, Float
  7. from app.db.base_class import Base
  8. class BenefitSharing(Base):
  9. id = Column(String(36), primary_key=True, nullable=False, default=uuid.uuid4())
  10. created_at = Column(DateTime, default=datetime.datetime.now(), nullable=False)
  11. updated_at = Column(DateTime, default=datetime.datetime.now(), nullable=False)
  12. bank_id = Column(String(36), ForeignKey("bank.id"), nullable=False)
  13. amount = Column(Float(), nullable=False)
  14. is_paid = Column(Boolean, default=False, nullable=False)