refactor(nestjs): export and import module

This commit is contained in:
Ahmed Bouhuolia
2025-04-09 18:35:17 +02:00
parent d851e5b646
commit ab49113d5a
38 changed files with 2403 additions and 117 deletions

View File

@@ -82,6 +82,7 @@ const models = [
TenantUser,
];
/**
* Decorator factory that registers a model with the tenancy system.
* @param model The model class to register

View File

@@ -0,0 +1,18 @@
/**
* Decorator function that adds metadata to the model class.
* @param value - The metadata value to be added to the model.
* @returns A class decorator function.
*/
export function InjectModelMeta(value: any) {
return function(target: any) {
// Define a static getter for 'meta' on the target class
Object.defineProperty(target, 'meta', {
get: function() {
return value;
},
enumerable: true,
configurable: true
});
};
}