Skip to content

OBGM-469 Fix generating product code#4124

Merged
awalkowiak merged 2 commits intofeature/upgrade-to-grails-3.3.10from
OBGM-469
Jun 27, 2023
Merged

OBGM-469 Fix generating product code#4124
awalkowiak merged 2 commits intofeature/upgrade-to-grails-3.3.10from
OBGM-469

Conversation

@awalkowiak
Copy link
Collaborator

No description provided.

Copy link
Member

@jmiranda jmiranda left a comment

Choose a reason for hiding this comment

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

Nothing specific to address other than maybe thinking about the render -> redirect change. Not sure if that's the behavior we want for the unhappy case.


def beforeInsert = {
def beforeInsert() {
createdBy = AuthService.currentUser
Copy link
Member

Choose a reason for hiding this comment

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

In the Shipment domain I changed the convention to include updatedBy in the insert as well. I had assumed we were already doing this everywhere else but it looks like I was wrong.

Topics for tech-huddle maybe:

  • Do you think that should be applied everywhere?
  • If so do you think we can move this to a generic solution
  • Auditable abstract class or trait (assuming that's what traits are for) that adds these methods to domains that have these audit fields?

The first of these could be done during MVP1, but the other points should be MVP2/post-migration.

Now that we might have more consistency with the Grails 3 dirty properties API we could also try to make these persistence events more fine-grained. There are only a few properties on Product that should cause a refresh to InventorySnapshot. Same with other domains for ProductAvailability.

}

render(view: "edit", model: [productInstance: productInstance, rootCategory: productService.getRootCategory(), locationInstance: location])
redirect(action: "edit", params: [id: productInstance.id])
Copy link
Member

Choose a reason for hiding this comment

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

What about when errors occur?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You're right... I'll restore this

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

@awalkowiak awalkowiak merged commit 2d34943 into feature/upgrade-to-grails-3.3.10 Jun 27, 2023
@awalkowiak awalkowiak deleted the OBGM-469 branch June 27, 2023 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants