Skip to content

phase2-02: refactor to oop - user and account classes #26

@anibalrojosan

Description

@anibalrojosan

Branch: feat/oop-core-entities
Type: backend
Priority: High
Dependencies: phase2-01

Description

Transform procedural logic into Object-Oriented classes for User and Account to encapsulate state and behavior.

Tasks

  • Create backend/modules/entities.py
  • Implement User class with properties: username, email, hashed_password
  • Implement Account class with methods: get_balance(), add_funds(), remove_funds()
  • Move authentication logic into a SessionManager or AuthService class
  • Ensure classes use Pydantic models for internal data integrity

Acceptance Criteria

  • Logic is encapsulated within class methods
  • No direct manipulation of user dictionaries outside of classes
  • Code passes Ruff validation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions