Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OLMIS-7725: Removed reasons validation from doInitiate method #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,6 @@ public void shouldInitiateRequisition() {
verify(facilityReferenceDataService).findOne(facility.getId());
verify(validReasonStockmanagementService).search(program.getId(), facility.getType().getId());

verify(reasonsValidator).validate(stockAdjustmentReasons, requisition.getTemplate());
verify(requisitionService, atLeastOnce())
.initiate(eq(program), eq(facility), eq(period), eq(false),
eq(stockAdjustmentReasons), eq(requisition.getTemplate()),
Expand Down Expand Up @@ -1455,7 +1454,6 @@ public void shouldInitiateRequisitionWithIdempotencyKey() {
verify(facilityReferenceDataService).findOne(facility.getId());
verify(validReasonStockmanagementService).search(program.getId(), facility.getType().getId());

verify(reasonsValidator).validate(stockAdjustmentReasons, requisition.getTemplate());
verify(requisitionService, atLeastOnce())
.initiate(eq(program), eq(facility), eq(period), eq(false),
eq(stockAdjustmentReasons), eq(requisition.getTemplate()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ public void shouldInitiateRequisition() {
verify(facilityReferenceDataService).findOne(facility.getId());
verify(validReasonStockmanagementService).search(program.getId(), facility.getType().getId());

verify(reasonsValidator).validate(stockAdjustmentReasons, requisition.getTemplate());
verify(requisitionService, atLeastOnce())
.initiate(eq(program), eq(facility), eq(period), eq(false),
eq(stockAdjustmentReasons), eq(requisition.getTemplate()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@
import org.openlmis.requisition.utils.DatePhysicalStockCountCompletedEnabledPredicate;
import org.openlmis.requisition.utils.Message;
import org.openlmis.requisition.utils.StockEventBuilder;
import org.openlmis.requisition.validate.ReasonsValidator;
import org.openlmis.requisition.validate.RequisitionVersionValidator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -198,9 +197,6 @@ public abstract class BaseRequisitionController extends BaseController {
@Autowired
private RequisitionTemplateService requisitionTemplateService;

@Autowired
private ReasonsValidator reasonsValidator;

InitiateResult doInitiate(UUID programId, UUID facilityId, UUID suggestedPeriod,
boolean emergency, HttpServletRequest request, Profiler profiler) {
if (null == facilityId || null == programId) {
Expand Down Expand Up @@ -243,9 +239,6 @@ InitiateResult doInitiate(UUID programId, UUID facilityId, UUID suggestedPeriod,
program, facility, period, emergency, stockAdjustmentReasons,
requisitionTemplate, approvedProducts);

profiler.start("VALIDATE_REASONS");
reasonsValidator.validate(stockAdjustmentReasons, newRequisition.getTemplate());
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we cannot remove validation just like that. I know that it makes sense for Malawi impl because of their requestion, however it should be more generic solution


return new InitiateResult(newRequisition, approvedProducts, facility, program, period);
}

Expand Down