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 flexible document store with history to track field changes #53

Open
mikesparr opened this issue Feb 20, 2019 · 0 comments
Open

Add flexible document store with history to track field changes #53

mikesparr opened this issue Feb 20, 2019 · 0 comments
Assignees

Comments

@mikesparr
Copy link
Owner

mikesparr commented Feb 20, 2019

Many organizations centralize around one or more types of document, or data, but need the ability to monitor edits on a field-by-field basis. Similar to a CRM with customizable contacts, we should include a mechanism for storing documents of multiple types and tracking their changes.

Proposed schema

  • id uuid
  • type string (use ObjectType enum to validate type)
  • properties: {[key: string]: {[key: string]: any} }
    • value any
    • history: Array<{[key: string]: any}> (todo: define PropertyHistory and Property interfaces)
      • oldValue: any
      • newValue: any
      • editor: string
      • timestamp: number (UTC unix time with millis)
  • published: string (ISO-8601)
  • updated: string (ISO-8601)
  • enabled: boolean
  • sort: integer

TODO: consider group and user ownership (use graph or just FK columns within: KISS)

Other consideration

  • need a Schema entity store to validate dynamic node types
    • use the same structure as DTOs if possible and leverage class-validator
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

No branches or pull requests

1 participant