Models / Review
ChangeCreationResult
- class teksi_hooks.models.review.ChangeCreationResult(job_id, import_model, incremental_import_model=None, created_models=<factory>, incremental_created_models=<factory>, effect_document=None, changes=<factory>, validation_findings=<factory>, classified_changes=<factory>, features_by_class=<factory>, diff_schema_result=<factory>)[source]
Result of a change-creation workflow.
The result exposes intermediate products for diagnostics, tests and subsequent review or persistence workflows.
- Parameters:
job_id (str | None)
import_model (str | None)
incremental_import_model (str | None)
created_models (list[str])
incremental_created_models (list[str])
effect_document (EffectDocument | None)
changes (list[Change])
validation_findings (list[ValidationFinding])
classified_changes (ClassifiedChanges | None)
features_by_class (dict[str, list[ReviewFeature]])
diff_schema_result (DiffSchemaWriteResult | None)
Fields
job_idType:
str | NoneDatabase-generated identifier of the inserted review-job metadata row.
import_modelType:
str | NoneName of the import model.
incremental_import_modelType:
str | NoneName of the incremental import model.
created_modelsType:
list[str]List of created models.
incremental_created_modelsType:
list[str]List of created incremental models.
effect_documentType:
EffectDocument | NoneEffect Document of the corresponding workflow.
changesType:
list[Change]Changes of the corresponding workflow.
validation_findingsType:
list[ValidationFinding]Validation findings of the corresponding workflow.
classified_changesType:
ClassifiedChanges | NoneClassified Changes of the corresponding workflow.
features_by_classType:
dict[str, list[ReviewFeature]]List of review features by class.
diff_schema_resultType:
DiffSchemaWriteResult | NoneResult of the Diff Schema Writer.
DiffReviewDecisionResult
- class teksi_hooks.models.review.DiffReviewDecisionResult(job_id, snapshot_id, decision, job_status, persistence_result=None)[source]
Result of accepting or rejecting a diff review job.
An accepted decision includes the result returned by the canonical persistence capability. A rejected decision does not invoke persistence and therefore has no persistence result.
- Parameters:
job_id (str)
snapshot_id (UUID)
decision (DiffReviewDecision)
job_status (DiffReviewJobStatus)
persistence_result (PersistenceResult | None)
Fields
job_idType:
strLogical identifier of the diff review job that was resolved.
snapshot_idType:
UUIDIdentifier of the immutable diff snapshot to which the decision was applied.
decisionType:
DiffReviewDecisionDecision taken for the pending review job.
job_statusType:
DiffReviewJobStatusResulting lifecycle status of the diff review job.
persistence_resultType:
PersistenceResult | NoneAggregate result of persisting accepted canonical changes. This is None when the review job was rejected.
DiffReviewJob
- class teksi_hooks.models.review.DiffReviewJob(job_db_id, job_id, job_status, validation_success, metadata=<factory>, features_by_class=<factory>)[source]
Stored state required to inspect and resolve one diff review job.
A review job combines job-level lifecycle and validation information with the review features generated for the corresponding canonical changes.
The job is an application-level representation of the data persisted in
tww_diff. It does not define how accepted changes are physically applied to live data.Attributes
- job_db_id:
Database-generated identifier of the job metadata row.
Review-feature rows may use this value as their foreign key to the job metadata table.
- job_id:
Stable external identifier of the review job.
This identifier is supplied by the calling workflow and is used when retrieving, accepting, rejecting or replacing a review job.
- job_status:
Current lifecycle status of the review job.
Expected values include
pending,rejectedandapplied. Services resolving the job must reject unsupported transitions.- validation_success:
Whether validation of the imported data completed successfully before the review job was created.
A false value indicates that the job must not be applied to live data.
- metadata:
Workflow and model-specific metadata associated with the review job.
This may include source-model identifiers, source-file paths, import and live schema names, provider and data-owner identifiers, incremental import information, mapping provenance and snapshot identifiers.
Generic review logic must not assign semantics to model-specific entries.
- features_by_class:
Review features grouped by canonical class identifier.
Each key is a canonical class identifier and each value contains the ordered review features stored for that class and job. The features contain the reviewed canonical values, imported values, changed attributes, findings and review geometries needed by subsequent decision and persistence workflows.
- Parameters:
job_db_id (int)
job_id (str)
job_status (str)
validation_success (bool)
metadata (Mapping[str, Any])
features_by_class (Mapping[str, Sequence[ReviewFeature]])
Fields
job_db_idType:
intDatabase-generated identifier of the review-job metadata row. Review-feature rows may reference this value through their job foreign key.
job_idType:
strStable external identifier used to retrieve, replace, accept or reject the review job.
job_statusType:
strCurrent lifecycle status of the review job, such as ‘pending’, ‘rejected’ or ‘applied’.
validation_successType:
boolWhether validation of the imported data completed successfully before the review job was created.
metadataType:
Mapping[str, Any]Workflow and model-specific metadata associated with the review job. This may include source models, source files, schema names, provider context, mapping provenance and snapshot identifiers.
features_by_classType:
Mapping[str, Sequence[ReviewFeature,]]Review features grouped by canonical class identifier. Feature ordering within each class is preserved.
DiffSchemaWriteResult
- class teksi_hooks.models.review.DiffSchemaWriteResult(job_db_id, job_id, row_count)[source]
Result of writing one diff review job into the
tww_diffschema.The result identifies the newly written job and reports the total number of review-feature rows persisted across all canonical class tables.
It does not contain the review features themselves and does not indicate that any accepted changes have been applied to live data.
Attributes
- job_db_id:
Database-generated identifier of the inserted job metadata row.
This identifier is used internally by review-feature rows as their reference to the job.
- job_id:
Stable external identifier supplied by the review workflow.
This may be used by callers to retrieve or resolve the stored review job without depending on its database-generated identifier.
- row_count:
Total number of review-feature rows written across all canonical class tables for the job.
The metadata row itself is not included in this count.
- Parameters:
job_db_id (int)
job_id (str)
row_count (int)
Fields
job_db_idType:
intDatabase-generated identifier of the inserted review-job metadata row.
job_idType:
strStable external identifier of the written review job.
row_countType:
intTotal number of review-feature rows written across all canonical class tables. The metadata row is not included.
PreparedSource
- class teksi_hooks.models.review.PreparedSource(source_model, created_models, effect_document, metadata=<factory>)[source]
Validated canonical projection staged for a multi-source diff workflow.
A prepared source is not a persisted review job. It holds the projected effects of one source delivery until all required sources have been prepared and the final pending review job can be created.
- Parameters:
source_model (str)
created_models (tuple[str, ...])
effect_document (EffectDocument)
metadata (Mapping[str, Any])
Fields
source_modelType:
strExact source-model identifier used to import and project the source delivery.
created_modelsType:
tuple[str, ...]Concrete INTERLIS model identifiers used to create the quarantine schema. Models are ordered dependency-first, with the primary source model appearing last.
effect_documentType:
EffectDocumentCanonical effect document projected from the validated source quarantine. A later incremental source may override matching effects before the pending review job is created.
metadataType:
Mapping[str, Any]Workflow and source-specific metadata associated with the prepared projection. This may include the source role, XTF path, quarantine schema, semantic model group, model language, provider context and mapping provenance.
ReviewFeature
- class teksi_hooks.models.review.ReviewFeature(class_id, object_id, attributes=<factory>, geometries=<factory>)[source]
Feature prepared for review artifact export.
A ReviewFeature is not necessarily a database row. It is a review/export representation of a classified change.
A review writer may turn this into any geospatial storage type that can hold its corresponding geometry types
- Parameters:
class_id (str)
object_id (str)
attributes (dict[str, Any])
geometries (dict[str, Any])
Fields
class_idType:
strCanonical class identifier represented by this review feature.
object_idType:
strCanonical object identifier represented by this review feature.
attributesType:
dict[str, Any]Canonical attribute values and review metadata attributes to be exported for this feature.
geometriesType:
dict[str, Any]Geometry values keyed by canonical geometry attribute name. Multiple geometry attributes are supported because some canonical classes may expose more than one geometry.