Skip to content

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

Open
@mikesparr

Description

@mikesparr

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions