Some checks are pending
Bidi Control Character Guard / bidi-control-guard (push) Waiting to run
Circular Dependency Check / Check for new circular dependencies (push) Waiting to run
Citus Migration Smoke / Combined migrations on single-node Citus (push) Waiting to run
E2E Fresh Install Tests / fresh-install-e2e (push) Waiting to run
ext-v2 guardrails / Run ext-v2 guard and ESLint (push) Waiting to run
Integration Tests / Check for relevant changes (push) Waiting to run
Integration Tests / ${{ (github.event_name == 'schedule' || github.event.inputs.suite == 'full') && 'Full integration suite' || 'Tier-1 integration subset' }} (push) Blocked by required conditions
Mobile checks / Mobile lint + typecheck (push) Waiting to run
Mobile checks / Mobile unit tests (push) Waiting to run
Mobile checks / Mobile dependency audit (report) (push) Waiting to run
Mobile checks / Mobile reproducibility checks (push) Waiting to run
Secrets guard (env backups) / Ensure no tracked env backup files (push) Waiting to run
Temporal Readiness / fast-readiness (push) Waiting to run
Temporal Readiness / docker-parity (push) Waiting to run
TypeScript Type Check / Nx affected typecheck (push) Waiting to run
Unit Tests / Skipped-test budget (push) Waiting to run
Unit Tests / Nx affected unit tests (push) Waiting to run
Unit Tests / Server unit coverage (informational) (push) Waiting to run
Validate Tenant Management Schema / Check for relevant changes (push) Waiting to run
Validate Tenant Management Schema / Validate Tenant Management Schema (push) Blocked by required conditions
EE Workflows Build Guard / ee-workflows-build-guard (push) Waiting to run
Excluded: .git, node_modules, secrets/, compose.env, assemblyscript tgz Source: /opt/alga-psa on psa.joliet.tech
6.3 KiB
6.3 KiB
QuickBooks CSV Export/Import - Progress Tracker
Overview
This document tracks the implementation progress of the QuickBooks CSV Export/Import feature, which provides an alternative to OAuth integration for QuickBooks.
Branch: feature/quickbooks-csv-export
Started: 2024-12-16
Status: Core Implementation Complete
Progress Log
2024-12-16 - Initial Setup
- Created feature branch
feature/quickbooks-csv-exportfromrelease/0.15.0 - Set up development environment (port 3002)
- Completed comprehensive exploration of existing codebase:
- QuickBooks integration (
quickBooksOnlineAdapter.ts,qboClientService.ts) - External tax calculation system (
externalTaxImportService.ts) - Accounting export batch system (
accountingExportService.ts) - Mapping resolver (
accountingMappingResolver.ts)
- QuickBooks integration (
- Created implementation plan
- Created feature tracking files:
features-quickbooks-csv-export.json- Task list with completion statusprogress-quickbooks-csv-export.md- This progress file
2024-12-16 - Core Infrastructure
- Created
csvFieldNormalizer.tsutility- Column alias mappings for QuickBooks CSV variations
- Header normalization function
- Levenshtein distance for column suggestions
- Validation utilities for required columns
- Created
csvTaxImportValidator.tsservice- Structure validation (required columns with alias support)
- Row-level parsing (dates, amounts, tax rates)
- Database cross-referencing (invoice existence, tax_source check)
- Duplicate detection and tax aggregation
- Created
csvTaxImportService.tsservice- Main
importTaxFromCSVmethod with validation and dry-run support - Proportional tax distribution using floor + remainder algorithm
- Transaction-based updates for atomicity
- Import history tracking in
external_tax_importstable - Rollback capability to revert imports
- Main
2024-12-16 - Export Adapter
- Created
QuickBooksCSVAdapter- Implements
AccountingExportAdapterinterface - File-based delivery mode (generates downloadable CSV)
- Resolves service, tax code, and payment term mappings
- Supports tax delegation mode for external tax calculation
- Implements
- Registered adapter in
registry.ts
2024-12-16 - API Routes
- Created CSV export API route (
POST /api/accounting/csv/export) - Created tax import API route (
POST /api/accounting/csv/import/tax) - Created template download route (
GET /api/accounting/csv/import/tax/template) - Created import history route (
GET /api/accounting/csv/import/tax/history) - Created rollback route (
POST /api/accounting/csv/import/tax/rollback/[importId])
2024-12-16 - UI Components
- Created
CSVExportPanelcomponent- Date range picker
- Invoice status filters
- Tax delegation mode toggle
- Download button with loading state
- Created
CSVTaxImportPanelcomponent- File upload (drag & drop)
- Required date range
- Inline help with QuickBooks export instructions
- Validate and Import buttons
- Created
CSVImportPreviewcomponent- Stats summary (rows, valid, matched)
- Validation status badges
- Error and warning lists
- Import summary with tax totals
- Created
CSVIntegrationSettingswrapper component - Integrated into
IntegrationsSettingsPageunder Accounting category
Phase Status
| Phase | Status | Progress |
|---|---|---|
| 1. Core Infrastructure | Mostly Complete | 3/5 tasks |
| 2. Export Adapter | Mostly Complete | 3/4 tasks |
| 3. Import API | Mostly Complete | 2/4 tasks |
| 4. UI Components | Complete | 4/4 tasks |
| 5. Testing & Polish | Not Started | 0/3 tasks |
Overall Progress: 12/20 tasks (60%)
Remaining Work
Phase 1: Core Infrastructure
- Write unit tests for CSV field normalizer
- Write unit tests for CSV tax import validator
Phase 2: Export Adapter
- Write unit tests for QuickBooksCSVAdapter
Phase 3: Import API
- Write integration tests for CSV export flow
- Write integration tests for CSV tax import flow
Phase 5: Testing & Polish
- Write Playwright E2E tests for CSV export UI
- Write Playwright E2E tests for CSV import UI
- Add optional database index for CSV import queries
Commits
| Date | Commit | Description |
|---|---|---|
| 2024-12-16 | 18b82a1b2 | feat(csv-import): add CSV field normalizer utility |
| 2024-12-16 | fc0652c8a | feat(csv-import): add CSV tax import validator service |
| 2024-12-16 | c6fb100a3 | feat(csv-import): add CSV tax import service |
| 2024-12-16 | 26f55cf6e | feat(csv-export): add QuickBooks CSV export adapter |
| 2024-12-16 | f586bcfa6 | feat(csv): add CSV accounting API routes |
| 2024-12-16 | 7e008f1ff | feat(csv-ui): add CSV export and import UI components |
| 2024-12-16 | 950ab8671 | feat(csv-ui): integrate CSV panels into integrations settings |
Reference Files
Key files created during implementation:
Core Services:
server/src/lib/utils/csvFieldNormalizer.ts- Column name normalizationserver/src/lib/services/csvTaxImportValidator.ts- Validation rulesserver/src/lib/services/csvTaxImportService.ts- Import logic
Adapter:
server/src/lib/adapters/accounting/quickBooksCSVAdapter.ts- CSV export adapterserver/src/lib/adapters/accounting/registry.ts- Adapter registration
API Routes:
server/src/app/api/accounting/csv/export/route.tsserver/src/app/api/accounting/csv/import/tax/route.tsserver/src/app/api/accounting/csv/import/tax/template/route.tsserver/src/app/api/accounting/csv/import/tax/history/route.tsserver/src/app/api/accounting/csv/import/tax/rollback/[importId]/route.ts
UI Components:
server/src/components/integrations/csv/CSVExportPanel.tsxserver/src/components/integrations/csv/CSVTaxImportPanel.tsxserver/src/components/integrations/csv/CSVImportPreview.tsxserver/src/components/settings/integrations/CSVIntegrationSettings.tsx
Notes
- The CSV integration is accessible from Settings > Integrations > Accounting tab
- Service mappings must be configured in the QuickBooks Online section before exporting
- Unmapped services will cause the entire export to fail (consistent with existing adapters)
- Inline help is provided in the tax import panel with QuickBooks export instructions