From 9f27d82408a03adac200a12bbf20becdb7456659 Mon Sep 17 00:00:00 2001 From: KOSASIH Date: Sat, 3 Aug 2024 12:11:48 +0700 Subject: [PATCH] Create schemas.py --- .../payment_gateway/schemas.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 blockchain_integration/pi_network/pi_network_university/payment_gateway/schemas.py diff --git a/blockchain_integration/pi_network/pi_network_university/payment_gateway/schemas.py b/blockchain_integration/pi_network/pi_network_university/payment_gateway/schemas.py new file mode 100644 index 000000000..1cb2f99ad --- /dev/null +++ b/blockchain_integration/pi_network/pi_network_university/payment_gateway/schemas.py @@ -0,0 +1,20 @@ +# payment_gateway/schemas.py +from. import ma +from.models import User, PaymentMethod, Transaction + +class UserSchema(ma.SQLAlchemyAutoSchema): + class Meta: + model = User + load_instance = True + exclude = ("password",) + +class PaymentMethodSchema(ma.SQLAlchemyAutoSchema): + class Meta: + model = PaymentMethod + load_instance = True + exclude = ("payment_method_token",) + +class TransactionSchema(ma.SQLAlchemyAutoSchema): + class Meta: + model = Transaction + load_instance = True