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
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
uuidstring(useObjectTypeenum to validate type){[key: string]: {[key: string]: any} }anyArray<{[key: string]: any}>(todo: define PropertyHistory and Property interfaces)anyanystringnumber(UTC unix time with millis)string(ISO-8601)string(ISO-8601)booleanintegerTODO: consider group and user ownership (use graph or just FK columns within: KISS)
Other consideration
Schemaentity store to validate dynamic node typesclass-validator