refactor: implement tenant database management and seeding utilities

This commit is contained in:
Ahmed Bouhuolia
2025-03-27 23:13:17 +02:00
parent 92d98ce1d3
commit 6461a2318f
54 changed files with 1497 additions and 272 deletions

View File

@@ -0,0 +1,13 @@
import { ServiceError } from '../Items/ServiceError';
import { ERRORS } from './constants';
import { Role } from './models/Role.model';
/**
* Valdiates role is not predefined.
* @param {IRole} role - Role object.
*/
export const validateRoleNotPredefined = (role: Role) => {
if (role.predefined) {
throw new ServiceError(ERRORS.ROLE_PREFINED);
}
};