crud_payment.py 602 B

1234567891011121314151617
  1. from audioop import add
  2. from typing import Any, Dict, Optional, Union
  3. from sqlalchemy.orm import Session
  4. from app.core.security import get_password_hash, verify_password
  5. from app.crud.base import CRUDBase
  6. from app.models.payment import Payment
  7. from app.schemas.payment import PaymentBase, PaymentCreate, PaymentUpdate
  8. class CRUDPayment(CRUDBase[Payment, PaymentBase, PaymentCreate]):
  9. def get_by_transaction(self, db: Session, *, transaction_id: str) -> Optional[Payment]:
  10. return db.query(Payment).filter(Payment.transaction_id == transaction_id).first()
  11. payment = CRUDPayment(Payment)