This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Aggregate module

The Aggregate module in Vertex

This is a description of the Aggregate module

1 - Aggregate Domain

This page presents the ERD for each AggregateRoot, grouping related entities into domain boundaries. Each AggregateRoot enforces business rules, processes commands synchronously, and defines consistency borders within a single transactional scope. An indicative json schema is created to how the export of a aggregate root will approximitly look like

Ingestion Batch

Aggregate Root: IngestionBatch

Represents batches of data ingestion with work items, parts, and tree mutation entries for data processing.

erDiagram
    "Aggregate.AggregationWorkItems" {
        uniqueidentifier Id PK
        uniqueidentifier IngestionBatchId FK
        int Status 
        nvarchar StatusReason 
        uniqueidentifier TargetTreeNodeId 
        nvarchar SerializedAggregationInputTreeNodesDataContainer 
        int Partition 
        bigint Offset 
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
        uniqueidentifier TimeSeriesId 
    }

    "Aggregate.IngestionBatches" {
        uniqueidentifier Id PK
        nvarchar ExternalReference 
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
        int ExpectedNumberOfWorkItemsInBatch 
        int Status 
        nvarchar StatusReason 
        int BatchType 
        int InitiatorType 
        uniqueidentifier InitiatorId 
        uniqueidentifier TreeId FK
    }

    "Aggregate.IngestionWorkItemParts" {
        uniqueidentifier Id PK
        uniqueidentifier IngestionWorkItemId FK
        uniqueidentifier TargetNodeId FK
        int StartMoment 
        int EndMoment 
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
        uniqueidentifier TimeSeriesId 
        int Status 
        nvarchar StatusReason 
        bigint Offset 
        int Partition 
    }

    "Aggregate.IngestionWorkItems" {
        uniqueidentifier Id PK
        uniqueidentifier IngestionBatchId FK
        uniqueidentifier IngestionTriggerId FK
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
        int Status 
        nvarchar StatusReason 
    }

    "Aggregate.TreeMutationEntries" {
        uniqueidentifier Id PK
        uniqueidentifier IngestionBatchId FK
        uniqueidentifier TargetedNodeId 
        int TreeMutationType 
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
        int DataType 
        int NodeType 
        int Status 
        nvarchar StatusReason 
        uniqueidentifier LinkedEntityId 
        int LinkedEntityType 
    }

    "Aggregate.TreeMutationEntryMetadatas" {
        uniqueidentifier Id PK
        uniqueidentifier TreeMutationEntryId FK
        nvarchar Key 
        nvarchar Value 
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
    }

    "Aggregate.TreeMutationMemberships" {
        uniqueidentifier Id PK
        uniqueidentifier TreeMutationEntryId FK
        uniqueidentifier TreeId FK
        uniqueidentifier ParentTreeMutationEntryId FK
        datetimeoffset Start 
        datetimeoffset End 
        datetimeoffset EffectuationMoment 
        int Status 
        nvarchar StatusReason 
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
    }

    "Aggregate.AggregationWorkItems" }o--|| "Aggregate.IngestionBatches" : "IngestionBatchId"
    "Aggregate.TreeMutationEntries" }o--|| "Aggregate.IngestionBatches" : "IngestionBatchId"
    "Aggregate.IngestionBatches" }o--|| "Aggregate.Trees" : "TreeId"
    "Aggregate.IngestionWorkItems" }o--|| "Aggregate.IngestionBatches" : "IngestionBatchId"
    "Aggregate.IngestionWorkItemParts" }o--|| "Aggregate.TreeNodes" : "TargetNodeId"
    "Aggregate.IngestionWorkItemParts" }o--|| "Aggregate.IngestionWorkItems" : "IngestionWorkItemId"
    "Aggregate.IngestionWorkItems" }o--|| "Aggregate.IngestionTriggers" : "IngestionTriggerId"
    "Aggregate.TreeMutationEntryMetadatas" }o--|| "Aggregate.TreeMutationEntries" : "TreeMutationEntryId"
    "Aggregate.TreeMutationMemberships" }o--|| "Aggregate.TreeMutationEntries" : "ParentTreeMutationEntryId"
    "Aggregate.TreeMutationMemberships" }o--|| "Aggregate.TreeMutationEntries" : "TreeMutationEntryId"
    "Aggregate.TreeMutationMemberships" }o--|| "Aggregate.Trees" : "TreeId"
erDiagram
    "Aggregate.AggregationWorkItems" {
        uniqueidentifier Id PK
        uniqueidentifier IngestionBatchId FK
        int Status 
        nvarchar StatusReason 
        uniqueidentifier TargetTreeNodeId 
        nvarchar SerializedAggregationInputTreeNodesDataContainer 
        int Partition 
        bigint Offset 
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
        uniqueidentifier TimeSeriesId 
    }

    "Aggregate.IngestionBatches" {
        uniqueidentifier Id PK
        nvarchar ExternalReference 
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
        int ExpectedNumberOfWorkItemsInBatch 
        int Status 
        nvarchar StatusReason 
        int BatchType 
        int InitiatorType 
        uniqueidentifier InitiatorId 
        uniqueidentifier TreeId FK
    }

    "Aggregate.IngestionWorkItemParts" {
        uniqueidentifier Id PK
        uniqueidentifier IngestionWorkItemId FK
        uniqueidentifier TargetNodeId FK
        int StartMoment 
        int EndMoment 
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
        uniqueidentifier TimeSeriesId 
        int Status 
        nvarchar StatusReason 
        bigint Offset 
        int Partition 
    }

    "Aggregate.IngestionWorkItems" {
        uniqueidentifier Id PK
        uniqueidentifier IngestionBatchId FK
        uniqueidentifier IngestionTriggerId FK
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
        int Status 
        nvarchar StatusReason 
    }

    "Aggregate.TreeMutationEntries" {
        uniqueidentifier Id PK
        uniqueidentifier IngestionBatchId FK
        uniqueidentifier TargetedNodeId 
        int TreeMutationType 
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
        int DataType 
        int NodeType 
        int Status 
        nvarchar StatusReason 
        uniqueidentifier LinkedEntityId 
        int LinkedEntityType 
    }

    "Aggregate.TreeMutationEntryMetadatas" {
        uniqueidentifier Id PK
        uniqueidentifier TreeMutationEntryId FK
        nvarchar Key 
        nvarchar Value 
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
    }

    "Aggregate.TreeMutationMemberships" {
        uniqueidentifier Id PK
        uniqueidentifier TreeMutationEntryId FK
        uniqueidentifier TreeId FK
        uniqueidentifier ParentTreeMutationEntryId FK
        datetimeoffset Start 
        datetimeoffset End 
        datetimeoffset EffectuationMoment 
        int Status 
        nvarchar StatusReason 
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
    }

    "Aggregate.AggregationWorkItems" }o--|| "Aggregate.IngestionBatches" : "IngestionBatchId"
    "Aggregate.TreeMutationEntries" }o--|| "Aggregate.IngestionBatches" : "IngestionBatchId"
    "Aggregate.IngestionBatches" }o--|| "Aggregate.Trees" : "TreeId"
    "Aggregate.IngestionWorkItems" }o--|| "Aggregate.IngestionBatches" : "IngestionBatchId"
    "Aggregate.IngestionWorkItemParts" }o--|| "Aggregate.TreeNodes" : "TargetNodeId"
    "Aggregate.IngestionWorkItemParts" }o--|| "Aggregate.IngestionWorkItems" : "IngestionWorkItemId"
    "Aggregate.IngestionWorkItems" }o--|| "Aggregate.IngestionTriggers" : "IngestionTriggerId"
    "Aggregate.TreeMutationEntryMetadatas" }o--|| "Aggregate.TreeMutationEntries" : "TreeMutationEntryId"
    "Aggregate.TreeMutationMemberships" }o--|| "Aggregate.TreeMutationEntries" : "ParentTreeMutationEntryId"
    "Aggregate.TreeMutationMemberships" }o--|| "Aggregate.TreeMutationEntries" : "TreeMutationEntryId"
    "Aggregate.TreeMutationMemberships" }o--|| "Aggregate.Trees" : "TreeId"
{
    "definitions":  {
                        "Aggregate.TreeMutationMemberships":  {
                                                                  "properties":  {
                                                                                     "End":  {
                                                                                                 "format":  "date-time",
                                                                                                 "description":  "datetimeoffset",
                                                                                                 "type":  "string"
                                                                                             },
                                                                                     "Id":  {
                                                                                                "format":  "uuid",
                                                                                                "description":  "uniqueidentifier",
                                                                                                "type":  "string"
                                                                                            },
                                                                                     "EntityUpdatedAuthToken":  {
                                                                                                                    "format":  "uuid",
                                                                                                                    "description":  "uniqueidentifier",
                                                                                                                    "type":  "string"
                                                                                                                },
                                                                                     "Concealed":  {
                                                                                                       "type":  "boolean",
                                                                                                       "description":  "bit"
                                                                                                   },
                                                                                     "Tenant":  {
                                                                                                    "format":  "uuid",
                                                                                                    "description":  "uniqueidentifier",
                                                                                                    "type":  "string"
                                                                                                },
                                                                                     "EntityCreatedAuthToken":  {
                                                                                                                    "format":  "uuid",
                                                                                                                    "description":  "uniqueidentifier",
                                                                                                                    "type":  "string"
                                                                                                                },
                                                                                     "EffectuationMoment":  {
                                                                                                                "format":  "date-time",
                                                                                                                "description":  "datetimeoffset",
                                                                                                                "type":  "string"
                                                                                                            },
                                                                                     "StatusReason":  {
                                                                                                          "type":  "string",
                                                                                                          "description":  "nvarchar"
                                                                                                      },
                                                                                     "Start":  {
                                                                                                   "format":  "date-time",
                                                                                                   "description":  "datetimeoffset",
                                                                                                   "type":  "string"
                                                                                               },
                                                                                     "EntityUpdatedDateTime":  {
                                                                                                                   "format":  "date-time",
                                                                                                                   "description":  "datetimeoffset",
                                                                                                                   "type":  "string"
                                                                                                               },
                                                                                     "TreeMutationEntryId":  {
                                                                                                                 "type":  "string",
                                                                                                                 "description":  "FK to Aggregate.TreeMutationEntries"
                                                                                                             },
                                                                                     "TreeId":  {
                                                                                                    "type":  "string",
                                                                                                    "description":  "FK to Aggregate.Trees"
                                                                                                },
                                                                                     "Status":  {
                                                                                                    "type":  "integer",
                                                                                                    "description":  "int"
                                                                                                },
                                                                                     "EntityCreatedDateTime":  {
                                                                                                                   "format":  "date-time",
                                                                                                                   "description":  "datetimeoffset",
                                                                                                                   "type":  "string"
                                                                                                               },
                                                                                     "ParentTreeMutationEntryId":  {
                                                                                                                       "type":  "string",
                                                                                                                       "description":  "FK to Aggregate.TreeMutationEntries"
                                                                                                                   }
                                                                                 },
                                                                  "type":  "object"
                                                              },
                        "Aggregate.TreeMutationEntryMetadatas":  {
                                                                     "properties":  {
                                                                                        "Concealed":  {
                                                                                                          "type":  "boolean",
                                                                                                          "description":  "bit"
                                                                                                      },
                                                                                        "EntityUpdatedAuthToken":  {
                                                                                                                       "format":  "uuid",
                                                                                                                       "description":  "uniqueidentifier",
                                                                                                                       "type":  "string"
                                                                                                                   },
                                                                                        "Id":  {
                                                                                                   "format":  "uuid",
                                                                                                   "description":  "uniqueidentifier",
                                                                                                   "type":  "string"
                                                                                               },
                                                                                        "Key":  {
                                                                                                    "type":  "string",
                                                                                                    "description":  "nvarchar"
                                                                                                },
                                                                                        "EntityCreatedAuthToken":  {
                                                                                                                       "format":  "uuid",
                                                                                                                       "description":  "uniqueidentifier",
                                                                                                                       "type":  "string"
                                                                                                                   },
                                                                                        "Value":  {
                                                                                                      "type":  "string",
                                                                                                      "description":  "nvarchar"
                                                                                                  },
                                                                                        "EntityUpdatedDateTime":  {
                                                                                                                      "format":  "date-time",
                                                                                                                      "description":  "datetimeoffset",
                                                                                                                      "type":  "string"
                                                                                                                  },
                                                                                        "TreeMutationEntryId":  {
                                                                                                                    "type":  "string",
                                                                                                                    "description":  "FK to Aggregate.TreeMutationEntries"
                                                                                                                },
                                                                                        "EntityCreatedDateTime":  {
                                                                                                                      "format":  "date-time",
                                                                                                                      "description":  "datetimeoffset",
                                                                                                                      "type":  "string"
                                                                                                                  },
                                                                                        "Tenant":  {
                                                                                                       "format":  "uuid",
                                                                                                       "description":  "uniqueidentifier",
                                                                                                       "type":  "string"
                                                                                                   }
                                                                                    },
                                                                     "type":  "object"
                                                                 },
                        "Aggregate.IngestionBatches":  {
                                                           "properties":  {
                                                                              "BatchType":  {
                                                                                                "type":  "integer",
                                                                                                "description":  "int"
                                                                                            },
                                                                              "EntityUpdatedAuthToken":  {
                                                                                                             "format":  "uuid",
                                                                                                             "description":  "uniqueidentifier",
                                                                                                             "type":  "string"
                                                                                                         },
                                                                              "Concealed":  {
                                                                                                "type":  "boolean",
                                                                                                "description":  "bit"
                                                                                            },
                                                                              "InitiatorId":  {
                                                                                                  "format":  "uuid",
                                                                                                  "description":  "uniqueidentifier",
                                                                                                  "type":  "string"
                                                                                              },
                                                                              "EntityCreatedAuthToken":  {
                                                                                                             "format":  "uuid",
                                                                                                             "description":  "uniqueidentifier",
                                                                                                             "type":  "string"
                                                                                                         },
                                                                              "StatusReason":  {
                                                                                                   "type":  "string",
                                                                                                   "description":  "nvarchar"
                                                                                               },
                                                                              "ExpectedNumberOfWorkItemsInBatch":  {
                                                                                                                       "type":  "integer",
                                                                                                                       "description":  "int"
                                                                                                                   },
                                                                              "EntityUpdatedDateTime":  {
                                                                                                            "format":  "date-time",
                                                                                                            "description":  "datetimeoffset",
                                                                                                            "type":  "string"
                                                                                                        },
                                                                              "Tenant":  {
                                                                                             "format":  "uuid",
                                                                                             "description":  "uniqueidentifier",
                                                                                             "type":  "string"
                                                                                         },
                                                                              "TreeId":  {
                                                                                             "type":  "string",
                                                                                             "description":  "FK to Aggregate.Trees"
                                                                                         },
                                                                              "ExternalReference":  {
                                                                                                        "type":  "string",
                                                                                                        "description":  "nvarchar"
                                                                                                    },
                                                                              "InitiatorType":  {
                                                                                                    "type":  "integer",
                                                                                                    "description":  "int"
                                                                                                },
                                                                              "Id":  {
                                                                                         "format":  "uuid",
                                                                                         "description":  "uniqueidentifier",
                                                                                         "type":  "string"
                                                                                     },
                                                                              "Status":  {
                                                                                             "type":  "integer",
                                                                                             "description":  "int"
                                                                                         },
                                                                              "EntityCreatedDateTime":  {
                                                                                                            "format":  "date-time",
                                                                                                            "description":  "datetimeoffset",
                                                                                                            "type":  "string"
                                                                                                        }
                                                                          },
                                                           "type":  "object"
                                                       },
                        "Aggregate.AggregationWorkItems":  {
                                                               "properties":  {
                                                                                  "Id":  {
                                                                                             "format":  "uuid",
                                                                                             "description":  "uniqueidentifier",
                                                                                             "type":  "string"
                                                                                         },
                                                                                  "EntityUpdatedAuthToken":  {
                                                                                                                 "format":  "uuid",
                                                                                                                 "description":  "uniqueidentifier",
                                                                                                                 "type":  "string"
                                                                                                             },
                                                                                  "Concealed":  {
                                                                                                    "type":  "boolean",
                                                                                                    "description":  "bit"
                                                                                                },
                                                                                  "StatusReason":  {
                                                                                                       "type":  "string",
                                                                                                       "description":  "nvarchar"
                                                                                                   },
                                                                                  "SerializedAggregationInputTreeNodesDataContainer":  {
                                                                                                                                           "type":  "string",
                                                                                                                                           "description":  "nvarchar"
                                                                                                                                       },
                                                                                  "EntityCreatedAuthToken":  {
                                                                                                                 "format":  "uuid",
                                                                                                                 "description":  "uniqueidentifier",
                                                                                                                 "type":  "string"
                                                                                                             },
                                                                                  "TargetTreeNodeId":  {
                                                                                                           "format":  "uuid",
                                                                                                           "description":  "uniqueidentifier",
                                                                                                           "type":  "string"
                                                                                                       },
                                                                                  "TimeSeriesId":  {
                                                                                                       "format":  "uuid",
                                                                                                       "description":  "uniqueidentifier",
                                                                                                       "type":  "string"
                                                                                                   },
                                                                                  "EntityUpdatedDateTime":  {
                                                                                                                "format":  "date-time",
                                                                                                                "description":  "datetimeoffset",
                                                                                                                "type":  "string"
                                                                                                            },
                                                                                  "Offset":  {
                                                                                                 "type":  "string",
                                                                                                 "description":  "bigint"
                                                                                             },
                                                                                  "IngestionBatchId":  {
                                                                                                           "type":  "string",
                                                                                                           "description":  "FK to Aggregate.IngestionBatches"
                                                                                                       },
                                                                                  "Tenant":  {
                                                                                                 "format":  "uuid",
                                                                                                 "description":  "uniqueidentifier",
                                                                                                 "type":  "string"
                                                                                             },
                                                                                  "Partition":  {
                                                                                                    "type":  "integer",
                                                                                                    "description":  "int"
                                                                                                },
                                                                                  "Status":  {
                                                                                                 "type":  "integer",
                                                                                                 "description":  "int"
                                                                                             },
                                                                                  "EntityCreatedDateTime":  {
                                                                                                                "format":  "date-time",
                                                                                                                "description":  "datetimeoffset",
                                                                                                                "type":  "string"
                                                                                                            }
                                                                              },
                                                               "type":  "object"
                                                           },
                        "Aggregate.IngestionWorkItems":  {
                                                             "properties":  {
                                                                                "Concealed":  {
                                                                                                  "type":  "boolean",
                                                                                                  "description":  "bit"
                                                                                              },
                                                                                "IngestionBatchId":  {
                                                                                                         "type":  "string",
                                                                                                         "description":  "FK to Aggregate.IngestionBatches"
                                                                                                     },
                                                                                "Id":  {
                                                                                           "format":  "uuid",
                                                                                           "description":  "uniqueidentifier",
                                                                                           "type":  "string"
                                                                                       },
                                                                                "StatusReason":  {
                                                                                                     "type":  "string",
                                                                                                     "description":  "nvarchar"
                                                                                                 },
                                                                                "EntityUpdatedAuthToken":  {
                                                                                                               "format":  "uuid",
                                                                                                               "description":  "uniqueidentifier",
                                                                                                               "type":  "string"
                                                                                                           },
                                                                                "EntityCreatedDateTime":  {
                                                                                                              "format":  "date-time",
                                                                                                              "description":  "datetimeoffset",
                                                                                                              "type":  "string"
                                                                                                          },
                                                                                "EntityUpdatedDateTime":  {
                                                                                                              "format":  "date-time",
                                                                                                              "description":  "datetimeoffset",
                                                                                                              "type":  "string"
                                                                                                          },
                                                                                "IngestionTriggerId":  {
                                                                                                           "type":  "string",
                                                                                                           "description":  "FK to Aggregate.IngestionTriggers"
                                                                                                       },
                                                                                "Status":  {
                                                                                               "type":  "integer",
                                                                                               "description":  "int"
                                                                                           },
                                                                                "EntityCreatedAuthToken":  {
                                                                                                               "format":  "uuid",
                                                                                                               "description":  "uniqueidentifier",
                                                                                                               "type":  "string"
                                                                                                           },
                                                                                "Tenant":  {
                                                                                               "format":  "uuid",
                                                                                               "description":  "uniqueidentifier",
                                                                                               "type":  "string"
                                                                                           }
                                                                            },
                                                             "type":  "object"
                                                         },
                        "Aggregate.IngestionWorkItemParts":  {
                                                                 "properties":  {
                                                                                    "Id":  {
                                                                                               "format":  "uuid",
                                                                                               "description":  "uniqueidentifier",
                                                                                               "type":  "string"
                                                                                           },
                                                                                    "EntityUpdatedAuthToken":  {
                                                                                                                   "format":  "uuid",
                                                                                                                   "description":  "uniqueidentifier",
                                                                                                                   "type":  "string"
                                                                                                               },
                                                                                    "Concealed":  {
                                                                                                      "type":  "boolean",
                                                                                                      "description":  "bit"
                                                                                                  },
                                                                                    "EntityCreatedAuthToken":  {
                                                                                                                   "format":  "uuid",
                                                                                                                   "description":  "uniqueidentifier",
                                                                                                                   "type":  "string"
                                                                                                               },
                                                                                    "StatusReason":  {
                                                                                                         "type":  "string",
                                                                                                         "description":  "nvarchar"
                                                                                                     },
                                                                                    "IngestionWorkItemId":  {
                                                                                                                "type":  "string",
                                                                                                                "description":  "FK to Aggregate.IngestionWorkItems"
                                                                                                            },
                                                                                    "TimeSeriesId":  {
                                                                                                         "format":  "uuid",
                                                                                                         "description":  "uniqueidentifier",
                                                                                                         "type":  "string"
                                                                                                     },
                                                                                    "EntityUpdatedDateTime":  {
                                                                                                                  "format":  "date-time",
                                                                                                                  "description":  "datetimeoffset",
                                                                                                                  "type":  "string"
                                                                                                              },
                                                                                    "EndMoment":  {
                                                                                                      "type":  "integer",
                                                                                                      "description":  "int"
                                                                                                  },
                                                                                    "Tenant":  {
                                                                                                   "format":  "uuid",
                                                                                                   "description":  "uniqueidentifier",
                                                                                                   "type":  "string"
                                                                                               },
                                                                                    "Offset":  {
                                                                                                   "type":  "string",
                                                                                                   "description":  "bigint"
                                                                                               },
                                                                                    "Partition":  {
                                                                                                      "type":  "integer",
                                                                                                      "description":  "int"
                                                                                                  },
                                                                                    "StartMoment":  {
                                                                                                        "type":  "integer",
                                                                                                        "description":  "int"
                                                                                                    },
                                                                                    "EntityCreatedDateTime":  {
                                                                                                                  "format":  "date-time",
                                                                                                                  "description":  "datetimeoffset",
                                                                                                                  "type":  "string"
                                                                                                              },
                                                                                    "TargetNodeId":  {
                                                                                                         "type":  "string",
                                                                                                         "description":  "FK to Aggregate.TreeNodes"
                                                                                                     },
                                                                                    "Status":  {
                                                                                                   "type":  "integer",
                                                                                                   "description":  "int"
                                                                                               }
                                                                                },
                                                                 "type":  "object"
                                                             },
                        "Aggregate.TreeMutationEntries":  {
                                                              "properties":  {
                                                                                 "Id":  {
                                                                                            "format":  "uuid",
                                                                                            "description":  "uniqueidentifier",
                                                                                            "type":  "string"
                                                                                        },
                                                                                 "TargetedNodeId":  {
                                                                                                        "format":  "uuid",
                                                                                                        "description":  "uniqueidentifier",
                                                                                                        "type":  "string"
                                                                                                    },
                                                                                 "EntityUpdatedAuthToken":  {
                                                                                                                "format":  "uuid",
                                                                                                                "description":  "uniqueidentifier",
                                                                                                                "type":  "string"
                                                                                                            },
                                                                                 "Concealed":  {
                                                                                                   "type":  "boolean",
                                                                                                   "description":  "bit"
                                                                                               },
                                                                                 "LinkedEntityType":  {
                                                                                                          "type":  "integer",
                                                                                                          "description":  "int"
                                                                                                      },
                                                                                 "EntityCreatedAuthToken":  {
                                                                                                                "format":  "uuid",
                                                                                                                "description":  "uniqueidentifier",
                                                                                                                "type":  "string"
                                                                                                            },
                                                                                 "StatusReason":  {
                                                                                                      "type":  "string",
                                                                                                      "description":  "nvarchar"
                                                                                                  },
                                                                                 "EntityUpdatedDateTime":  {
                                                                                                               "format":  "date-time",
                                                                                                               "description":  "datetimeoffset",
                                                                                                               "type":  "string"
                                                                                                           },
                                                                                 "IngestionBatchId":  {
                                                                                                          "type":  "string",
                                                                                                          "description":  "FK to Aggregate.IngestionBatches"
                                                                                                      },
                                                                                 "DataType":  {
                                                                                                  "type":  "integer",
                                                                                                  "description":  "int"
                                                                                              },
                                                                                 "Tenant":  {
                                                                                                "format":  "uuid",
                                                                                                "description":  "uniqueidentifier",
                                                                                                "type":  "string"
                                                                                            },
                                                                                 "LinkedEntityId":  {
                                                                                                        "format":  "uuid",
                                                                                                        "description":  "uniqueidentifier",
                                                                                                        "type":  "string"
                                                                                                    },
                                                                                 "TreeMutationType":  {
                                                                                                          "type":  "integer",
                                                                                                          "description":  "int"
                                                                                                      },
                                                                                 "NodeType":  {
                                                                                                  "type":  "integer",
                                                                                                  "description":  "int"
                                                                                              },
                                                                                 "Status":  {
                                                                                                "type":  "integer",
                                                                                                "description":  "int"
                                                                                            },
                                                                                 "EntityCreatedDateTime":  {
                                                                                                               "format":  "date-time",
                                                                                                               "description":  "datetimeoffset",
                                                                                                               "type":  "string"
                                                                                                           }
                                                                             },
                                                              "type":  "object"
                                                          }
                    },
    "title":  "Aggregate.IngestionBatch",
    "$comment":  "Generated from Mermaid ERD with property-level descriptions",
    "$schema":  "http://json-schema.org/draft-07/schema#",
    "type":  "object"
}

Ingestion Trigger

Aggregate Root: IngestionTrigger

Represents triggers for data ingestion with their associated key values for configuration and control.

erDiagram
    "Aggregate.IngestionTriggerKeyValues" {
        uniqueidentifier Id PK
        uniqueidentifier IngestionTriggerId FK
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
        nvarchar Key 
        nvarchar Value 
    }

    "Aggregate.IngestionTriggers" {
        uniqueidentifier Id PK
        nvarchar ExternalReference 
        datetimeoffset CreatedDateTime 
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
        datetimeoffset DataEnd 
        datetimeoffset DataExpiration 
        datetimeoffset DataStart 
        uniqueidentifier IngestionBatchId 
    }

    "Aggregate.IngestionTriggerKeyValues" }o--|| "Aggregate.IngestionTriggers" : "IngestionTriggerId"
    "Aggregate.IngestionWorkItems" }o--|| "Aggregate.IngestionTriggers" : "IngestionTriggerId"
erDiagram
    "Aggregate.IngestionTriggerKeyValues" {
        uniqueidentifier Id PK
        uniqueidentifier IngestionTriggerId FK
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
        nvarchar Key 
        nvarchar Value 
    }

    "Aggregate.IngestionTriggers" {
        uniqueidentifier Id PK
        nvarchar ExternalReference 
        datetimeoffset CreatedDateTime 
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
        datetimeoffset DataEnd 
        datetimeoffset DataExpiration 
        datetimeoffset DataStart 
        uniqueidentifier IngestionBatchId 
    }

    "Aggregate.IngestionTriggerKeyValues" }o--|| "Aggregate.IngestionTriggers" : "IngestionTriggerId"
    "Aggregate.IngestionWorkItems" }o--|| "Aggregate.IngestionTriggers" : "IngestionTriggerId"
{
    "definitions":  {
                        "Aggregate.IngestionTriggerKeyValues":  {
                                                                    "properties":  {
                                                                                       "Concealed":  {
                                                                                                         "type":  "boolean",
                                                                                                         "description":  "bit"
                                                                                                     },
                                                                                       "EntityUpdatedAuthToken":  {
                                                                                                                      "format":  "uuid",
                                                                                                                      "description":  "uniqueidentifier",
                                                                                                                      "type":  "string"
                                                                                                                  },
                                                                                       "Id":  {
                                                                                                  "format":  "uuid",
                                                                                                  "description":  "uniqueidentifier",
                                                                                                  "type":  "string"
                                                                                              },
                                                                                       "Key":  {
                                                                                                   "type":  "string",
                                                                                                   "description":  "nvarchar"
                                                                                               },
                                                                                       "Value":  {
                                                                                                     "type":  "string",
                                                                                                     "description":  "nvarchar"
                                                                                                 },
                                                                                       "EntityCreatedDateTime":  {
                                                                                                                     "format":  "date-time",
                                                                                                                     "description":  "datetimeoffset",
                                                                                                                     "type":  "string"
                                                                                                                 },
                                                                                       "EntityUpdatedDateTime":  {
                                                                                                                     "format":  "date-time",
                                                                                                                     "description":  "datetimeoffset",
                                                                                                                     "type":  "string"
                                                                                                                 },
                                                                                       "IngestionTriggerId":  {
                                                                                                                  "type":  "string",
                                                                                                                  "description":  "FK to Aggregate.IngestionTriggers"
                                                                                                              },
                                                                                       "EntityCreatedAuthToken":  {
                                                                                                                      "format":  "uuid",
                                                                                                                      "description":  "uniqueidentifier",
                                                                                                                      "type":  "string"
                                                                                                                  },
                                                                                       "Tenant":  {
                                                                                                      "format":  "uuid",
                                                                                                      "description":  "uniqueidentifier",
                                                                                                      "type":  "string"
                                                                                                  }
                                                                                   },
                                                                    "type":  "object"
                                                                },
                        "Aggregate.IngestionTriggers":  {
                                                            "properties":  {
                                                                               "Id":  {
                                                                                          "format":  "uuid",
                                                                                          "description":  "uniqueidentifier",
                                                                                          "type":  "string"
                                                                                      },
                                                                               "EntityUpdatedAuthToken":  {
                                                                                                              "format":  "uuid",
                                                                                                              "description":  "uniqueidentifier",
                                                                                                              "type":  "string"
                                                                                                          },
                                                                               "Concealed":  {
                                                                                                 "type":  "boolean",
                                                                                                 "description":  "bit"
                                                                                             },
                                                                               "EntityCreatedAuthToken":  {
                                                                                                              "format":  "uuid",
                                                                                                              "description":  "uniqueidentifier",
                                                                                                              "type":  "string"
                                                                                                          },
                                                                               "CreatedDateTime":  {
                                                                                                       "format":  "date-time",
                                                                                                       "description":  "datetimeoffset",
                                                                                                       "type":  "string"
                                                                                                   },
                                                                               "DataExpiration":  {
                                                                                                      "format":  "date-time",
                                                                                                      "description":  "datetimeoffset",
                                                                                                      "type":  "string"
                                                                                                  },
                                                                               "EntityUpdatedDateTime":  {
                                                                                                             "format":  "date-time",
                                                                                                             "description":  "datetimeoffset",
                                                                                                             "type":  "string"
                                                                                                         },
                                                                               "IngestionBatchId":  {
                                                                                                        "format":  "uuid",
                                                                                                        "description":  "uniqueidentifier",
                                                                                                        "type":  "string"
                                                                                                    },
                                                                               "ExternalReference":  {
                                                                                                         "type":  "string",
                                                                                                         "description":  "nvarchar"
                                                                                                     },
                                                                               "Tenant":  {
                                                                                              "format":  "uuid",
                                                                                              "description":  "uniqueidentifier",
                                                                                              "type":  "string"
                                                                                          },
                                                                               "DataEnd":  {
                                                                                               "format":  "date-time",
                                                                                               "description":  "datetimeoffset",
                                                                                               "type":  "string"
                                                                                           },
                                                                               "EntityCreatedDateTime":  {
                                                                                                             "format":  "date-time",
                                                                                                             "description":  "datetimeoffset",
                                                                                                             "type":  "string"
                                                                                                         },
                                                                               "DataStart":  {
                                                                                                 "format":  "date-time",
                                                                                                 "description":  "datetimeoffset",
                                                                                                 "type":  "string"
                                                                                             }
                                                                           },
                                                            "type":  "object"
                                                        }
                    },
    "title":  "Aggregate.IngestionTrigger",
    "$comment":  "Generated from Mermaid ERD with property-level descriptions",
    "$schema":  "http://json-schema.org/draft-07/schema#",
    "type":  "object"
}

Tree

Aggregate Root: Tree

Represents hierarchical tree structures for data organization and relationships.

erDiagram
    "Aggregate.TreeMemberships" {
        uniqueidentifier Id PK
        uniqueidentifier TreeId FK
        uniqueidentifier NodeId FK
        int LastCalculationMoment 
        int RecalculationRequest 
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
        datetimeoffset EffectuationMoment 
        datetimeoffset End 
        bit IsLatest 
        uniqueidentifier ParentTreeNodeId 
        datetimeoffset Start 
    }

    "Aggregate.Trees" {
        uniqueidentifier Id PK
        nvarchar Name 
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
    }

    "Aggregate.TreeMemberships" }o--|| "Aggregate.TreeNodes" : "NodeId"
    "Aggregate.TreeMemberships" }o--|| "Aggregate.Trees" : "TreeId"
    "Aggregate.TreeMutationMemberships" }o--|| "Aggregate.Trees" : "TreeId"
    "Aggregate.IngestionBatches" }o--|| "Aggregate.Trees" : "TreeId"
erDiagram
    "Aggregate.TreeMemberships" {
        uniqueidentifier Id PK
        uniqueidentifier TreeId FK
        uniqueidentifier NodeId FK
        int LastCalculationMoment 
        int RecalculationRequest 
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
        datetimeoffset EffectuationMoment 
        datetimeoffset End 
        bit IsLatest 
        uniqueidentifier ParentTreeNodeId 
        datetimeoffset Start 
    }

    "Aggregate.Trees" {
        uniqueidentifier Id PK
        nvarchar Name 
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
    }

    "Aggregate.TreeMemberships" }o--|| "Aggregate.TreeNodes" : "NodeId"
    "Aggregate.TreeMemberships" }o--|| "Aggregate.Trees" : "TreeId"
    "Aggregate.TreeMutationMemberships" }o--|| "Aggregate.Trees" : "TreeId"
    "Aggregate.IngestionBatches" }o--|| "Aggregate.Trees" : "TreeId"
{
    "definitions":  {
                        "Aggregate.TreeMemberships":  {
                                                          "properties":  {
                                                                             "End":  {
                                                                                         "format":  "date-time",
                                                                                         "description":  "datetimeoffset",
                                                                                         "type":  "string"
                                                                                     },
                                                                             "LastCalculationMoment":  {
                                                                                                           "type":  "integer",
                                                                                                           "description":  "int"
                                                                                                       },
                                                                             "EntityUpdatedAuthToken":  {
                                                                                                            "format":  "uuid",
                                                                                                            "description":  "uniqueidentifier",
                                                                                                            "type":  "string"
                                                                                                        },
                                                                             "Concealed":  {
                                                                                               "type":  "boolean",
                                                                                               "description":  "bit"
                                                                                           },
                                                                             "IsLatest":  {
                                                                                              "type":  "boolean",
                                                                                              "description":  "bit"
                                                                                          },
                                                                             "EntityCreatedAuthToken":  {
                                                                                                            "format":  "uuid",
                                                                                                            "description":  "uniqueidentifier",
                                                                                                            "type":  "string"
                                                                                                        },
                                                                             "EffectuationMoment":  {
                                                                                                        "format":  "date-time",
                                                                                                        "description":  "datetimeoffset",
                                                                                                        "type":  "string"
                                                                                                    },
                                                                             "Start":  {
                                                                                           "format":  "date-time",
                                                                                           "description":  "datetimeoffset",
                                                                                           "type":  "string"
                                                                                       },
                                                                             "NodeId":  {
                                                                                            "type":  "string",
                                                                                            "description":  "FK to Aggregate.TreeNodes"
                                                                                        },
                                                                             "EntityUpdatedDateTime":  {
                                                                                                           "format":  "date-time",
                                                                                                           "description":  "datetimeoffset",
                                                                                                           "type":  "string"
                                                                                                       },
                                                                             "RecalculationRequest":  {
                                                                                                          "type":  "integer",
                                                                                                          "description":  "int"
                                                                                                      },
                                                                             "Tenant":  {
                                                                                            "format":  "uuid",
                                                                                            "description":  "uniqueidentifier",
                                                                                            "type":  "string"
                                                                                        },
                                                                             "TreeId":  {
                                                                                            "type":  "string",
                                                                                            "description":  "FK to Aggregate.Trees"
                                                                                        },
                                                                             "Id":  {
                                                                                        "format":  "uuid",
                                                                                        "description":  "uniqueidentifier",
                                                                                        "type":  "string"
                                                                                    },
                                                                             "ParentTreeNodeId":  {
                                                                                                      "format":  "uuid",
                                                                                                      "description":  "uniqueidentifier",
                                                                                                      "type":  "string"
                                                                                                  },
                                                                             "EntityCreatedDateTime":  {
                                                                                                           "format":  "date-time",
                                                                                                           "description":  "datetimeoffset",
                                                                                                           "type":  "string"
                                                                                                       }
                                                                         },
                                                          "type":  "object"
                                                      },
                        "Aggregate.Trees":  {
                                                "properties":  {
                                                                   "Concealed":  {
                                                                                     "type":  "boolean",
                                                                                     "description":  "bit"
                                                                                 },
                                                                   "EntityUpdatedAuthToken":  {
                                                                                                  "format":  "uuid",
                                                                                                  "description":  "uniqueidentifier",
                                                                                                  "type":  "string"
                                                                                              },
                                                                   "Id":  {
                                                                              "format":  "uuid",
                                                                              "description":  "uniqueidentifier",
                                                                              "type":  "string"
                                                                          },
                                                                   "EntityCreatedDateTime":  {
                                                                                                 "format":  "date-time",
                                                                                                 "description":  "datetimeoffset",
                                                                                                 "type":  "string"
                                                                                             },
                                                                   "Name":  {
                                                                                "type":  "string",
                                                                                "description":  "nvarchar"
                                                                            },
                                                                   "EntityUpdatedDateTime":  {
                                                                                                 "format":  "date-time",
                                                                                                 "description":  "datetimeoffset",
                                                                                                 "type":  "string"
                                                                                             },
                                                                   "EntityCreatedAuthToken":  {
                                                                                                  "format":  "uuid",
                                                                                                  "description":  "uniqueidentifier",
                                                                                                  "type":  "string"
                                                                                              },
                                                                   "Tenant":  {
                                                                                  "format":  "uuid",
                                                                                  "description":  "uniqueidentifier",
                                                                                  "type":  "string"
                                                                              }
                                                               },
                                                "type":  "object"
                                            }
                    },
    "title":  "Aggregate.Tree",
    "$comment":  "Generated from Mermaid ERD with property-level descriptions",
    "$schema":  "http://json-schema.org/draft-07/schema#",
    "type":  "object"
}

Tree Node

Aggregate Root: TreeNode

Represents individual nodes within tree structures with their data references, metadata, and events.

erDiagram
    "Aggregate.CalculatedDataReferences" {
        uniqueidentifier Id PK
        uniqueidentifier NodeId FK
        int Key 
        uniqueidentifier TimeSeriesId 
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
        uniqueidentifier LinkedEntityId 
        int LinkedEntityType 
        int DataVersion 
        bit HasDataRetainClaim 
        int IngestionMoment 
        bit IsPreliminary 
    }

    "Aggregate.DataReferences" {
        uniqueidentifier Id PK
        uniqueidentifier NodeId FK
        int Key 
        uniqueidentifier TimeSeriesId 
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
        int DataVersion 
        bit HasDataRetainClaim 
        int IngestionMoment 
        bit IsPreliminary 
    }

    "Aggregate.DataRetainClaims" {
        uniqueidentifier Id PK
        uniqueidentifier NodeId FK
        int DataVersion 
        uniqueidentifier ClaimedByAuthToken 
        nvarchar ClaimedByProcess 
        nvarchar ClaimedDescription 
        int Expiration 
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
    }

    "Aggregate.TreeNodeEvents" {
        uniqueidentifier Id PK
        uniqueidentifier NodeId FK
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
    }

    "Aggregate.TreeNodeMetadataSet" {
        uniqueidentifier Id PK
        uniqueidentifier NodeId FK
        nvarchar Key 
        nvarchar Value 
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
    }

    "Aggregate.TreeNodes" {
        uniqueidentifier Id PK
        int DataType 
        nvarchar Name 
        int NodeType 
        int LastDataVersion 
        int LastCalculatedDataVersion 
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
        uniqueidentifier LinkedEntityId 
        int LinkedEntityType 
    }

    "Aggregate.CalculatedDataReferences" }o--|| "Aggregate.TreeNodes" : "NodeId"
    "Aggregate.DataReferences" }o--|| "Aggregate.TreeNodes" : "NodeId"
    "Aggregate.DataRetainClaims" }o--|| "Aggregate.TreeNodes" : "NodeId"
    "Aggregate.TreeNodeEvents" }o--|| "Aggregate.TreeNodes" : "NodeId"
    "Aggregate.TreeNodeMetadataSet" }o--|| "Aggregate.TreeNodes" : "NodeId"
    "Aggregate.IngestionWorkItemParts" }o--|| "Aggregate.TreeNodes" : "TargetNodeId"
    "Aggregate.TreeMemberships" }o--|| "Aggregate.TreeNodes" : "NodeId"
erDiagram
    "Aggregate.CalculatedDataReferences" {
        uniqueidentifier Id PK
        uniqueidentifier NodeId FK
        int Key 
        uniqueidentifier TimeSeriesId 
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
        uniqueidentifier LinkedEntityId 
        int LinkedEntityType 
        int DataVersion 
        bit HasDataRetainClaim 
        int IngestionMoment 
        bit IsPreliminary 
    }

    "Aggregate.DataReferences" {
        uniqueidentifier Id PK
        uniqueidentifier NodeId FK
        int Key 
        uniqueidentifier TimeSeriesId 
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
        int DataVersion 
        bit HasDataRetainClaim 
        int IngestionMoment 
        bit IsPreliminary 
    }

    "Aggregate.DataRetainClaims" {
        uniqueidentifier Id PK
        uniqueidentifier NodeId FK
        int DataVersion 
        uniqueidentifier ClaimedByAuthToken 
        nvarchar ClaimedByProcess 
        nvarchar ClaimedDescription 
        int Expiration 
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
    }

    "Aggregate.TreeNodeEvents" {
        uniqueidentifier Id PK
        uniqueidentifier NodeId FK
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
    }

    "Aggregate.TreeNodeMetadataSet" {
        uniqueidentifier Id PK
        uniqueidentifier NodeId FK
        nvarchar Key 
        nvarchar Value 
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
    }

    "Aggregate.TreeNodes" {
        uniqueidentifier Id PK
        int DataType 
        nvarchar Name 
        int NodeType 
        int LastDataVersion 
        int LastCalculatedDataVersion 
        uniqueidentifier Tenant 
        datetimeoffset EntityCreatedDateTime 
        datetimeoffset EntityUpdatedDateTime 
        uniqueidentifier EntityCreatedAuthToken 
        uniqueidentifier EntityUpdatedAuthToken 
        bit Concealed 
        uniqueidentifier LinkedEntityId 
        int LinkedEntityType 
    }

    "Aggregate.CalculatedDataReferences" }o--|| "Aggregate.TreeNodes" : "NodeId"
    "Aggregate.DataReferences" }o--|| "Aggregate.TreeNodes" : "NodeId"
    "Aggregate.DataRetainClaims" }o--|| "Aggregate.TreeNodes" : "NodeId"
    "Aggregate.TreeNodeEvents" }o--|| "Aggregate.TreeNodes" : "NodeId"
    "Aggregate.TreeNodeMetadataSet" }o--|| "Aggregate.TreeNodes" : "NodeId"
    "Aggregate.IngestionWorkItemParts" }o--|| "Aggregate.TreeNodes" : "TargetNodeId"
    "Aggregate.TreeMemberships" }o--|| "Aggregate.TreeNodes" : "NodeId"
{
    "definitions":  {
                        "Aggregate.DataReferences":  {
                                                         "properties":  {
                                                                            "Id":  {
                                                                                       "format":  "uuid",
                                                                                       "description":  "uniqueidentifier",
                                                                                       "type":  "string"
                                                                                   },
                                                                            "IsPreliminary":  {
                                                                                                  "type":  "boolean",
                                                                                                  "description":  "bit"
                                                                                              },
                                                                            "EntityUpdatedAuthToken":  {
                                                                                                           "format":  "uuid",
                                                                                                           "description":  "uniqueidentifier",
                                                                                                           "type":  "string"
                                                                                                       },
                                                                            "Concealed":  {
                                                                                              "type":  "boolean",
                                                                                              "description":  "bit"
                                                                                          },
                                                                            "EntityCreatedAuthToken":  {
                                                                                                           "format":  "uuid",
                                                                                                           "description":  "uniqueidentifier",
                                                                                                           "type":  "string"
                                                                                                       },
                                                                            "IngestionMoment":  {
                                                                                                    "type":  "integer",
                                                                                                    "description":  "int"
                                                                                                },
                                                                            "TimeSeriesId":  {
                                                                                                 "format":  "uuid",
                                                                                                 "description":  "uniqueidentifier",
                                                                                                 "type":  "string"
                                                                                             },
                                                                            "EntityUpdatedDateTime":  {
                                                                                                          "format":  "date-time",
                                                                                                          "description":  "datetimeoffset",
                                                                                                          "type":  "string"
                                                                                                      },
                                                                            "DataVersion":  {
                                                                                                "type":  "integer",
                                                                                                "description":  "int"
                                                                                            },
                                                                            "HasDataRetainClaim":  {
                                                                                                       "type":  "boolean",
                                                                                                       "description":  "bit"
                                                                                                   },
                                                                            "Tenant":  {
                                                                                           "format":  "uuid",
                                                                                           "description":  "uniqueidentifier",
                                                                                           "type":  "string"
                                                                                       },
                                                                            "Key":  {
                                                                                        "type":  "integer",
                                                                                        "description":  "int"
                                                                                    },
                                                                            "EntityCreatedDateTime":  {
                                                                                                          "format":  "date-time",
                                                                                                          "description":  "datetimeoffset",
                                                                                                          "type":  "string"
                                                                                                      },
                                                                            "NodeId":  {
                                                                                           "type":  "string",
                                                                                           "description":  "FK to Aggregate.TreeNodes"
                                                                                       }
                                                                        },
                                                         "type":  "object"
                                                     },
                        "Aggregate.TreeNodeMetadataSet":  {
                                                              "properties":  {
                                                                                 "Concealed":  {
                                                                                                   "type":  "boolean",
                                                                                                   "description":  "bit"
                                                                                               },
                                                                                 "EntityUpdatedAuthToken":  {
                                                                                                                "format":  "uuid",
                                                                                                                "description":  "uniqueidentifier",
                                                                                                                "type":  "string"
                                                                                                            },
                                                                                 "Id":  {
                                                                                            "format":  "uuid",
                                                                                            "description":  "uniqueidentifier",
                                                                                            "type":  "string"
                                                                                        },
                                                                                 "EntityCreatedAuthToken":  {
                                                                                                                "format":  "uuid",
                                                                                                                "description":  "uniqueidentifier",
                                                                                                                "type":  "string"
                                                                                                            },
                                                                                 "Key":  {
                                                                                             "type":  "string",
                                                                                             "description":  "nvarchar"
                                                                                         },
                                                                                 "NodeId":  {
                                                                                                "type":  "string",
                                                                                                "description":  "FK to Aggregate.TreeNodes"
                                                                                            },
                                                                                 "Value":  {
                                                                                               "type":  "string",
                                                                                               "description":  "nvarchar"
                                                                                           },
                                                                                 "EntityUpdatedDateTime":  {
                                                                                                               "format":  "date-time",
                                                                                                               "description":  "datetimeoffset",
                                                                                                               "type":  "string"
                                                                                                           },
                                                                                 "EntityCreatedDateTime":  {
                                                                                                               "format":  "date-time",
                                                                                                               "description":  "datetimeoffset",
                                                                                                               "type":  "string"
                                                                                                           },
                                                                                 "Tenant":  {
                                                                                                "format":  "uuid",
                                                                                                "description":  "uniqueidentifier",
                                                                                                "type":  "string"
                                                                                            }
                                                                             },
                                                              "type":  "object"
                                                          },
                        "Aggregate.DataRetainClaims":  {
                                                           "properties":  {
                                                                              "Concealed":  {
                                                                                                "type":  "boolean",
                                                                                                "description":  "bit"
                                                                                            },
                                                                              "Id":  {
                                                                                         "format":  "uuid",
                                                                                         "description":  "uniqueidentifier",
                                                                                         "type":  "string"
                                                                                     },
                                                                              "EntityUpdatedAuthToken":  {
                                                                                                             "format":  "uuid",
                                                                                                             "description":  "uniqueidentifier",
                                                                                                             "type":  "string"
                                                                                                         },
                                                                              "Expiration":  {
                                                                                                 "type":  "integer",
                                                                                                 "description":  "int"
                                                                                             },
                                                                              "ClaimedByProcess":  {
                                                                                                       "type":  "string",
                                                                                                       "description":  "nvarchar"
                                                                                                   },
                                                                              "EntityCreatedAuthToken":  {
                                                                                                             "format":  "uuid",
                                                                                                             "description":  "uniqueidentifier",
                                                                                                             "type":  "string"
                                                                                                         },
                                                                              "ClaimedDescription":  {
                                                                                                         "type":  "string",
                                                                                                         "description":  "nvarchar"
                                                                                                     },
                                                                              "NodeId":  {
                                                                                             "type":  "string",
                                                                                             "description":  "FK to Aggregate.TreeNodes"
                                                                                         },
                                                                              "EntityUpdatedDateTime":  {
                                                                                                            "format":  "date-time",
                                                                                                            "description":  "datetimeoffset",
                                                                                                            "type":  "string"
                                                                                                        },
                                                                              "DataVersion":  {
                                                                                                  "type":  "integer",
                                                                                                  "description":  "int"
                                                                                              },
                                                                              "ClaimedByAuthToken":  {
                                                                                                         "format":  "uuid",
                                                                                                         "description":  "uniqueidentifier",
                                                                                                         "type":  "string"
                                                                                                     },
                                                                              "Tenant":  {
                                                                                             "format":  "uuid",
                                                                                             "description":  "uniqueidentifier",
                                                                                             "type":  "string"
                                                                                         },
                                                                              "EntityCreatedDateTime":  {
                                                                                                            "format":  "date-time",
                                                                                                            "description":  "datetimeoffset",
                                                                                                            "type":  "string"
                                                                                                        }
                                                                          },
                                                           "type":  "object"
                                                       },
                        "Aggregate.TreeNodeEvents":  {
                                                         "properties":  {
                                                                            "Concealed":  {
                                                                                              "type":  "boolean",
                                                                                              "description":  "bit"
                                                                                          },
                                                                            "EntityUpdatedAuthToken":  {
                                                                                                           "format":  "uuid",
                                                                                                           "description":  "uniqueidentifier",
                                                                                                           "type":  "string"
                                                                                                       },
                                                                            "Id":  {
                                                                                       "format":  "uuid",
                                                                                       "description":  "uniqueidentifier",
                                                                                       "type":  "string"
                                                                                   },
                                                                            "NodeId":  {
                                                                                           "type":  "string",
                                                                                           "description":  "FK to Aggregate.TreeNodes"
                                                                                       },
                                                                            "EntityCreatedDateTime":  {
                                                                                                          "format":  "date-time",
                                                                                                          "description":  "datetimeoffset",
                                                                                                          "type":  "string"
                                                                                                      },
                                                                            "EntityUpdatedDateTime":  {
                                                                                                          "format":  "date-time",
                                                                                                          "description":  "datetimeoffset",
                                                                                                          "type":  "string"
                                                                                                      },
                                                                            "EntityCreatedAuthToken":  {
                                                                                                           "format":  "uuid",
                                                                                                           "description":  "uniqueidentifier",
                                                                                                           "type":  "string"
                                                                                                       },
                                                                            "Tenant":  {
                                                                                           "format":  "uuid",
                                                                                           "description":  "uniqueidentifier",
                                                                                           "type":  "string"
                                                                                       }
                                                                        },
                                                         "type":  "object"
                                                     },
                        "Aggregate.CalculatedDataReferences":  {
                                                                   "properties":  {
                                                                                      "Id":  {
                                                                                                 "format":  "uuid",
                                                                                                 "description":  "uniqueidentifier",
                                                                                                 "type":  "string"
                                                                                             },
                                                                                      "IsPreliminary":  {
                                                                                                            "type":  "boolean",
                                                                                                            "description":  "bit"
                                                                                                        },
                                                                                      "EntityUpdatedAuthToken":  {
                                                                                                                     "format":  "uuid",
                                                                                                                     "description":  "uniqueidentifier",
                                                                                                                     "type":  "string"
                                                                                                                 },
                                                                                      "Concealed":  {
                                                                                                        "type":  "boolean",
                                                                                                        "description":  "bit"
                                                                                                    },
                                                                                      "LinkedEntityType":  {
                                                                                                               "type":  "integer",
                                                                                                               "description":  "int"
                                                                                                           },
                                                                                      "EntityCreatedAuthToken":  {
                                                                                                                     "format":  "uuid",
                                                                                                                     "description":  "uniqueidentifier",
                                                                                                                     "type":  "string"
                                                                                                                 },
                                                                                      "Key":  {
                                                                                                  "type":  "integer",
                                                                                                  "description":  "int"
                                                                                              },
                                                                                      "IngestionMoment":  {
                                                                                                              "type":  "integer",
                                                                                                              "description":  "int"
                                                                                                          },
                                                                                      "TimeSeriesId":  {
                                                                                                           "format":  "uuid",
                                                                                                           "description":  "uniqueidentifier",
                                                                                                           "type":  "string"
                                                                                                       },
                                                                                      "EntityUpdatedDateTime":  {
                                                                                                                    "format":  "date-time",
                                                                                                                    "description":  "datetimeoffset",
                                                                                                                    "type":  "string"
                                                                                                                },
                                                                                      "DataVersion":  {
                                                                                                          "type":  "integer",
                                                                                                          "description":  "int"
                                                                                                      },
                                                                                      "HasDataRetainClaim":  {
                                                                                                                 "type":  "boolean",
                                                                                                                 "description":  "bit"
                                                                                                             },
                                                                                      "Tenant":  {
                                                                                                     "format":  "uuid",
                                                                                                     "description":  "uniqueidentifier",
                                                                                                     "type":  "string"
                                                                                                 },
                                                                                      "LinkedEntityId":  {
                                                                                                             "format":  "uuid",
                                                                                                             "description":  "uniqueidentifier",
                                                                                                             "type":  "string"
                                                                                                         },
                                                                                      "EntityCreatedDateTime":  {
                                                                                                                    "format":  "date-time",
                                                                                                                    "description":  "datetimeoffset",
                                                                                                                    "type":  "string"
                                                                                                                },
                                                                                      "NodeId":  {
                                                                                                     "type":  "string",
                                                                                                     "description":  "FK to Aggregate.TreeNodes"
                                                                                                 }
                                                                                  },
                                                                   "type":  "object"
                                                               },
                        "Aggregate.TreeNodes":  {
                                                    "properties":  {
                                                                       "Concealed":  {
                                                                                         "type":  "boolean",
                                                                                         "description":  "bit"
                                                                                     },
                                                                       "Id":  {
                                                                                  "format":  "uuid",
                                                                                  "description":  "uniqueidentifier",
                                                                                  "type":  "string"
                                                                              },
                                                                       "EntityUpdatedAuthToken":  {
                                                                                                      "format":  "uuid",
                                                                                                      "description":  "uniqueidentifier",
                                                                                                      "type":  "string"
                                                                                                  },
                                                                       "Name":  {
                                                                                    "type":  "string",
                                                                                    "description":  "nvarchar"
                                                                                },
                                                                       "LinkedEntityType":  {
                                                                                                "type":  "integer",
                                                                                                "description":  "int"
                                                                                            },
                                                                       "EntityCreatedAuthToken":  {
                                                                                                      "format":  "uuid",
                                                                                                      "description":  "uniqueidentifier",
                                                                                                      "type":  "string"
                                                                                                  },
                                                                       "LastCalculatedDataVersion":  {
                                                                                                         "type":  "integer",
                                                                                                         "description":  "int"
                                                                                                     },
                                                                       "EntityUpdatedDateTime":  {
                                                                                                     "format":  "date-time",
                                                                                                     "description":  "datetimeoffset",
                                                                                                     "type":  "string"
                                                                                                 },
                                                                       "LastDataVersion":  {
                                                                                               "type":  "integer",
                                                                                               "description":  "int"
                                                                                           },
                                                                       "DataType":  {
                                                                                        "type":  "integer",
                                                                                        "description":  "int"
                                                                                    },
                                                                       "Tenant":  {
                                                                                      "format":  "uuid",
                                                                                      "description":  "uniqueidentifier",
                                                                                      "type":  "string"
                                                                                  },
                                                                       "LinkedEntityId":  {
                                                                                              "format":  "uuid",
                                                                                              "description":  "uniqueidentifier",
                                                                                              "type":  "string"
                                                                                          },
                                                                       "NodeType":  {
                                                                                        "type":  "integer",
                                                                                        "description":  "int"
                                                                                    },
                                                                       "EntityCreatedDateTime":  {
                                                                                                     "format":  "date-time",
                                                                                                     "description":  "datetimeoffset",
                                                                                                     "type":  "string"
                                                                                                 }
                                                                   },
                                                    "type":  "object"
                                                }
                    },
    "title":  "Aggregate.TreeNode",
    "$comment":  "Generated from Mermaid ERD with property-level descriptions",
    "$schema":  "http://json-schema.org/draft-07/schema#",
    "type":  "object"
}