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

Soft Delete #39

Open
tsutomi opened this issue Oct 1, 2024 · 0 comments
Open

Soft Delete #39

tsutomi opened this issue Oct 1, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@tsutomi
Copy link
Member

tsutomi commented Oct 1, 2024

Add support for soft-deleting entities in repositories so that they can be preserved after the deletion command is issued.

Proposed Solution

  • Provide the contract ISoftDeletable, that entities will implement to notify the repositories the function is active for the entity repository
  • When issuing a Remove command to the repository, if the entity is of type ISoftDeletable, update its state without removing it from the underlying data storage
  • When querying the entities of type ISoftDeletable, an additional filter should be applied to exclude the instances that were soft-deleted
  • Provide an interface to bypass the soft-delete state, and return even the entities that are marked as deleted (e.g. to run hard-delete processes)

Open Questions

  • By design, entities might have statuses - should we provide a contract to access those statuses?
  • If we have a status property of the entity, how can we determine which is the Deleted (or Soft-Deleted) status in the domain context of the entity?
@tsutomi tsutomi added the enhancement New feature or request label Oct 1, 2024
@tsutomi tsutomi self-assigned this Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant