Repository navigation
Import older Shopify orders as stock-neutral history - #5
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR: Adds an optional date cutoff for importing older Shopify orders as history, so backfills preserve current stock instead of treating past sales as new warehouse work.
Orders before the cutoff use core's historical creation path: no stock/bin/serial allocation, reservations, approvals or new-order announcements. Fulfilled history is recorded as shipped and cancelled history as cancelled; later updates remain historical and never restock it. Orders on/after the cutoff retain normal behavior. Mappings and external references keep imports idempotent. Date-filtered records skipped by this version can be revisited as history; manually ignored records remain ignored. Older start dates trigger a clear read_all_orders scope check.
Set the import start date, choose the history cutoff, test the connection and run a full sync. Dates use UTC; variant mappings are required. No shipment is created for a historical order.
Stacked on #4; merge #3 and #4 first. Validation: all 138 plugin tests pass (801 assertions); UI bundle builds. Tests cover zero current stock, repeat deliveries, cancellations, changed cutoffs, ignored records and older-order scopes. No live store was changed.
GitHub-hosted CI currently cannot start: GitHub reports failed account payments or a spending-limit restriction. This is a runner-start restriction, not a build/test failure; the local results above are available for review.