mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
refactor(nestjs): export and import module
This commit is contained in:
@@ -82,6 +82,7 @@ const models = [
|
||||
TenantUser,
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* Decorator factory that registers a model with the tenancy system.
|
||||
* @param model The model class to register
|
||||
|
||||
@@ -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
|
||||
});
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user