Search in sources :

Example 11 with ValidDestinationAssignment

use of org.openlmis.stockmanagement.domain.sourcedestination.ValidDestinationAssignment in project openlmis-stockmanagement by OpenLMIS.

the class ValidDestinationAssignmentDataBuilder method createDestination.

/**
 * Create a valid destination assignment.
 *
 * @param programId      program ID
 * @param facilityTypeId facility type ID
 * @param destinationId  destination ID
 * @return valid destination assignment
 */
public static ValidDestinationAssignment createDestination(UUID programId, UUID facilityTypeId, UUID destinationId) {
    Node node = new Node();
    node.setReferenceId(destinationId);
    ValidDestinationAssignment assignment = new ValidDestinationAssignment();
    assignment.setProgramId(programId);
    assignment.setFacilityTypeId(facilityTypeId);
    assignment.setNode(node);
    return assignment;
}
Also used : ValidDestinationAssignment(org.openlmis.stockmanagement.domain.sourcedestination.ValidDestinationAssignment) Node(org.openlmis.stockmanagement.domain.sourcedestination.Node)

Aggregations

ValidDestinationAssignment (org.openlmis.stockmanagement.domain.sourcedestination.ValidDestinationAssignment)11 UUID (java.util.UUID)8 UUID.randomUUID (java.util.UUID.randomUUID)7 Test (org.junit.Test)7 ValidSourceDestinationDto (org.openlmis.stockmanagement.dto.ValidSourceDestinationDto)6 Node (org.openlmis.stockmanagement.domain.sourcedestination.Node)3 FacilityDto (org.openlmis.stockmanagement.dto.referencedata.FacilityDto)3 ResultActions (org.springframework.test.web.servlet.ResultActions)2 List (java.util.List)1 StockCard (org.openlmis.stockmanagement.domain.card.StockCard)1 OrderableLotIdentity (org.openlmis.stockmanagement.domain.identity.OrderableLotIdentity)1 StockCardLineItemReason (org.openlmis.stockmanagement.domain.reason.StockCardLineItemReason)1 Organization (org.openlmis.stockmanagement.domain.sourcedestination.Organization)1 ValidSourceAssignment (org.openlmis.stockmanagement.domain.sourcedestination.ValidSourceAssignment)1 LotDto (org.openlmis.stockmanagement.dto.referencedata.LotDto)1 OrderableDto (org.openlmis.stockmanagement.dto.referencedata.OrderableDto)1 ProgramDto (org.openlmis.stockmanagement.dto.referencedata.ProgramDto)1 LazyGrouping (org.openlmis.stockmanagement.util.LazyGrouping)1 LazyList (org.openlmis.stockmanagement.util.LazyList)1 LazyResource (org.openlmis.stockmanagement.util.LazyResource)1