feat: Add Health Check Endpoint

This commit is contained in:
diallolatoile 2026-01-17 14:06:26 +00:00
parent 326b9c8ec1
commit fb9a9dfba2
3 changed files with 34 additions and 18 deletions

View File

@ -7,11 +7,13 @@
<h4 class="mb-1">Profil Marchand</h4> <h4 class="mb-1">Profil Marchand</h4>
<nav aria-label="breadcrumb"> <nav aria-label="breadcrumb">
<ol class="breadcrumb mb-0"> <ol class="breadcrumb mb-0">
<li class="breadcrumb-item"> @if(isHubUser){
<a href="javascript:void(0)" (click)="goBack()" class="text-decoration-none cursor-pointer"> <li class="breadcrumb-item">
Marchands <a href="javascript:void(0)" (click)="goBack()" class="text-decoration-none cursor-pointer">
</a> Marchands
</li> </a>
</li>
}
<li class="breadcrumb-item active" aria-current="page"> <li class="breadcrumb-item active" aria-current="page">
{{ merchant?.name || 'Chargement...' }} {{ merchant?.name || 'Chargement...' }}
</li> </li>
@ -29,15 +31,16 @@
<ng-icon name="lucideRefreshCw" class="me-1" [class.spin]="loading"></ng-icon> <ng-icon name="lucideRefreshCw" class="me-1" [class.spin]="loading"></ng-icon>
Actualiser Actualiser
</button> </button>
@if(isHubUser){
<!-- Bouton retour --> <!-- Bouton retour -->
<button <button
class="btn btn-outline-secondary" class="btn btn-outline-secondary"
(click)="goBack()" (click)="goBack()"
> >
<ng-icon name="lucideArrowLeft" class="me-1"></ng-icon> <ng-icon name="lucideArrowLeft" class="me-1"></ng-icon>
Retour Retour
</button> </button>
}
</div> </div>
</div> </div>
</div> </div>

View File

@ -21,7 +21,7 @@ import { MerchantConfigService } from '../merchant-config.service';
import { MerchantDataAdapter } from '../merchant-data-adapter.service'; import { MerchantDataAdapter } from '../merchant-data-adapter.service';
import { RoleManagementService } from '@core/services/hub-users-roles-management.service'; import { RoleManagementService } from '@core/services/hub-users-roles-management.service';
import { AuthService } from '@core/services/auth.service'; import { AuthService } from '@core/services/auth.service';
import { UserRole } from '@core/models/dcb-bo-hub-user.model'; import { UserRole, UserType } from '@core/models/dcb-bo-hub-user.model';
import { MinioService } from '@core/services/minio.service'; import { MinioService } from '@core/services/minio.service';
import { DomSanitizer } from '@angular/platform-browser'; import { DomSanitizer } from '@angular/platform-browser';
@ -218,6 +218,9 @@ export class MerchantConfigView implements OnInit, OnDestroy {
// Gestion des permissions // Gestion des permissions
currentUserRole: UserRole | null = null; currentUserRole: UserRole | null = null;
currentMerchantPartnerId: string = ''; currentMerchantPartnerId: string = '';
// Déterminer le type d'utilisateur
isMerchantUser = false;
isHubUser = false;
// Édition des configurations // Édition des configurations
editingConfigId: number | null = null; editingConfigId: number | null = null;
@ -470,6 +473,18 @@ export class MerchantConfigView implements OnInit, OnDestroy {
.subscribe({ .subscribe({
next: (profile) => { next: (profile) => {
this.currentUserRole = this.authService.getCurrentUserRole(); this.currentUserRole = this.authService.getCurrentUserRole();
// Déterminer si c'est un utilisateur marchand
if (this.currentUserRole === UserRole.DCB_PARTNER_ADMIN ||
this.currentUserRole === UserRole.DCB_PARTNER_MANAGER ||
this.currentUserRole === UserRole.DCB_PARTNER_SUPPORT ||
this.currentUserRole === UserRole.MERCHANT_CONFIG_MANAGER ||
this.currentUserRole === UserRole.MERCHANT_CONFIG_TECHNICAL ||
this.currentUserRole === UserRole.MERCHANT_CONFIG_VIEWER) {
this.isMerchantUser = true;
} else {
this.isHubUser = profile?.userType === UserType.HUB;
this.isMerchantUser = profile?.userType === UserType.MERCHANT_PARTNER;
}
this.cdRef.detectChanges(); this.cdRef.detectChanges();
}, },
error: (error) => { error: (error) => {

View File

@ -88,7 +88,7 @@ export class MerchantConfigManagement implements OnInit, OnDestroy {
logoChanged = false; logoChanged = false;
// État de l'interface // État de l'interface
activeTab: 'list' | 'merchant-profile' = 'list'; activeTab: 'list' | 'merchant-profile' = 'merchant-profile';
selectedMerchantId: number | null = null; selectedMerchantId: number | null = null;
selectedConfigId: number | null = null; selectedConfigId: number | null = null;
selectedUserId: string | null = null; selectedUserId: string | null = null;
@ -256,8 +256,6 @@ export class MerchantConfigManagement implements OnInit, OnDestroy {
} }
} else { } else {
console.warn('No merchant found for current user'); console.warn('No merchant found for current user');
// Si aucun marchand trouvé, revenir à la liste
this.activeTab = 'list';
} }
this.loadingUserMerchant = false; this.loadingUserMerchant = false;