Skip to content

Commit

Permalink
Update __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Oct 18, 2024
1 parent 8d757cf commit 224a229
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions FineX/api/v1/schemas/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,34 @@
# __init__.py

from marshmallow import Schema, fields

# Base schema for common fields
class BaseSchema(Schema):
id = fields.Int(required=True)
created_at = fields.DateTime(required=True)
updated_at = fields.DateTime(required=True)

# User schema for user-related data
class UserSchema(BaseSchema):
username = fields.Str(required=True)
email = fields.Email(required=True)
password = fields.Str(required=True)

# Transaction schema for transaction-related data
class TransactionSchema(BaseSchema):
sender = fields.Str(required=True)
recipient = fields.Str(required=True)
amount = fields.Float(required=True)

# Additional schemas can be defined here
class AccountSchema(BaseSchema):
account_number = fields.Str(required=True)
balance = fields.Float(required=True)

# Exporting schemas for easy access
__all__ = ['User Schema', 'TransactionSchema', 'AccountSchema']

# Optional: Function to initialize schemas if needed
def init_schemas(app):
"""Initialize schemas if any app-specific configuration is needed."""
pass

0 comments on commit 224a229

Please sign in to comment.