How ullyanne/folha-de-pagamento works
Project type and purpose
• This is a standalone, console-based payroll management system written in Python (“Folha de Pagamento”).
• It provides a CLI (run.py) to add/remove employees, record time cards, sales results, service fees, run payroll, schedule pay dates, and supports undo/redo via Memento.
• Key use case: manage employees, compute and disburse pay according to configurable schedules and deduction rules.
File structure
• Top-level:
• run.py – the CLI entry point (commands dispatcher)
• src/ – core package
• Folha_de_Pagamento.pdf – spec document
• src/company.py – Company aggregate holding all employees and coordinating operations
• src/employee/ – Employee hierarchy
• employeeFactory.py – Factory Method to instantiate Hourly, Salaried or Commissioned
• commissioned.py, hourly.py, salaried.py – concrete employee types
• employee.py – base abstract class
• src/payroll/ – payroll and schedule
• payroll.py – runs payroll cycle
• schedule.py – computes pay dates
• src/syndicate/ – union membership & fee management
• src/table/ – Template Method for consistent console table rendering (columns/rows)
• src/tools/ – cross-cutting utilities
• memento.py – undo/redo support
• util.py – helper functions
• src/workedHours.py – time-card (“punch”) logic
README for architectural hints
• Lists design patterns: Factory Method, Memento, Template Method, Extract/Move Method, Replace Temp With Query, Dispatch Table
• Describes core functions (add/remove employee, time card, sales, fee, change data, list, run payroll, undo/redo, payment schedules)
Details
• Every subpackage as its own component
• Cross-cutting utilities (Memento, Util) connecting to all state-modifying commands
• Schedule variants (weekly, bi-weekly, monthly) as part of Schedule component
• Design patterns next to the components that implement them (e.g., “<<Factory Method>>” on EmployeeFactory)