-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MLT-0053 Add use-case for moving items (#37)
* Add port for moving items This use-case is mainly in-place to handle batch-updates from SynQ * Fix move item query, use coroutine * Add tests for moving items * Address reviews - Handle case with negative product quantities - Handle case where location is blank * Rename item id list query doAllItemsExist -> doesEveryItemExist * Add validation tests * Update src/test/kotlin/no/nb/mlt/wls/domain/WLSServiceTest.kt --------- Co-authored-by: Daniel Aaron Salwerowicz <[email protected]>
- Loading branch information
1 parent
caa5521
commit 90db5b8
Showing
9 changed files
with
184 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
3 changes: 3 additions & 0 deletions
3
src/main/kotlin/no/nb/mlt/wls/domain/ports/inbound/ItemNotFoundException.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package no.nb.mlt.wls.domain.ports.inbound | ||
|
||
class ItemNotFoundException(override val message: String) : RuntimeException(message) |
21 changes: 21 additions & 0 deletions
21
src/main/kotlin/no/nb/mlt/wls/domain/ports/inbound/MoveItem.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package no.nb.mlt.wls.domain.ports.inbound | ||
|
||
import no.nb.mlt.wls.domain.model.HostName | ||
import no.nb.mlt.wls.domain.model.Item | ||
|
||
/** | ||
* This port is used for handling messages regarding items moving | ||
* inside the storage system. | ||
* Some examples include handling status messages when crates arrive | ||
* at picking stations, or when items return to the | ||
* storage systems. | ||
* In both cases we want to know where the item went, and if the count changed | ||
*/ | ||
interface MoveItem { | ||
suspend fun moveItem( | ||
hostId: String, | ||
hostName: HostName, | ||
quantity: Double, | ||
location: String | ||
): Item | ||
} |
This file contains 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
3 changes: 3 additions & 0 deletions
3
src/main/kotlin/no/nb/mlt/wls/domain/ports/inbound/ValidationException.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package no.nb.mlt.wls.domain.ports.inbound | ||
|
||
class ValidationException(override val message: String, cause: Throwable? = null) : RuntimeException(message, cause) |
This file contains 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
This file contains 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
Oops, something went wrong.