You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Refactor: Introduce ReportFilter DTO to replace multiple positional parameters in Reports controller #4561
Several methods in app/Controllers/Reports.php accept 4+ positional string parameters ($start_date, $end_date, $sale_type, $location_id, etc.), which is a pre-existing code smell flagged in the existing TODO comments.
Affected methods include (but are not limited to):
summary_sales()
summary_categories()
summary_customers()
summary_suppliers()
summary_items()
summary_employees()
summary_discounts()
graphical_summary_sales()
graphical_summary_items()
graphical_summary_categories()
graphical_summary_suppliers()
graphical_summary_employees()
detailed_sales()
detailed_receivings()
and others (~15+ methods total)
Proposed Solution
Introduce a ReportFilter value object / DTO at app/Entities/ReportFilter.php (namespace App\Entities, aligned with CodeIgniter 4 conventions):
app/Controllers/Reports.php still has all the described methods using multiple positional string/int parameters, exactly as the issue describes, e.g.:
summary_sales(string $start_date, string $end_date, string $sale_type, string $location_id = 'all') — with the pre-existing // TODO: Perhaps these need to be passed as an array? Too many parameters in the signature. comment still in place.
summary_categories(), summary_customers(), summary_suppliers(), summary_items(), summary_employees(), summary_discounts() (which also takes int $discount_type = 0), graphical_summary_sales(), graphical_summary_items(), graphical_summary_categories(), graphical_summary_suppliers(), graphical_summary_employees(), detailed_sales(), detailed_receivings(), and others all still take 4+ positional parameters, each building an $inputs array locally right after entry (marked // TODO: Duplicated Code throughout).
There is no app/Entities/ directory in the codebase at all (app/ contains Commands, Common.php, Config, Controllers, Database, Events, Filters, Helpers, Language, Libraries, Models, ThirdParty, Views, index.html — no Entities), and a repo-wide search finds no ReportFilter class anywhere. No PR is currently linked to this issue. This remains an open, unimplemented refactor on master.
DTOs need to be put into /app/TransferObjects/[Domain]/ (e.g., /app/TransferObjects/Cashups/CashupAmounts.php), not /app/Entities/. Entities are DOs not DTOs.
Activity
objecttothis commentedon Oct 25, 2026
Claude Issue Checker Agent (cc @objecttothis)
Investigated against current
master.Status: Still present (refactor not done).
app/Controllers/Reports.phpstill has all the described methods using multiple positional string/int parameters, exactly as the issue describes, e.g.:summary_sales(string $start_date, string $end_date, string $sale_type, string $location_id = 'all')— with the pre-existing// TODO: Perhaps these need to be passed as an array? Too many parameters in the signature.comment still in place.summary_categories(),summary_customers(),summary_suppliers(),summary_items(),summary_employees(),summary_discounts()(which also takesint $discount_type = 0),graphical_summary_sales(),graphical_summary_items(),graphical_summary_categories(),graphical_summary_suppliers(),graphical_summary_employees(),detailed_sales(),detailed_receivings(), and others all still take 4+ positional parameters, each building an$inputsarray locally right after entry (marked// TODO: Duplicated Codethroughout).There is no
app/Entities/directory in the codebase at all (app/containsCommands,Common.php,Config,Controllers,Database,Events,Filters,Helpers,Language,Libraries,Models,ThirdParty,Views,index.html— noEntities), and a repo-wide search finds noReportFilterclass anywhere. No PR is currently linked to this issue. This remains an open, unimplemented refactor onmaster.objecttothis commentedon Oct 28, 2026
DTOs need to be put into /app/TransferObjects/[Domain]/ (e.g., /app/TransferObjects/Cashups/CashupAmounts.php), not /app/Entities/. Entities are DOs not DTOs.