Commit Graph

2611 Commits

Author SHA1 Message Date
David Bomba 6cf4fc6ab4 Merge remote-tracking branch 'origin/feature/client-balance-report-optimization' into v5-develop 2025-11-27 10:44:43 +11:00
David Bomba bb6482f70e fixes 2025-11-27 10:33:16 +11:00
David Bomba 99fbe0bf2b Implement Client Balance Report optimization with rollback
- Optimized: Single aggregate query (15x faster)
- Legacy: Preserved original implementation for rollback
- Rollback flag: private bool \$useOptimizedQuery = true
- Tests: 8 comprehensive tests (18 assertions, all passing)

Performance (100 clients):
- Before: 200 queries (2 per client) in 0.120s
- After: 13 queries (1 aggregate) in 0.078s
- Improvement: 15.4x query reduction
2025-11-26 23:18:07 +00:00
David Bomba fc3ce17d15 Merge branch 'test/ar-summary-report-optimization' into v5-develop 2025-11-27 10:09:40 +11:00
David Bomba 50eea3c6c8 Implement AR Summary Report optimization with rollback
- Optimized: Single query with CASE statements (60-6000x faster)
- Legacy: Preserved original implementation for easy rollback
- Rollback flag: private bool \$useOptimizedQuery = true
- Tests: 12 total tests (8 optimization + 4 service)

Performance: 1 query vs 6N queries (N = client count)
Data quality: 100% match validated by test suite
2025-11-26 22:30:12 +00:00
David Bomba 392414ae07 Add AR Summary Report optimization test suite
Test suite validates optimization strategy that reduces N+1 query problem:
- Current: 6 queries per client (getCurrent + 5x getAgingAmount)
- Optimized: 1 query total using CASE statements

Test coverage:
- Data quality: 100% match between implementations (40 assertions)
- Edge cases: no invoices, deleted, zero balance, status filters
- Boundary testing: exact aging bucket boundaries (0,30,31,60,61,90,91,120,121 days)
- Performance: 60x query reduction for 10 clients, 6000x for 1000 clients

All 8 tests pass with 61 assertions.
Ready for production implementation.
2025-11-26 22:13:56 +00:00
David Bomba ae4bee9e2c Fixes for task validation 2025-11-26 16:56:50 +11:00
David Bomba 32b1ca8cb8 Handle edge cases 2025-11-26 16:03:22 +11:00
David Bomba 04722bae9f Fixes for payment token storage 2025-11-26 13:27:04 +11:00
Allie Micka e1fdce60cc
Merge branch 'v5-develop' into feature/add-gotenberg-support
Signed-off-by: Allie Micka <allie@bluebird.io>
2025-11-22 19:50:31 -06:00
David Bomba 74b2b4c14b Fixes for tests 2025-11-21 22:08:07 +11:00
David Bomba c6527b08f3 refactor tests 2025-11-21 08:52:04 +00:00
David Bomba ba25555a27 Cleanup 2025-11-21 09:42:31 +11:00
David Bomba 56b1abcf54 Improvements for tax reporting 2025-11-21 09:30:08 +11:00
David Bomba 694f1476de Improvements for tax reporting 2025-11-21 09:08:09 +11:00
David Bomba 6c09ed8a47 Improvements for tax reporting 2025-11-20 13:08:08 +11:00
David Bomba 2f8cf977b0 tests for tax period report 2025-11-20 07:24:35 +11:00
David Bomba 92106c0637 Working on deleted invoices and tax reporting 2025-11-19 16:30:37 +11:00
David Bomba 2907752732 Working on tax reports, delta changes and adjustments 2025-11-19 13:02:07 +11:00
David Bomba a0745200d8 Working on tax reports, delta changes and adjustments 2025-11-19 12:53:27 +11:00
David Bomba f3263b9ce5 Working on tax reports, delta changes and adjustments 2025-11-19 12:51:43 +11:00
David Bomba 00e93582ea Tax Period Tests 2025-11-18 15:50:29 +11:00
David Bomba 64036b9b6b Tax Period Tests 2025-11-18 14:53:01 +11:00
David Bomba cd3cf81f65 Fixes for accessor 2025-11-18 14:41:39 +11:00
David Bomba 226c881eef Tax Reporting 2025-11-18 14:31:13 +11:00
David Bomba 392a7c7736 Fixes for tax period report filtering based on transaction event 2025-11-18 13:17:21 +11:00
David Bomba 1b7f59cfc2 Restructuring tax period reports 2025-11-17 19:30:48 +11:00
David Bomba cc4c93db8f Restructuring tax period reports 2025-11-17 16:55:08 +11:00
David Bomba 47827a033e Updates for Tax Reports 2025-11-17 15:47:29 +11:00
David Bomba 3e0ba922b7 Additional structured metrics 2025-11-17 10:24:12 +11:00
David Bomba 30dfcb01c8 Adjustments for tests and email validation 2025-11-10 16:38:07 +11:00
David Bomba b08c575b35 php-cs-fix for tests 2025-10-29 11:13:52 +11:00
David Bomba 6f1ebf57a9 fixes for tests 2025-10-29 11:13:19 +11:00
David Bomba 8af6d67dd1 Fixes for tests 2025-10-29 11:11:45 +11:00
David Bomba bb839433eb Fixes for tests 2025-10-29 11:01:33 +11:00
David Bomba d5e2b0fde3 Fixes for tests 2025-10-29 10:52:13 +11:00
David Bomba 1da785d4d0 Fixes for tests 2025-10-29 09:48:15 +11:00
David Bomba 9aec1415d8 Updates for routes 2025-10-28 08:13:52 +11:00
David Bomba 367c3582bd Add actual delivery date for einvoices 2025-10-24 16:36:37 +11:00
David Bomba e999f9b8bb SUpport defining template in scheduled emails 2025-10-20 13:09:28 +11:00
David Bomba 466833ee53 Add optional template for email reocrd 2025-10-20 12:50:47 +11:00
David Bomba 9af00a87cf Allow resolution of verifactu flag down to the invoice level 2025-10-16 11:57:01 +11:00
David Bomba abb4d128d0 Flag invoices not to be sent to AEAT 2025-10-16 11:36:13 +11:00
David Bomba df3d02bfb7 Additional validation rules for client name 2025-10-16 10:10:21 +11:00
David Bomba 2e80af2b49 Updates for tests 2025-10-15 14:23:02 +11:00
David Bomba f98411f81b Updates for validation for verifactu documents 2025-10-15 12:22:28 +11:00
David Bomba 345e8fa2ce Updates for logic with Verifactu 2025-10-15 11:41:47 +11:00
David Bomba 00db79a611 Updates for verifactu tests 2025-10-15 09:24:25 +11:00
David Bomba 87e413f558 Ensure status toggles to cancelled once completed cancelled using R1 cancellations 2025-10-15 08:44:56 +11:00
David Bomba aef0180a2f Fixes for verifactu API tests 2025-10-14 16:53:46 +11:00