Refactor relationships in AssignedOrders and Stock models#58
Merged
YehiaFarghaly merged 1 commit intodevfrom May 19, 2025
Merged
Refactor relationships in AssignedOrders and Stock models#58YehiaFarghaly merged 1 commit intodevfrom
YehiaFarghaly merged 1 commit intodevfrom
Conversation
YehiaFarghaly
approved these changes
May 19, 2025
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.
This pull request updates the entity relationships in the
AssignedOrdersandStockmodels to improve database consistency and better reflect the intended data structure. The changes include renaming a mapped field, introducing a new relationship, and modifying an existing join column.Changes to entity relationships:
AssignedOrdersmodel:itemsfield to useassignedOrderinstead ofpackagedOrderin theStockentity. ([src/main/java/com/podzilla/warehouse/Models/AssignedOrders.javaL36-R36](https://github.com/Podzilla/warehouse/pull/58/files#diff-0903df3387465c62f90f237168b13fcec88a43dea606a450e13b29c9649bbd51L36-R36))Stockmodel:@ManyToOnerelationship to theAssignedOrdersentity, with a join column namedassigned_order_idand a nullable constraint. This introduces a reverse mapping toAssignedOrders. ([src/main/java/com/podzilla/warehouse/Models/Stock.javaR37-R44](https://github.com/Podzilla/warehouse/pull/58/files#diff-2e58d935c5017aa420bf97eefc92901538aa4fa2e972844fe5f1c118ad7686b1R37-R44))packagedOrderrelationship topackaged_order_idfor clarity and consistency. ([src/main/java/com/podzilla/warehouse/Models/Stock.javaR37-R44](https://github.com/Podzilla/warehouse/pull/58/files#diff-2e58d935c5017aa420bf97eefc92901538aa4fa2e972844fe5f1c118ad7686b1R37-R44))