Commit Graph
15 Commits
Author SHA1 Message Date
Claude b739b84917 Fix duplicate estimates: make QuickBooks ids unique
The customers, employees, estimates and invoices tables were created with
t.integer :id, options: 'PRIMARY KEY', which Rails ignores, so the QuickBooks id was never unique. Two
syncs of the same record at once (saving an estimate in Redmine, then QuickBooks' webhook) inserted it
twice, so it showed twice on the customer page and counted twice on the business report.

- Migration 050 keeps one row per id (the most recently updated) and adds a unique index on id.
- A sync that collides with another one's insert retries once as an update.
- Estimates, customers and employees validate a unique id, like invoices already did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-31 11:48:23 -04:00
Claude 28538d4c7f Show when a QuickBooks sync is running
Syncs record their state in a new qbo_sync_statuses table: queued when asked for, running with how
many records have been read, removed when finished (stale rows are ignored after 6 hours). The
business report says when estimates, invoices or payments are still syncing and refreshes every 30
seconds until they finish; the settings page's Synchronization table shows the same per type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-31 10:03:12 -04:00
ricky cd109f16b5 Refactored QBO service calls 2026-03-14 00:10:10 -04:00
ricky c87e18810b Added Attribute Mapping DSL 2026-03-13 08:32:55 -04:00
ricky eb6954ddf1 refactor(sync): improve attribute mapping to support dynamic fields and custom transformations 2026-03-12 21:38:06 -04:00
ricky be1a69217f created a shared helper for authenticated requests. 2026-03-12 21:05:39 -04:00
ricky 40f7a3335c Reworked push on save and refactored variable names 2026-03-12 15:58:28 -04:00
ricky b10665355d Allow Subclasses to override the page size 2026-03-08 23:34:37 -04:00
ricky ef5089438c Fixed query_in_batches 2026-03-08 21:51:31 -04:00
ricky 23e565a304 raise exceptions if not initialized properly 2026-03-02 22:57:13 -05:00
ricky 899c9878c4 Fix: only attach invoices if document is updated 2026-03-01 19:27:23 -05:00
ricky ed111fefe7 Refactor: Update QBO connection handling to use QboConnectionService for consistency across services and controllers 2026-03-01 00:27:06 -05:00
ricky 348c521491 Added comments 2026-02-28 20:03:19 -05:00
ricky 6cee8c1d81 Fix: Remove logging of fetched page information in SyncServiceBase 2026-02-28 19:59:50 -05:00
ricky d4a0aa1db5 Refactor: Introduce SyncServiceBase for shared functionality across sync services 2026-02-28 19:47:45 -05:00