From 5051d08fab77ff8ef3aa2379606b2de7f147a54c Mon Sep 17 00:00:00 2001 From: Ben Stokes Date: Mon, 7 Sep 2026 15:57:15 +0100 Subject: [PATCH] feat: display verification id on connect account page --- .../src/app/data/services/identity.service.ts | 28 ++++++++++++++++++- .../connected-account-detail.component.html | 5 ++++ .../connected-account-detail.component.ts | 21 ++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/apps/web/src/app/data/services/identity.service.ts b/apps/web/src/app/data/services/identity.service.ts index 9cd450e..c71ff68 100644 --- a/apps/web/src/app/data/services/identity.service.ts +++ b/apps/web/src/app/data/services/identity.service.ts @@ -1,6 +1,9 @@ import { Injectable, inject } from '@angular/core'; import { ApiService } from '../../core/services/api.service'; -import type { IdentityVerificationSession } from '@zoneless/shared-types'; +import type { + IdentityVerificationSession, + ListResponse, +} from '@zoneless/shared-types'; import type { CreateIdentityVerificationSessionInput } from '@zoneless/shared-schemas'; @Injectable({ @@ -22,4 +25,27 @@ export class IdentityService { data ); } + + /** + * List VerificationSessions for the platform, newest first. + */ + async ListVerificationSessions( + params: { + relatedAccount?: string; + limit?: number; + } = {} + ): Promise> { + const query: Record = {}; + if (params.relatedAccount) { + query['related_account'] = params.relatedAccount; + } + if (params.limit !== undefined) { + query['limit'] = String(params.limit); + } + return this.api.Call>( + 'GET', + 'identity/verification_sessions', + query + ); + } } diff --git a/apps/web/src/app/features/account/connected-accounts/views/connected-account-detail/connected-account-detail.component.html b/apps/web/src/app/features/account/connected-accounts/views/connected-account-detail/connected-account-detail.component.html index 576211d..8753e43 100644 --- a/apps/web/src/app/features/account/connected-accounts/views/connected-account-detail/connected-account-detail.component.html +++ b/apps/web/src/app/features/account/connected-accounts/views/connected-account-detail/connected-account-detail.component.html @@ -408,6 +408,11 @@

Identity requirements

} + } @if (diditSessionId(); as sessionId) { +
+
Didit session
+
+
} @if ( !GetIdentityStatusLabel() && GetCurrentlyDue().length === 0 && GetPendingVerification().length === 0 && GetRequirementErrors().length === 0 ) { diff --git a/apps/web/src/app/features/account/connected-accounts/views/connected-account-detail/connected-account-detail.component.ts b/apps/web/src/app/features/account/connected-accounts/views/connected-account-detail/connected-account-detail.component.ts index 91a8b81..3c1a95b 100644 --- a/apps/web/src/app/features/account/connected-accounts/views/connected-account-detail/connected-account-detail.component.ts +++ b/apps/web/src/app/features/account/connected-accounts/views/connected-account-detail/connected-account-detail.component.ts @@ -23,6 +23,7 @@ import { AccountService, BalanceService, ExternalWalletService, + IdentityService, PersonService, } from '../../../../../data'; import { MetaService } from '../../../../../core'; @@ -84,6 +85,7 @@ export class ConnectedAccountDetailViewComponent implements OnInit, OnDestroy { private readonly accountService = inject(AccountService); private readonly balanceService = inject(BalanceService); private readonly externalWalletService = inject(ExternalWalletService); + private readonly identityService = inject(IdentityService); private readonly personService = inject(PersonService); private readonly metaService = inject(MetaService); readonly actions = inject(ConnectedAccountActionsService); @@ -106,6 +108,7 @@ export class ConnectedAccountDetailViewComponent implements OnInit, OnDestroy { availableBalance: WritableSignal = signal(0); pendingBalance: WritableSignal = signal(0); externalWallets: WritableSignal = signal([]); + diditSessionId: WritableSignal = signal(null); idCopied: WritableSignal = signal(false); private idCopiedTimer?: ReturnType; @@ -407,6 +410,7 @@ export class ConnectedAccountDetailViewComponent implements OnInit, OnDestroy { if (this.account()?.id === id) return; this.account.set(null); + this.diditSessionId.set(null); this.activeTab.set('overview'); this.detailPanel.set('main'); this.moneyMovementTab.set('payouts'); @@ -427,6 +431,7 @@ export class ConnectedAccountDetailViewComponent implements OnInit, OnDestroy { await Promise.all([ this.RefreshBalance(id), this.LoadWallets(id, account), + this.LoadLatestVerificationSession(id), ]); } finally { this.loading.set(false); @@ -465,6 +470,22 @@ export class ConnectedAccountDetailViewComponent implements OnInit, OnDestroy { } } + private async LoadLatestVerificationSession( + accountId: string + ): Promise { + try { + const result = await this.identityService.ListVerificationSessions({ + relatedAccount: accountId, + limit: 1, + }); + this.diditSessionId.set( + result.data[0]?.provider_session_id?.trim() || null + ); + } catch { + this.diditSessionId.set(null); + } + } + SetTab(tab: DetailTab): void { this.activeTab.set(tab); }