From d2a5ffcebbb22ae8c6885667cfdcfe7465345213 Mon Sep 17 00:00:00 2001 From: diallolatoile Date: Wed, 3 Dec 2025 00:29:51 +0000 Subject: [PATCH] feat: add DCB User Service API - Authentication system with KEYCLOAK - Modular architecture with services for each feature --- src/app/modules/hub-users-management/hub-users.service.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/modules/hub-users-management/hub-users.service.ts b/src/app/modules/hub-users-management/hub-users.service.ts index 9d28551..50e178d 100644 --- a/src/app/modules/hub-users-management/hub-users.service.ts +++ b/src/app/modules/hub-users-management/hub-users.service.ts @@ -123,7 +123,11 @@ export class HubUsersService { return throwError(() => 'Password must be at least 8 characters'); } - if (!createUserDto.merchantConfigId) { + if (createUserDto.role === UserRole.DCB_PARTNER && !createUserDto.merchantConfigId) { + return throwError(() => 'Merchant Config is required and cannot be empty'); + } + + if (createUserDto.userType === UserType.MERCHANT_PARTNER && !createUserDto.merchantConfigId) { return throwError(() => 'Merchant Config is required and cannot be empty'); }