@Override
    public AppResponse process(Flow flow, AppRequest body) {
        Map<String, String> registration = digidClient.pollLetter(appSession.getAccountId(), appSession.getRegistrationId(), flow.getName().equals(ReApplyActivateActivationCode.NAME));

        if (registration.get(lowerUnderscore(GBA_STATUS)).equals("request")) {
            setValid(false);
            return new StatusResponse("PENDING");
        } else if (registration.get(lowerUnderscore(GBA_STATUS)).equals("deceased")){
            digidClient.remoteLog("559", Map.of(lowerUnderscore(ACCOUNT_ID), appAuthenticator.getAccountId(), lowerUnderscore(HIDDEN), true));
            return new NokResponse("gba_deceased");
        } else if (GBA_EMIGATED_RNI.contains(registration.get(lowerUnderscore(GBA_STATUS)))) {
            digidClient.remoteLog("558", Map.of(lowerUnderscore(ACCOUNT_ID), appAuthenticator.getAccountId(), lowerUnderscore(HIDDEN), true));
            return new NokResponse("gba_emigrated_RNI");
        }
        else if (registration.get(lowerUnderscore(GBA_STATUS)).equals("error")){
            return new NokResponse("error");
        } else if (!registration.get(lowerUnderscore(GBA_STATUS)).equals("valid_app_extension")){
            digidClient.remoteLog("558", Map.of(lowerUnderscore(ACCOUNT_ID), appAuthenticator.getAccountId(), lowerUnderscore(HIDDEN), true));
            return new NokResponse("gba_invalid");
        }

        digidClient.remoteLog("156", Map.of(lowerUnderscore(ACCOUNT_ID), appAuthenticator.getAccountId(), "device_name", appAuthenticator.getDeviceName(), lowerUnderscore(HIDDEN), true));
        appAuthenticator.setRequestedAt(ZonedDateTime.now());
        appAuthenticator.setIssuerType(registration.get(lowerUnderscore(ISSUER_TYPE)));

        digidClient.remoteLog("905", Map.of(lowerUnderscore(ACCOUNT_ID), appAuthenticator.getAccountId(), lowerUnderscore(APP_CODE), appAuthenticator.getAppCode(), lowerUnderscore(DEVICE_NAME), appAuthenticator.getDeviceName()));

        return new OkResponse();
    }
@Test
    void processStatusEmigrated(){
        when(digidClientMock.pollLetter(mockedAppSession.getAccountId(), mockedAppSession.getRegistrationId(), false)).thenReturn(gbaStatusResponseEmigrated    );

        AppResponse appResponse = letterPolling.process(mockedFlow, mockedAbstractAppRequest);

        verify(digidClientMock, times(1)).remoteLog("558", Map.of(lowerUnderscore(ACCOUNT_ID), TEST_ACCOUNT_ID, "hidden", true));
        assertTrue(appResponse instanceof NokResponse);
        assertEquals("gba_emigrated_RNI", ((NokResponse)appResponse).getError());
    }