added check on components
MODIFY
src/server/rest/v1/validator/TenantValidation.ts
src/server/rest/v1/validator/TenantValidation.ts
@@ -101,6 +101,16 @@ export default class TenantValidator extends SchemaValidator {
module: this.moduleName, method: 'validateTenantUpdateRequestSuperAdmin'
});
}
+ // Car Connector active: Car must be active
+ if (tenant.components.carConnector && tenant.components.car &&
+ tenant.components.carConnector.active && !tenant.components.car.active) {
+ throw new AppError({
+ source: Constants.CENTRAL_SERVER,
+ errorCode: HTTPError.GENERAL_ERROR,
+ message: 'Car must be active to use the Car Connector component',
+ module: this.moduleName, method: 'validateTenantUpdateRequestSuperAdmin'
+ });
+ }
// Billing active: Pricing must be active
if (tenant.components.billing && tenant.components.pricing &&
tenant.components.billing.active && !tenant.components.pricing.active) {

MODIFY
src/types/Tenant.ts
src/types/Tenant.ts
@@ -52,6 +52,10 @@ export default interface Tenant extends CreatedUpdatedProps {
active: boolean;
type: string;
};
+ carConnector?: {
+ active: boolean;
+ type: string;
+ };
};
}

added check on components