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

Cherry pick changes from the 0.8.23 Hotfix 1 to the obgm feature branch #4411

Merged
merged 5 commits into from
Dec 12, 2023

Conversation

awalkowiak
Copy link
Collaborator

No description provided.

drodzewicz and others added 4 commits December 11, 2023 12:34
…ED to not be sent to the requestor (#4398)

* OBPIH-5984 Fix issue causing approval email for status update to ISSUED to not be sent to the requestor

* OBPIH-5984 Hydrate mostRecentEvent value before building the mail template to avoid lazyInitializationException

* OBPIH-5984 Create a service method which fetches requisition with events
…4404)

* OBPIH-5990 Add validation for deleting stock movement with associated invoice to api controller

* OBPIH-5990 Remove unused import
@awalkowiak awalkowiak added the warn: do not squash Apply to any pull request whose commits shouldn't be squashed upon merging label Dec 11, 2023
@@ -837,6 +838,14 @@ class RequisitionService {
}
}

// TODO in Grails 3 move this method to @Service RequisitionDataService
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@drodzewicz I see here is a TODO in Grails 3. Is it something that will be fairly quick? Could you add it to this PR?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, this should be rather quick.
It requires for me to create a RequisitionDataService which would implement a getRequisitionWithEvents with @Join("events")

@drodzewicz
Copy link
Collaborator

@awalkowiak the changes that were mentioned in the TODO comment have been pushed

@@ -16,6 +16,7 @@ import org.grails.plugins.web.taglib.ApplicationTagLib
import org.joda.time.LocalDate
import org.pih.warehouse.DateUtil
import javassist.NotFoundException
import org.hibernate.criterion.CriteriaSpecification
Copy link
Collaborator

Choose a reason for hiding this comment

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

is it necessary?

Copy link
Collaborator

Choose a reason for hiding this comment

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

good point

@@ -263,8 +265,7 @@ class StockMovementService {
void updateRequisitionStatus(String id, RequisitionStatus status, Comment comment = null) {

log.info "Update status ${id} " + status
// TODO: In Grails the get below should be replaced by the data service get that joins the Events
Requisition requisition = Requisition.get(id)
Requisition requisition = requisitionDataService.getRequisitionWithEvents(id)
Copy link
Collaborator

Choose a reason for hiding this comment

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

ok, since we joined the events here, shouldn't we remove the additional fetch from somewhere, that was added in order to prevent the LIE?

Copy link
Collaborator

@kchelstowski kchelstowski Dec 11, 2023

Choose a reason for hiding this comment

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

@drodzewicz hm, I guess nevermind, but it's weird that here, I see the Requisition.get, but when I go to your commit directly, I can see this:
Screenshot from 2023-12-11 18-07-16

which would be an answer to what I wrote, but I got mistaken by the change I can actually see in "Changed files"

Copy link
Collaborator

Choose a reason for hiding this comment

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

there was not additional fetch before the hotfix, everything is correct.
The additional fetch was in the first PR for this hotfix which added the Requisition.get(event.requsistion.id) in onApplicationEvent(RequisitionStatusTransitionEvent event)

@awalkowiak awalkowiak merged commit 8c0fb05 into feature/upgrade-to-grails-3.3.10 Dec 12, 2023
1 check passed
@awalkowiak awalkowiak deleted the obgm-0.8.23-hotfix1 branch December 12, 2023 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
warn: do not squash Apply to any pull request whose commits shouldn't be squashed upon merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants