Skip to content

refactor inventory migration to create baseline (not product inventory) snapshot#5527

Merged
ewaterman merged 6 commits intodevelopfrom
td/5392-remove-unused-record-stock-snapshot
Nov 21, 2025
Merged

refactor inventory migration to create baseline (not product inventory) snapshot#5527
ewaterman merged 6 commits intodevelopfrom
td/5392-remove-unused-record-stock-snapshot

Conversation

@ewaterman
Copy link
Member

@ewaterman ewaterman commented Oct 1, 2025

✨ Description of Change

Link to GitHub issue or Jira ticket: fixes #5392, closes #165

Description: We removed the "product snapshot" feature (not to be confused with the inventory snapshot feature) from the stock card in #5269 (behind the scenes this feature did a record stock containing the current stock for the product, so essentially it did what we have now for baselines but using the product inventory transaction type). This PR is just removing the extra code that I forgot to also remove as a part of that original PR.

Note that you can still achieve this "snapshot" functionality by simply doing a record stock and clicking save without making any changes.

EDIT: Artur pointed out this snapshot was being used in the old inventory migration code so I changed that to create a baseline transaction snapshot instead.

I tested the migration and it seems to be working. Before migration:
image

After migration:
image

@ewaterman ewaterman requested a review from jmiranda October 1, 2025 19:34
@ewaterman ewaterman self-assigned this Oct 1, 2025
@github-actions github-actions bot added type: maintenance Code improvements, optimizations and refactors, dependency upgrades... domain: backend Changes or discussions relating to the backend server labels Oct 1, 2025
@codecov
Copy link

codecov bot commented Oct 1, 2025

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 8.71%. Comparing base (1bb7314) to head (b3632f1).
⚠️ Report is 246 commits behind head on develop.

Files with missing lines Patch % Lines
...ces/org/pih/warehouse/data/MigrationService.groovy 0.00% 2 Missing ⚠️
...entory/InventoryTransactionMigrationService.groovy 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             develop   #5527      +/-   ##
============================================
- Coverage       9.12%   8.71%   -0.41%     
- Complexity      1170    1187      +17     
============================================
  Files            701     713      +12     
  Lines          45281   45590     +309     
  Branches       10851   10909      +58     
============================================
- Hits            4131    3975     -156     
- Misses         40497   41033     +536     
+ Partials         653     582      -71     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ewaterman ewaterman changed the title 5392 remove unused product snapshot controller #5392 remove unused product snapshot controller Oct 1, 2025
@ewaterman ewaterman changed the title #5392 remove unused product snapshot controller remove unused product snapshot controller Oct 1, 2025
@ewaterman ewaterman requested a review from awalkowiak October 1, 2025 20:20
@ewaterman ewaterman added the warn: do not merge Marks a pull request that is not yet ready to be merged label Oct 3, 2025
@ewaterman ewaterman requested a review from awalkowiak October 14, 2025 17:45
@ewaterman ewaterman changed the title remove unused product snapshot controller refactor inventory migration to create baseline (not product inventory) snapshot Oct 14, 2025
@ewaterman ewaterman removed the warn: do not merge Marks a pull request that is not yet ready to be merged label Oct 14, 2025
@ewaterman ewaterman removed this from the QoH and Transaction Refactor milestone Oct 14, 2025
@ewaterman ewaterman merged commit 838d68d into develop Nov 21, 2025
7 checks passed
@ewaterman ewaterman deleted the td/5392-remove-unused-record-stock-snapshot branch November 21, 2025 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: backend Changes or discussions relating to the backend server type: maintenance Code improvements, optimizations and refactors, dependency upgrades...

Projects

None yet

2 participants