-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MODORDERS-1122] Add logic to create item in any tenant for binding (#…
…953) * [MODORDERS-1122] Add bindPiecesResult as a return value for bind endpoint * [MODORDERS-1122] Fix spelling * [MODORDERS-1122] Fix failing test * [MODORDERS-1122] Fix failing test * [MODORDERS-1122] Accept null requestsAction * [MODORDERS-1122] Add BindPiecesHolder * [MODORDERS-1122] Assert itemId not null * [MODORDERS-1122] Add ProcessingStatus to BindPiecesResult * Revert "[MODORDERS-1122] Add ProcessingStatus to BindPiecesResult" This reverts commit 1dcda97. * [MODORDERS-1122] Update acq modules * [MODORDERS-1122] Fix failing test * [MODORDERS-1122] Update acq modules * [MODORDERS-1122] Fix failing test * [MODORDERS-1122] Fix failing test
- Loading branch information
1 parent
1931b22
commit 3988230
Showing
5 changed files
with
128 additions
and
82 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
51 changes: 51 additions & 0 deletions
51
src/main/java/org/folio/models/pieces/BindPiecesHolder.java
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,51 @@ | ||
package org.folio.models.pieces; | ||
|
||
import one.util.streamex.StreamEx; | ||
import org.folio.rest.jaxrs.model.Piece; | ||
import org.folio.rest.jaxrs.model.BindPiecesCollection; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class BindPiecesHolder { | ||
|
||
private BindPiecesCollection bindPiecesCollection; | ||
private Map<String, List<Piece>> piecesGroupedByPoLine; | ||
private String bindItemId; | ||
|
||
public BindPiecesCollection getBindPiecesCollection() { | ||
return bindPiecesCollection; | ||
} | ||
|
||
public BindPiecesHolder withBindPiecesCollection(BindPiecesCollection bindPiecesCollection) { | ||
this.bindPiecesCollection = bindPiecesCollection; | ||
return this; | ||
} | ||
|
||
public Map<String, List<Piece>> getPiecesGroupedByPoLine() { | ||
return piecesGroupedByPoLine; | ||
} | ||
|
||
public BindPiecesHolder withPiecesGroupedByPoLine(Map<String, List<Piece>> piecesGroupedByPoLine) { | ||
this.piecesGroupedByPoLine = piecesGroupedByPoLine; | ||
return this; | ||
} | ||
|
||
public String getBindItemId() { | ||
return bindItemId; | ||
} | ||
|
||
public BindPiecesHolder withBindItemId(String bindItemId) { | ||
this.bindItemId = bindItemId; | ||
return this; | ||
} | ||
|
||
public StreamEx<Piece> getPieces() { | ||
return StreamEx.ofValues(piecesGroupedByPoLine).flatMap(List::stream); | ||
} | ||
|
||
public String getPoLineId() { | ||
return bindPiecesCollection.getPoLineId(); | ||
} | ||
|
||
} |
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