use of org.openlmis.stockmanagement.domain.template.StockCardLineItemFields in project openlmis-stockmanagement by OpenLMIS.
the class StockCardLineItemFieldDto method toModel.
/**
* Convert to DB model object.
*
* @param template the template that this filed belongs to.
* @param lineItemFields all available fields.
* @return DB model object.
*/
StockCardLineItemFields toModel(StockCardTemplate template, List<AvailableStockCardLineItemFields> lineItemFields) {
StockCardLineItemFields stockCardLineItemFields = new StockCardLineItemFields();
stockCardLineItemFields.setStockCardTemplate(template);
stockCardLineItemFields.setIsDisplayed(isDisplayed);
stockCardLineItemFields.setDisplayOrder(displayOrder);
stockCardLineItemFields.setAvailableStockCardLineItemFields(matchByName(lineItemFields));
return stockCardLineItemFields;
}
use of org.openlmis.stockmanagement.domain.template.StockCardLineItemFields in project openlmis-stockmanagement by OpenLMIS.
the class StockCardTemplateDataBuilder method createTemplate.
/**
* Create test object for stock card template.
*
* @return created object.
*/
public static StockCardTemplate createTemplate() {
StockCardTemplate template = new StockCardTemplate();
template.setFacilityTypeId(UUID.randomUUID());
template.setProgramId(UUID.randomUUID());
AvailableStockCardFields packSize = new AvailableStockCardFields();
packSize.setId(UUID.fromString("7663b4d2-d6da-11e6-bf26-cec0c932ce01"));
AvailableStockCardLineItemFields docNumber = new AvailableStockCardLineItemFields();
docNumber.setId(UUID.fromString("b15ad020-d6da-11e6-bf26-cec0c932ce01"));
template.getStockCardFields().add(new StockCardFields(template, packSize, true, 123));
template.getStockCardLineItemFields().add(new StockCardLineItemFields(template, docNumber, true, 456));
return template;
}
Aggregations