diff --git a/src/app/core/services/auth.service.ts b/src/app/core/services/auth.service.ts index d0bbd54..1215f12 100644 --- a/src/app/core/services/auth.service.ts +++ b/src/app/core/services/auth.service.ts @@ -146,7 +146,7 @@ export class AuthService { */ login(username: string, password: string): Observable { return this.http.post( - `${environment.apiUrl}/auth/login`, + `${environment.iamApiUrl}/auth/login`, { username, password } ).pipe( tap(response => { @@ -170,7 +170,7 @@ export class AuthService { } return this.http.post( - `${environment.apiUrl}/auth/refresh`, + `${environment.iamApiUrl}/auth/refresh`, { refresh_token: refreshToken } ).pipe( tap(response => { @@ -191,7 +191,7 @@ export class AuthService { this.clearSession(redirect); // Appel API optionnel (ne pas bloquer dessus) - this.http.post(`${environment.apiUrl}/auth/logout`, {}).subscribe({ + this.http.post(`${environment.iamApiUrl}/auth/logout`, {}).subscribe({ error: () => {} // Ignorer silencieusement les erreurs de logout }); } @@ -273,7 +273,7 @@ export class AuthService { * Récupère les infos utilisateur depuis le backend */ getProfile(): Observable { - return this.http.get(`${environment.apiUrl}/users/profile/me`).pipe( + return this.http.get(`${environment.iamApiUrl}/users/profile/me`).pipe( catchError(error => { return throwError(() => error); }) diff --git a/src/app/modules/dcb-dashboard/services/dcb-dashboard.service.ts b/src/app/modules/dcb-dashboard/services/dcb-dashboard.service.ts index 728d97b..2084920 100644 --- a/src/app/modules/dcb-dashboard/services/dcb-dashboard.service.ts +++ b/src/app/modules/dcb-dashboard/services/dcb-dashboard.service.ts @@ -8,7 +8,7 @@ import { environment } from '@environments/environment'; @Injectable({ providedIn: 'root' }) export class DcbDashboardService { private http = inject(HttpClient); - private apiUrl = `${environment.apiUrl}/dcb-dashboard`; + private apiUrl = `${environment.localServiceTestApiUrl}/dcb-dashboard`; // Données mockées pour le développement private mockData: DcbDashboardData = { diff --git a/src/app/modules/merchants/services/merchants.service.ts b/src/app/modules/merchants/services/merchants.service.ts index 3b41a52..41aa8d0 100644 --- a/src/app/modules/merchants/services/merchants.service.ts +++ b/src/app/modules/merchants/services/merchants.service.ts @@ -12,7 +12,7 @@ import { @Injectable({ providedIn: 'root' }) export class MerchantsService { private http = inject(HttpClient); - private apiUrl = `${environment.apiUrl}/partners`; + private apiUrl = `${environment.localServiceTestApiUrl}/partners`; // Enregistrement d'un nouveau merchant registerMerchant(registration: MerchantRegistration): Observable { @@ -42,7 +42,7 @@ export class MerchantsService { // Test des webhooks testWebhook(url: string, event: string): Observable<{ success: boolean; response: any; responseTime: number }> { return this.http.post<{ success: boolean; response: any; responseTime: number }>( - `${environment.apiUrl}/webhooks/test`, + `${environment.iamApiUrl}/webhooks/test`, { url, event } ); } diff --git a/src/app/modules/notifications/services/notifications.service.ts b/src/app/modules/notifications/services/notifications.service.ts index dcb0967..351fba8 100644 --- a/src/app/modules/notifications/services/notifications.service.ts +++ b/src/app/modules/notifications/services/notifications.service.ts @@ -26,28 +26,29 @@ export interface NotificationFilter { @Injectable({ providedIn: 'root' }) export class NotificationService { private http = inject(HttpClient); + private apiUrl = `${environment.localServiceTestApiUrl}/notifications`; getNotifications(filters?: NotificationFilter): Observable { return this.http.post( - `${environment.apiUrl}/notifications/list`, + `${this.apiUrl}/list`, filters ); } sendNotification(notification: Partial): Observable { return this.http.post( - `${environment.apiUrl}/notifications/send`, + `${this.apiUrl}/send`, notification ); } getNotificationStats(): Observable { - return this.http.get(`${environment.apiUrl}/notifications/stats`); + return this.http.get(`${this.apiUrl}/stats`); } retryNotification(notificationId: string): Observable { return this.http.post( - `${environment.apiUrl}/notifications/${notificationId}/retry`, + `${this.apiUrl}/${notificationId}/retry`, {} ); } diff --git a/src/app/modules/operators/services/operators.service.ts b/src/app/modules/operators/services/operators.service.ts index 7234387..cb1a4ea 100644 --- a/src/app/modules/operators/services/operators.service.ts +++ b/src/app/modules/operators/services/operators.service.ts @@ -25,21 +25,22 @@ export interface OperatorConfig { @Injectable({ providedIn: 'root' }) export class OperatorService { private http = inject(HttpClient); + private apiUrl = `${environment.localServiceTestApiUrl}/operators`; getOperators(): Observable { - return this.http.get(`${environment.apiUrl}/operators`); + return this.http.get(`${this.apiUrl}`); } updateOperatorConfig(operatorId: string, config: OperatorConfig): Observable { return this.http.put( - `${environment.apiUrl}/operators/${operatorId}/config`, + `${this.apiUrl}/${operatorId}/config`, config ); } testConnection(operatorId: string): Observable<{ success: boolean; latency: number }> { return this.http.post<{ success: boolean; latency: number }>( - `${environment.apiUrl}/operators/${operatorId}/test-connection`, + `${this.apiUrl}/${operatorId}/test-connection`, {} ); } diff --git a/src/app/modules/operators/services/stats.service.ts b/src/app/modules/operators/services/stats.service.ts index 68dfd81..448a328 100644 --- a/src/app/modules/operators/services/stats.service.ts +++ b/src/app/modules/operators/services/stats.service.ts @@ -24,20 +24,21 @@ export interface DailyStat { @Injectable({ providedIn: 'root' }) export class OperatorStatsService { private http = inject(HttpClient); + private apiUrl = `${environment.localServiceTestApiUrl}/operators`; getOperatorStats(operatorId: string): Observable { return this.http.get( - `${environment.apiUrl}/operators/${operatorId}/stats` + `${this.apiUrl}/${operatorId}/stats` ); } getOperatorsComparison(): Observable { - return this.http.get(`${environment.apiUrl}/operators/comparison`); + return this.http.get(`${this.apiUrl}/comparison`); } getPerformanceMetrics(operatorId: string, period: string): Observable { return this.http.get( - `${environment.apiUrl}/operators/${operatorId}/metrics?period=${period}` + `${this.apiUrl}/${operatorId}/metrics?period=${period}` ); } } \ No newline at end of file diff --git a/src/app/modules/transactions/services/transactions.service.ts b/src/app/modules/transactions/services/transactions.service.ts index be6974c..74d297b 100644 --- a/src/app/modules/transactions/services/transactions.service.ts +++ b/src/app/modules/transactions/services/transactions.service.ts @@ -14,7 +14,7 @@ import { @Injectable({ providedIn: 'root' }) export class TransactionsService { private http = inject(HttpClient); - private apiUrl = `${environment.apiUrl}/transactions`; + private apiUrl = `${environment.localServiceTestApiUrl}/transactions`; // === CRUD OPERATIONS === getTransactions(query: TransactionQuery): Observable { diff --git a/src/app/modules/users/services/users.service.ts b/src/app/modules/users/services/users.service.ts index 872f883..b73a846 100644 --- a/src/app/modules/users/services/users.service.ts +++ b/src/app/modules/users/services/users.service.ts @@ -16,7 +16,7 @@ import { @Injectable({ providedIn: 'root' }) export class UsersService { private http = inject(HttpClient); - private apiUrl = `${environment.apiUrl}/users`; + private apiUrl = `${environment.localServiceTestApiUrl}/users`; // === CRUD COMPLET === createUser(createUserDto: CreateUserDto): Observable { diff --git a/src/app/modules/webhooks/services/retry.service.ts b/src/app/modules/webhooks/services/retry.service.ts index 6428ab8..f49029c 100644 --- a/src/app/modules/webhooks/services/retry.service.ts +++ b/src/app/modules/webhooks/services/retry.service.ts @@ -6,26 +6,27 @@ import { Observable } from 'rxjs'; @Injectable({ providedIn: 'root' }) export class WebhookRetryService { private http = inject(HttpClient); + private apiUrl = `${environment.localServiceTestApiUrl}/webhooks`; retryWebhook(webhookId: string): Observable<{ success: boolean }> { return this.http.post<{ success: boolean }>( - `${environment.apiUrl}/webhooks/${webhookId}/retry`, + `${this.apiUrl}/${webhookId}/retry`, {} ); } bulkRetryWebhooks(webhookIds: string[]): Observable<{ success: number; failed: number }> { return this.http.post<{ success: number; failed: number }>( - `${environment.apiUrl}/webhooks/bulk-retry`, + `${this.apiUrl}/bulk-retry`, { webhookIds } ); } getRetryConfig(): Observable { - return this.http.get(`${environment.apiUrl}/webhooks/retry-config`); + return this.http.get(`${this.apiUrl}/retry-config`); } updateRetryConfig(config: any): Observable { - return this.http.put(`${environment.apiUrl}/webhooks/retry-config`, config); + return this.http.put(`${this.apiUrl}/retry-config`, config); } } \ No newline at end of file diff --git a/src/app/modules/webhooks/services/webhooks.service.ts b/src/app/modules/webhooks/services/webhooks.service.ts index cb51c70..f9fbcf7 100644 --- a/src/app/modules/webhooks/services/webhooks.service.ts +++ b/src/app/modules/webhooks/services/webhooks.service.ts @@ -25,10 +25,11 @@ export interface WebhookFilter { @Injectable({ providedIn: 'root' }) export class WebhookService { private http = inject(HttpClient); + private apiUrl = `${environment.localServiceTestApiUrl}/webhooks`; getWebhookHistory(filters?: WebhookFilter): Observable { return this.http.post( - `${environment.apiUrl}/webhooks/history`, + `${this.apiUrl}/history`, filters ); } @@ -39,6 +40,6 @@ export class WebhookService { failed: number; pending: number; }> { - return this.http.get(`${environment.apiUrl}/webhooks/status`); + return this.http.get(`${this.apiUrl}/status`); } } \ No newline at end of file diff --git a/src/environments/environment.preprod.ts b/src/environments/environment.preprod.ts index d9295e5..7729bf9 100644 --- a/src/environments/environment.preprod.ts +++ b/src/environments/environment.preprod.ts @@ -1,6 +1,7 @@ export const environment = { production: false, - apiUrl: "https://api-user-service.dcb.pixpay.sn/api/v1", + localServiceTestApiUrl: "https://backoffice.dcb.pixpay.sn/api/v1", + iamApiUrl: "https://api-user-service.dcb.pixpay.sn/api/v1", dcbApiUrl: 'https://api.paymenthub.com/v2', // Configuration DCB diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index d9295e5..7729bf9 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -1,6 +1,7 @@ export const environment = { production: false, - apiUrl: "https://api-user-service.dcb.pixpay.sn/api/v1", + localServiceTestApiUrl: "https://backoffice.dcb.pixpay.sn/api/v1", + iamApiUrl: "https://api-user-service.dcb.pixpay.sn/api/v1", dcbApiUrl: 'https://api.paymenthub.com/v2', // Configuration DCB diff --git a/src/environments/environment.ts b/src/environments/environment.ts index ffda9e2..d53d6b6 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -1,6 +1,7 @@ export const environment = { production: false, - apiUrl: "http://localhost:3000/api/v1", + localServiceTestApiUrl: "http://localhost:4200/api/v1", + iamApiUrl: "http://localhost:3000/api/v1", dcbApiUrl: 'https://api.paymenthub.com/v2', // Configuration DCB