import app.api.payment.schemas as schemas
from sqlalchemy.orm import Session
from app.dependency.authantication import JWTPayloadSchema
from app.locale.messages import Messages
from app.models.main.payment import PaymentBase, TblPayment
from app.utils.schemas_utils import CustomResponse 

class PaymentService:
    def __init__(self, db: Session,token:JWTPayloadSchema):
        self.db = db 
        self.token = token

    async def create_payment(self, request: schemas.PaymentCreat):
        created_user = PaymentBase.model_validate(request) 
        TblPayment.create(created_user, self.db)
        self.db.commit()  
        return CustomResponse(status="1", message=Messages.PAYMENT_CREAT) 

    