How signapay/processor-interview works
Project’s Purpose and Nature
• This project is a transaction processing tool aimed at ingesting, processing, and reporting on transaction CSV files.
• It is not a full-blown full-stack web application, but it does include a minimal UI component (for file upload and system reset) along with a dedicated processing and reporting logic.
• The project emphasizes a clear separation between input handling, business logic (processing transactions), persistence (in-memory state during runtime), and reporting layers.
Main Components
a. User Interface (UI):
• Responsible for accepting CSV files (both the “test.csv” and “data.csv”) and providing the option to reset the state.
• This could be a simple web-based UI or a command-line interface.
b. File Processor / Ingestion Module:
• Reads and parses the CSV files.
• Handles parsing errors and routes “bad transactions” for later review.
• Acts as the entry point for transaction data into the system.
c. Transaction Processing Module (Logic Layer):
• Applies business rules to each transaction (e.g., handling credits, debits, transfers).
• Updates accounts and card balances.
• Ensures numerical accuracy (important since it deals with money) and processes validation.
d. Persistence / Data Store:
• An in-memory (or optionally persistent) storage layer that maintains state for accounts, transactions, and reporting data.
• Although there is no explicit database, design this component so it can be easily replaced or enhanced in the future.
e. Reporting Module:
• Generates reports including:
• Chart of accounts (listing account name, cards, and amounts on each card)
• Of accounts/cards that need collections (balancing below zero)
• A collection of “bad transactions” that could not be parsed.
Relationships and Data Flow
• The UI initiates file uploads and commands (e.g., reset) to the File Processor.
• The File Processor reads CSV content and forwards the parsed transactions to the Transaction Processing Module.
• The Transaction Processing module interacts with the Persistence layer to store or update state.
• The Reporting Module queries the Persistence layer to generate the necessary reports.
Architectural Patterns and Design Principles
• Separation of concerns: distinct modules for UI, processing logic, persistence, and reporting.
• Layering the design (Presentation Layer, Business Logic Layer, Persistence Layer).
• Clear paths for error handling (e.g., mis-parsed transactions routed to the “bad transactions” list).
Relevant Technologies and Tools
• While the project leaves the tech stack up to the developer, you could annotate the components with your chosen language/framework (for example, if using a JavaScript-based UI with Node.js for backend or a Python CLI, note that).
• Libraries or frameworks that play a role (e.g., CSV parsing libraries, UI frameworks, caching for in-memory persistence).