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

Add missing information into event ResourceDeleted #1148

Merged
merged 5 commits into from
Feb 17, 2025

Conversation

bartlomiejmarszal
Copy link
Contributor

PR Description: Add Resource Type to ResourceDeleted Event

Summary

This pull request introduces a new feature to the ResourceDeleted event by adding a resourceType property. This enhancement allows for more detailed event handling by specifying the type of resource that has been deleted.

Key Changes

  • ResourceDeleted Class:

    • Added a private property resourceType to store the type of the resource.
    • Implemented setResourceType and getResourceType methods to manage the resourceType property.
    • Updated the jsonSerialize method to include the resourceType in the serialized data.
  • ResourceRepository Class:

    • Extracted the resource type using $resource->getTypes() and set it in the ResourceDeleted event using the new setResourceType method.

Benefits

  • Enhanced Event Data: By including the resource type in the ResourceDeleted event, consumers of the event can make more informed decisions based on the type of resource that was deleted.
  • Improved Code Clarity: The changes make the event handling more explicit and easier to understand by clearly defining the type of resource involved in the deletion.

Notes

  • This change assumes that the resource type is always available and that the first type in the list is the primary type to be used. Further validation or error handling may be required if this assumption does not hold in all cases.

@bartlomiejmarszal bartlomiejmarszal requested review from a team, tikhanovichA, KirylHatalski, pnal, Karol-Stelmaczonek and viktar-dzmitryieu-tao and removed request for a team January 22, 2025 13:34
@bartlomiejmarszal bartlomiejmarszal force-pushed the fix/ADF-1857/ResourceDeleted-resourceType branch from ceab7ac to cb37f46 Compare January 22, 2025 13:39
Copy link
Contributor

@Karol-Stelmaczonek Karol-Stelmaczonek left a comment

Choose a reason for hiding this comment

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

  • New code is covered by tests (if applicable)
  • Tests are running successfully (old and new ones) on my local machine (if applicable)
  • New code is respecting code style rules
  • New code is respecting best practices
  • New code is not subject to concurrency issues (if applicable)
  • Feature is working correctly on my local machine (if applicable)
  • Acceptance criteria are respected
  • Pull request title and description are meaningful

@tikhanovichA
Copy link
Contributor

Unit tests please

Copy link
Contributor

@tikhanovichA tikhanovichA left a comment

Choose a reason for hiding this comment

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

Review Checklist

  • New code is covered by tests (if applicable)
  • Tests are running successfully (old and new ones) on my local machine (if applicable)
  • New code is respecting code style rules
  • New code is respecting best practices
  • New code is not subject to concurrency issues (if applicable)
  • Feature is working correctly on my local machine (if applicable)
  • Acceptance criteria are respected
  • Pull request title and description are meaningful
  • Pull request's target is not master
  • Commits are following conventional commits
  • Commits messages are meaningful
  • Commits are atomic
  • Changelog is updated according to changes (if applicable)
  • Documentation is updated according to changes (if applicable)

@tikhanovichA
Copy link
Contributor

@bartlomiejmarszal could you please check unit tests?

Copy link

Version

Target Version 16.1.0
Last version 16.0.2

There are 0 BREAKING CHANGE, 1 feature, 4 fixes

@bartlomiejmarszal bartlomiejmarszal merged commit 3908eae into develop Feb 17, 2025
5 checks passed
@bartlomiejmarszal bartlomiejmarszal deleted the fix/ADF-1857/ResourceDeleted-resourceType branch February 17, 2025 11:58
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.

4 participants