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

Create a Revision When Document data Changes #399

Open
5 tasks
DennisAlund opened this issue Jul 26, 2024 · 1 comment
Open
5 tasks

Create a Revision When Document data Changes #399

DennisAlund opened this issue Jul 26, 2024 · 1 comment
Assignees
Labels
platform:backend Backend / cloud functions priority:low 🏖️ Low priority issue type:enhancement 😃 New feature or request

Comments

@DennisAlund
Copy link
Member

DennisAlund commented Jul 26, 2024

Description:

Implement a system to create a revision every time the data object in a document changes. The revisions will be stored in a sub-collection, providing a clear history of changes and aiding in tracking and auditing document modifications.

Objectives:

  • Revision Path:

    • Store revisions at the path tanam-documents/{docId}/revisions/{id}.
  • Timestamp:

    • Include a createdAt timestamp to record when the revision was created.
  • Revision Counter:

    • Maintain an ever-incrementing counter for the revision number, derived from the parent document's current revision number incremented by one.
  • Data Field:

    • Store the document's data in a field called data.
  • Read-Only Access:

    • Ensure the revision documents are read-only for all users.

Benefits:

  • Provides a clear history of document changes.
  • Enhances tracking and auditing capabilities.
  • Ensures data integrity and security by maintaining read-only revisions.

Acceptance Criteria:

  • Revisions are stored at the path tanam-documents/{docId}/data/revision/{id}.
  • Each revision contains a createdAt timestamp.
  • Each revision includes an ever-incrementing revision number.
  • The document's data is stored in a field called data.
  • Revision documents are read-only for all users.

Notes:

  • Ensure robust error handling and logging during the revision creation process.
  • Thoroughly test the revision system to confirm consistency and reliability.
  • Update documentation to reflect the new revision system and handling processes.
@DennisAlund DennisAlund added type:enhancement 😃 New feature or request priority:low 🏖️ Low priority issue platform:backend Backend / cloud functions labels Jul 26, 2024
@DennisAlund DennisAlund added this to the Revision management milestone Jul 26, 2024
@DennisAlund DennisAlund self-assigned this Jul 26, 2024
@DennisAlund DennisAlund changed the title Title: Create a Revision When Document data Changes Create a Revision When Document data Changes Jul 26, 2024
@DennisAlund DennisAlund moved this to Ready in Tanam Jul 26, 2024
@DennisAlund
Copy link
Member Author

Need to consider more complicated scenarios such as when embedded images are changing etc and handle it with revisions for cloud storage also. Put on ice for now 🧊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:backend Backend / cloud functions priority:low 🏖️ Low priority issue type:enhancement 😃 New feature or request
Projects
Status: Ready
Development

No branches or pull requests

1 participant