Skip to content

Latest commit

 

History

History
147 lines (115 loc) · 5.1 KB

File metadata and controls

147 lines (115 loc) · 5.1 KB

tap-quickbooks Migration Summary

✅ Successfully Migrated to Meltano Singer SDK

This tap has been successfully ported from the original hotglue implementation to the Meltano Singer SDK.

What Was Accomplished

1. Core Implementation

  • ✅ OAuth2 authentication with refresh token support
  • ✅ QuickBooks REST API client with SQL-like query building
  • ✅ Custom pagination for QuickBooks offset-based API
  • ✅ Incremental replication using MetaData.LastUpdatedTime
  • ✅ Support for both production and sandbox environments

2. Streams Implemented (29 total)

All standard QuickBooks entity streams have been ported:

Incremental Replication (25 streams):

  • Account, Bill, BillPayment, Budget, Class
  • CompanyCurrency, CreditMemo, Customer, CustomerType
  • Department, Employee, Estimate, Invoice, Item
  • JournalEntry, Payment, PaymentMethod, Purchase
  • PurchaseOrder, SalesReceipt, Term, TimeActivity
  • Transfer, Vendor, VendorCredit

Full Table Replication (4 streams):

  • CompanyInfo, Preferences, TaxCode, TaxRate

3. SDK Features Leveraged

  • ✅ Built-in OAuth2 authenticator class
  • ✅ Typing helpers for configuration schema
  • ✅ Automatic state management
  • ✅ Stream maps capability
  • ✅ Schema flattening support
  • ✅ Batch message support
  • ✅ Structured logging

4. Configuration

Required settings:

  • oauth_credentials.client_id: QuickBooks OAuth2 client ID
  • oauth_credentials.client_secret: QuickBooks OAuth2 client secret
  • oauth_credentials.refresh_token: OAuth2 refresh token
  • realm_id: QuickBooks company/realm identifier
  • start_date: Earliest record date to sync

Optional settings:

  • sandbox: Use QuickBooks sandbox environment (default: false)
  • user_agent: Custom User-Agent header

5. Documentation

  • ✅ Comprehensive README with setup instructions
  • ✅ Example configuration files (.env.example, config.sample.json)
  • ✅ Updated meltano.yml for Meltano integration
  • ✅ Apache 2.0 license included

6. Schemas

  • ✅ 41 JSON schemas generated from original object definitions
  • ✅ Proper MetaData object structure with nested properties
  • ✅ Flattened MetaData fields for easier querying

Testing

The tap has been tested with:

uv run tap-quickbooks --version
# Output: tap-quickbooks v[could not be detected], Meltano SDK v0.53.2

uv run tap-quickbooks --discover
# Successfully discovers all 29 streams

uv run tap-quickbooks --about
# Shows complete configuration schema and capabilities

Known Limitations

  1. Report Streams Not Yet Implemented

    • The original tap included 11 report streams (BalanceSheet, CashFlow, ProfitAndLoss, etc.)
    • These use different API endpoints and would require additional implementation
    • Report schemas exist but stream classes are not implemented
  2. Version Detection

    • Version shows as "[could not be detected]" - needs pyproject.toml version configuration
  3. Advanced Features Not Yet Implemented

    • Deleted records tracking
    • Attachable stream file downloads
    • Query timeout retry logic with date chunking

Next Steps for Production Use

  1. Test with Real Credentials

    • Verify OAuth flow works correctly
    • Test incremental sync behavior
    • Validate pagination with large datasets
  2. Add Report Streams (Optional)

    • Implement report-specific stream classes
    • Handle different response format for reports
  3. Performance Tuning

    • Adjust page_size based on performance testing
    • Add retry logic for transient failures
    • Implement query timeout handling
  4. Enhanced Error Handling

    • Add specific exception handling for QuickBooks API errors
    • Implement rate limiting awareness

File Structure

tap-quickbooks/
├── tap_quickbooks/
│   ├── __init__.py
│   ├── __main__.py
│   ├── auth.py                 # OAuth2 authenticator
│   ├── client.py              # REST client & base stream
│   ├── streams.py             # Stream definitions
│   ├── tap.py                 # Main tap class
│   └── schemas/               # 41 JSON schemas
├── tests/
├── .env.example              # Environment variables template
├── config.sample.json        # Sample configuration
├── LICENSE                   # Apache 2.0 license
├── meltano.yml              # Meltano configuration
├── pyproject.toml           # Python project metadata
└── README.md                # Documentation

Migration Approach

This implementation uses the Meltano Singer SDK best practices:

  1. Declarative Configuration - Settings defined with typing helpers
  2. Class-Based Streams - Each entity is a stream class
  3. Built-in State Management - SDK handles bookmarking automatically
  4. Pagination Support - Custom paginator for QuickBooks API
  5. Schema Validation - JSON schemas for all streams
  6. Proper Error Handling - Using SDK's exception framework

Credits