WIP - use objection and working lookup field to owner

This commit is contained in:
Francisco Gaona
2025-12-24 21:43:58 +01:00
parent 4520f94b69
commit c5305490c1
14 changed files with 334 additions and 112 deletions

View File

@@ -42,7 +42,12 @@ export class ModelRegistry {
createAndRegisterModel(
metadata: ObjectMetadata,
): ModelClass<BaseModel> {
const model = DynamicModelFactory.createModel(metadata);
// Create model with a getModel function that resolves from this registry
// Returns undefined if model not found (for models not yet registered)
const model = DynamicModelFactory.createModel(
metadata,
(apiName: string) => this.registry.get(apiName),
);
this.registerModel(metadata.apiName, model);
return model;
}