Skip to content

feat: use amazon-go for Amazon orders#59

Merged
eshaffer321 merged 3 commits into
mainfrom
codex/use-amazon-go-provider
Jul 6, 2026
Merged

feat: use amazon-go for Amazon orders#59
eshaffer321 merged 3 commits into
mainfrom
codex/use-amazon-go-provider

Conversation

@eshaffer321

@eshaffer321 eshaffer321 commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • replace the npm amazon-order-scraper adapter with the Go amazon-go client
  • read Amazon auth from amazon-go cookie accounts / explicit cookie files
  • remove the old scraper JSON parser and browser-data-dir config
  • add auth preflight errors with actionable import-browser-profile recovery commands
  • fix Amazon shipment charge matching to use item line totals

Dependency

Uses released amazon-go v0.3.0: https://github.com/eshaffer321/amazon-go/releases/tag/v0.3.0

Verification

  • go test ./internal/adapters/providers/amazon -run TestOrder_GetItemsForChargeUsesLineTotalsForShipmentMatching -count=1
  • go test ./...
  • go test ./... -race
  • go build -o itemize ./cmd/itemize/
  • go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.4.0 run --timeout=5m
  • go run ./cmd/amazon-go import-browser-profile -headless -profile-dir "$HOME/.itemize/amazon/amazon-wife" -account amazon-wife
  • ./itemize amazon -dry-run -days 30 -max 5 -account amazon-wife -verbose

Dry-run result after refreshing amazon-wife cookies: Processed=4 Skipped=1 Errors=0.

@eshaffer321 eshaffer321 force-pushed the codex/use-amazon-go-provider branch from 3bca65a to c083760 Compare July 6, 2026 02:19
@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.74419% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.87%. Comparing base (8d948e8) to head (1b5039b).

Files with missing lines Patch % Lines
internal/adapters/providers/amazon/provider.go 76.52% 21 Missing and 6 partials ⚠️
internal/adapters/providers/amazon/order.go 50.00% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #59      +/-   ##
==========================================
- Coverage   59.95%   59.87%   -0.08%     
==========================================
  Files          47       46       -1     
  Lines        5262     5142     -120     
==========================================
- Hits         3155     3079      -76     
+ Misses       1920     1871      -49     
- Partials      187      192       +5     
Flag Coverage Δ
unittests 59.87% <76.74%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
internal/application/sync/handlers/amazon.go 65.28% <100.00%> (ø)
internal/domain/matcher/subset.go 0.00% <ø> (ø)
internal/infrastructure/config/config.go 81.08% <100.00%> (ø)
internal/adapters/providers/amazon/order.go 65.38% <50.00%> (+4.91%) ⬆️
internal/adapters/providers/amazon/provider.go 78.44% <76.52%> (+4.91%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@eshaffer321 eshaffer321 force-pushed the codex/use-amazon-go-provider branch from c083760 to 5341186 Compare July 6, 2026 02:22
@eshaffer321 eshaffer321 merged commit 8705650 into main Jul 6, 2026
14 checks passed
@eshaffer321 eshaffer321 deleted the codex/use-amazon-go-provider branch July 6, 2026 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant