Dev/1228 fr core api change stored field to object#1270
Conversation
…d search to reflect this
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code Coverage
|
Code Coverage
|
Code Coverage
|
Code Coverage
|
Code Coverage
|
Code Coverage
|
There was a problem hiding this comment.
Actionable comments posted: 13
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
software/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/service/mongo/transactions/appliers/SetAmountTransactionApplier.java (1)
59-63:⚠️ Potential issue | 🟠 Major | ⚡ Quick winAhoy:
SET_AMOUNTstill lacks a universal stored-state guard.By my reckoning, the
BULKpath usingtransaction.getStored()can still slip through without enforcingSTOREDstate. Best hoist the state check after the switch so all paths be covered.⚓ Proposed patch
if (!inventoryItem.getId().equals(stored.getItem())) { throw new IllegalArgumentException("Stored is not associated with the item."); } + if (!stored.isState(StoredStateType.STORED)) { + throw new IllegalArgumentException("Cannot set amount for stored that is not stored in a block."); + } stored.setAmount(transaction.getAmount());Also applies to: 85-90
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 346f8925-3ae3-4607-98d7-413e989242ea
📒 Files selected for processing (54)
software/core/oqm-core-api/build.gradlesoftware/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/model/object/storage/checkout/ItemCheckout.javasoftware/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/model/object/storage/checkout/ItemWholeCheckout.javasoftware/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/model/object/storage/items/stored/Stored.javasoftware/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/model/object/storage/items/stored/state/StoredInBlock.javasoftware/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/model/object/storage/items/stored/state/StoredState.javasoftware/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/model/object/storage/items/stored/state/StoredStateType.javasoftware/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/model/rest/search/StoredSearch.javasoftware/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/service/ItemStatsService.javasoftware/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/service/mongo/StoredService.javasoftware/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/service/mongo/transactions/appliers/AddAmountTransactionApplier.javasoftware/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/service/mongo/transactions/appliers/AddWholeTransactionApplier.javasoftware/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/service/mongo/transactions/appliers/CheckinFullTransactionApplier.javasoftware/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/service/mongo/transactions/appliers/CheckoutAmountTransactionApplier.javasoftware/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/service/mongo/transactions/appliers/SetAmountTransactionApplier.javasoftware/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/service/mongo/transactions/appliers/SubtractAmountTransactionApplier.javasoftware/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/service/mongo/transactions/appliers/TransferAmountTransactionApplier.javasoftware/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/service/mongo/transactions/appliers/TransferWholeTransactionApplier.javasoftware/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/service/schemaVersioning/upgraders/stored/StoredSchemaUpgrader.javasoftware/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/service/schemaVersioning/upgraders/stored/bumpers/StoredItemBumper5.javasoftware/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/interfaces/endpoints/inventory/items/InventoryItemsCrudTest.javasoftware/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/interfaces/endpoints/inventory/items/InventoryItemsStatsTest.javasoftware/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/interfaces/endpoints/inventory/items/StoredInItemEndpointsTest.javasoftware/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/model/object/storage/items/stored/StoredTest.javasoftware/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/service/mongo/StoredServiceTest.javasoftware/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/service/mongo/transactions/transactionApplier/AddAmountAppliedTransactionTest.javasoftware/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/service/mongo/transactions/transactionApplier/AddWholeAppliedTransactionTest.javasoftware/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/service/mongo/transactions/transactionApplier/CheckinFullAmountAppliedTransactionTest.javasoftware/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/service/mongo/transactions/transactionApplier/CheckinWholeAppliedTransactionTest.javasoftware/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/service/mongo/transactions/transactionApplier/CheckoutAmountAppliedTransactionTest.javasoftware/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/service/mongo/transactions/transactionApplier/CheckoutWholeAppliedTransactionTest.javasoftware/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/service/mongo/transactions/transactionApplier/SetAmountAppliedTransactionTest.javasoftware/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/service/mongo/transactions/transactionApplier/SubtractAmountAppliedTransactionTest.javasoftware/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/service/mongo/transactions/transactionApplier/TransferAmountAppliedTransactionTest.javasoftware/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/service/mongo/transactions/transactionApplier/TransferWholeAppliedTransactionTest.javasoftware/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/testResources/data/StoredTestObjectCreator.javasoftware/core/oqm-core-base-station/build.gradlesoftware/core/oqm-core-base-station/installerSrc/installerProperties.jsonsoftware/core/oqm-core-base-station/src/main/java/tech/ebp/oqm/core/baseStation/interfaces/rest/passthrough/inventory/ItemCheckoutPassthrough.javasoftware/core/oqm-core-base-station/src/main/java/tech/ebp/oqm/core/baseStation/interfaces/rest/passthrough/inventory/ItemInBlockPassthrough.javasoftware/core/oqm-core-base-station/src/main/java/tech/ebp/oqm/core/baseStation/interfaces/rest/passthrough/inventory/ItemStoredPassthrough.javasoftware/core/oqm-core-base-station/src/main/java/tech/ebp/oqm/core/baseStation/interfaces/ui/pages/ItemCheckoutUi.javasoftware/core/oqm-core-base-station/src/main/java/tech/ebp/oqm/core/baseStation/interfaces/ui/pages/OverviewUi.javasoftware/core/oqm-core-base-station/src/main/java/tech/ebp/oqm/core/baseStation/service/modelTweak/SearchResultTweak.javasoftware/core/oqm-core-base-station/src/main/resources/META-INF/resources/res/js/obj/item/ItemView.jssoftware/core/oqm-core-base-station/src/main/resources/META-INF/resources/res/js/obj/itemStored/ItemStoredTransaction.jssoftware/core/oqm-core-base-station/src/main/resources/META-INF/resources/res/js/obj/itemStored/StoredView.jssoftware/core/oqm-core-base-station/src/main/resources/templates/tags/search/itemStored/searchResults.htmlsoftware/libs/core-api-lib-quarkus/deployment/pom.xmlsoftware/libs/core-api-lib-quarkus/deployment/src/main/java/tech/ebp/oqm/lib/core/api/quarkus/deployment/config/CoreApiLibBuildTimeConfig.javasoftware/libs/core-api-lib-quarkus/integration-tests/pom.xmlsoftware/libs/core-api-lib-quarkus/pom.xmlsoftware/libs/core-api-lib-quarkus/runtime/pom.xmlsoftware/libs/core-api-lib-quarkus/runtime/src/main/java/tech/ebp/oqm/lib/core/api/quarkus/runtime/restClient/searchObjects/StoredSearch.java
📜 Review details
🧰 Additional context used
🪛 HTMLHint (1.9.2)
software/core/oqm-core-base-station/src/main/resources/templates/tags/search/itemStored/searchResults.html
[error] 97-97: Special characters must be escaped : [ < ].
(spec-char-escape)
[error] 99-99: Special characters must be escaped : [ > ].
(spec-char-escape)
[error] 101-101: Tag must be paired, no start tag: [ ]
(tag-pair)
[error] 96-96: Tag must be paired, missing: [ ], start tag match failed [ ] on line 96.
(tag-pair)
🔇 Additional comments (35)
software/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/testResources/data/StoredTestObjectCreator.java (1)
13-13: LGTM!Also applies to: 38-38
software/core/oqm-core-base-station/src/main/java/tech/ebp/oqm/core/baseStation/interfaces/rest/passthrough/inventory/ItemInBlockPassthrough.java (1)
79-79: LGTM!software/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/service/mongo/transactions/appliers/SubtractAmountTransactionApplier.java (1)
11-12: LGTM!Also applies to: 67-69, 74-74
software/core/oqm-core-base-station/src/main/resources/templates/tags/search/itemStored/searchResults.html (1)
54-54: LGTM!Also applies to: 99-99, 104-104, 119-119
software/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/interfaces/endpoints/inventory/items/StoredInItemEndpointsTest.java (1)
14-14: LGTM!Also applies to: 23-23, 140-140, 263-263
software/core/oqm-core-base-station/build.gradle (1)
8-8: LGTM!Also applies to: 35-35
software/libs/core-api-lib-quarkus/runtime/src/main/java/tech/ebp/oqm/lib/core/api/quarkus/runtime/restClient/searchObjects/StoredSearch.java (1)
22-24: Ahoy—verify this default filter doesn’t hide non-STOREDrecords in shared callers.Setting
@DefaultValue("STORED")on a shared search object can silently narrow results where callers previously expected all states.#!/bin/bash # Find builder/usage sites and check whether storedState is explicitly set. rg -n --type=java -C3 '\bStoredSearch\b' rg -n --type=java -C3 '\bstoredState\s*\(' rg -n --type=java -C3 '`@BeanParam`\s+StoredSearch\b|StoredSearch\s+\w+\s*[,\)]'software/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/model/object/storage/items/stored/StoredTest.java (1)
11-11: LGTM!Also applies to: 53-53, 64-64
software/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/model/object/storage/items/stored/state/StoredState.java (1)
1-28: LGTM!software/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/model/object/storage/items/stored/state/StoredInBlock.java (1)
1-38: LGTM!software/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/service/schemaVersioning/upgraders/stored/StoredSchemaUpgrader.java (1)
10-10: LGTM!Also applies to: 22-23
software/core/oqm-core-api/build.gradle (1)
11-11: LGTM!software/core/oqm-core-base-station/src/main/java/tech/ebp/oqm/core/baseStation/interfaces/rest/passthrough/inventory/ItemStoredPassthrough.java (1)
73-74: LGTM!software/core/oqm-core-base-station/src/main/java/tech/ebp/oqm/core/baseStation/interfaces/rest/passthrough/inventory/ItemCheckoutPassthrough.java (1)
73-73: LGTM!software/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/service/mongo/transactions/appliers/CheckoutAmountTransactionApplier.java (1)
15-16: LGTM!Also applies to: 72-77, 101-101
software/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/service/mongo/transactions/transactionApplier/AddAmountAppliedTransactionTest.java (1)
19-19: LGTM!Also applies to: 103-103, 188-188, 324-324
software/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/service/mongo/transactions/transactionApplier/CheckoutAmountAppliedTransactionTest.java (1)
24-24: LGTM!Also applies to: 60-60, 122-122, 184-184, 246-246, 276-276, 306-306, 337-337, 369-369, 401-401, 433-433, 464-464
software/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/service/mongo/transactions/transactionApplier/CheckinFullAmountAppliedTransactionTest.java (1)
26-26: Shipshape refactor, matey — these updated test fixtures match the newStoredInBlockstate wiring cleanly.Also applies to: 60-60, 139-139, 213-213, 287-287, 360-360
software/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/model/rest/search/StoredSearch.java (1)
4-5: Aye, this search-rigging tracks the new stateful hull and looks orderly for the migrated model.Also applies to: 14-15, 27-29, 74-75, 88-107
software/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/service/mongo/transactions/transactionApplier/CheckinWholeAppliedTransactionTest.java (1)
26-26: Good seamanship here — the test inputs now use the new stored-state object cleanly.Also applies to: 61-61, 134-134, 205-205
software/core/oqm-core-base-station/src/main/resources/META-INF/resources/res/js/obj/itemStored/StoredView.js (1)
40-40: A tidy deck, matey — helper renames and call-site swaps are consistent with the new state-driven stored shape.Also applies to: 46-46, 52-52, 58-58, 81-81, 233-233, 239-239, 245-248
software/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/service/mongo/transactions/transactionApplier/CheckoutWholeAppliedTransactionTest.java (1)
24-24: Aye, these test updates are in proper trim for theStoredInBlockstate model.Also applies to: 57-57, 113-113, 169-169, 224-224
software/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/service/mongo/transactions/transactionApplier/SetAmountAppliedTransactionTest.java (1)
24-24: These test changes be steady as she goes — proper use ofstate(StoredInBlock...)throughout.Also applies to: 94-94, 142-142, 278-278
software/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/service/mongo/transactions/transactionApplier/TransferWholeAppliedTransactionTest.java (1)
18-18: A clean refit, matey — transfer tests now speak the new stored-state contract correctly.Also applies to: 59-59, 117-117, 176-176, 234-234
software/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/model/object/storage/checkout/ItemCheckout.java (1)
42-43: LGTM!Also applies to: 90-93, 106-114
software/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/service/mongo/transactions/appliers/TransferAmountTransactionApplier.java (1)
53-54: LGTM!Also applies to: 64-65, 101-106
software/core/oqm-core-base-station/src/main/java/tech/ebp/oqm/core/baseStation/interfaces/ui/pages/OverviewUi.java (1)
106-111: LGTM!software/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/service/mongo/transactions/appliers/AddAmountTransactionApplier.java (1)
53-55: LGTM!Also applies to: 73-75, 80-87, 101-103
software/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/interfaces/endpoints/inventory/items/InventoryItemsStatsTest.java (1)
11-12: LGTM!Also applies to: 130-131, 226-227
software/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/service/mongo/transactions/transactionApplier/SubtractAmountAppliedTransactionTest.java (1)
19-19: LGTM!Also applies to: 53-53, 99-99, 149-149, 198-198, 224-224, 251-251, 278-278, 310-310, 320-320, 352-352, 362-362, 394-394, 404-404, 436-436, 446-446, 473-473
software/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/service/mongo/transactions/transactionApplier/AddWholeAppliedTransactionTest.java (1)
21-21: LGTM!Also applies to: 56-56, 99-99, 141-141, 184-184, 205-205, 214-214, 226-226, 241-241, 260-260, 281-281
software/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/service/mongo/transactions/transactionApplier/TransferAmountAppliedTransactionTest.java (1)
17-17: LGTM!Also applies to: 57-57, 131-131, 139-139, 213-213, 221-221, 296-296, 304-304, 379-379, 387-387, 463-463, 587-587, 621-621, 656-656, 664-664, 699-699, 707-707
software/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/service/mongo/transactions/appliers/TransferWholeTransactionApplier.java (1)
10-11: LGTM!Also applies to: 42-44, 53-55, 57-57, 69-74
software/core/oqm-core-api/src/main/java/tech/ebp/oqm/core/api/service/mongo/transactions/appliers/AddWholeTransactionApplier.java (1)
11-12: LGTM!Also applies to: 44-47, 58-58
software/core/oqm-core-api/src/test/java/tech/ebp/oqm/core/api/service/mongo/StoredServiceTest.java (1)
15-15: LGTM!Also applies to: 149-149, 173-181, 204-212, 315-341
Code Coverage
|
Checklist:
Summary by CodeRabbit
Release Notes