-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: [IOBP-964] Add zendesk payment subcategories (#6522)
> [!WARNING] > this PR depends on pagopa/io-services-metadata#892 > this PR depends on pagopa/io-dev-api-server#446 ## Short description This pull request includes the addition of a new API request type for fetching `Zendesk` payment configuration, updates to the Redux store and sagas to handle this new configuration, and modifications to the payment failure support modal to utilize the new configuration. ## List of changes proposed in this pull request - Added a new type `GetZendeskPaymentConfigT` and a corresponding API request `getZendeskPaymentConfig` to fetch the Zendesk payment configuration - `handleGetZendeskPaymentConfig` to manage the side effects of fetching the Zendesk payment configuration and integrated it into the `watchZendeskSupportSaga` - Updated the payment failure support modal to dispatch the `getZendeskPaymentConfig` action and utilize the fetched configuration to set custom fields for Zendesk tickets ## How to test Ensure that the outcomes are accurately mapped to the corresponding subcategory when opening a ticket --------- Co-authored-by: Alessandro <[email protected]>
- Loading branch information
1 parent
c7eca8a
commit 86043f0
Showing
13 changed files
with
221 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
"io_session_manager_api": "https://raw.githubusercontent.com/pagopa/io-auth-n-identity-domain/[email protected]/apps/io-session-manager/api/internal.yaml", | ||
"io_session_manager_public_api": "https://raw.githubusercontent.com/pagopa/io-auth-n-identity-domain/[email protected]/apps/io-session-manager/api/public.yaml", | ||
"io_public_api": "https://raw.githubusercontent.com/pagopa/io-backend/v16.4.0-RELEASE/api_public.yaml", | ||
"io_content_specs": "https://raw.githubusercontent.com/pagopa/io-services-metadata/1.0.49/definitions.yml", | ||
"io_content_specs": "https://raw.githubusercontent.com/pagopa/io-services-metadata/1.0.50/definitions.yml", | ||
"io_cgn_specs": "https://raw.githubusercontent.com/pagopa/io-backend/v16.4.0-RELEASE/api_cgn.yaml", | ||
"io_cgn_merchants_specs": "https://raw.githubusercontent.com/pagopa/io-backend/v16.4.0-RELEASE/api_cgn_operator_search.yaml", | ||
"api_fci": "https://raw.githubusercontent.com/pagopa/io-backend/v16.4.0-RELEASE/api_io_sign.yaml", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
ts/features/zendesk/saga/networking/handleGetZendeskPaymentConfig.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { readableReport } from "@pagopa/ts-commons/lib/reporters"; | ||
import * as E from "fp-ts/lib/Either"; | ||
import { call, put } from "typed-redux-saga/macro"; | ||
import { ContentClient } from "../../../../api/content"; | ||
import { SagaCallReturnType } from "../../../../types/utils"; | ||
import { getGenericError, getNetworkError } from "../../../../utils/errors"; | ||
import { getZendeskPaymentConfig } from "../../store/actions"; | ||
|
||
// retrieve the zendesk config from the CDN | ||
export function* handleGetZendeskPaymentConfig( | ||
getZendeskPaymentConfigClient: ReturnType< | ||
typeof ContentClient | ||
>["getZendeskPaymentConfig"] | ||
) { | ||
try { | ||
const getZendeskPaymentConfigResult: SagaCallReturnType< | ||
typeof getZendeskPaymentConfigClient | ||
> = yield* call(getZendeskPaymentConfigClient); | ||
if (E.isRight(getZendeskPaymentConfigResult)) { | ||
if (getZendeskPaymentConfigResult.right.status === 200) { | ||
yield* put( | ||
getZendeskPaymentConfig.success( | ||
getZendeskPaymentConfigResult.right.value | ||
) | ||
); | ||
} else { | ||
yield* put( | ||
getZendeskPaymentConfig.failure( | ||
getGenericError( | ||
Error( | ||
`response status ${getZendeskPaymentConfigResult.right.status}` | ||
) | ||
) | ||
) | ||
); | ||
} | ||
} else { | ||
getZendeskPaymentConfig.failure( | ||
getGenericError( | ||
Error(readableReport(getZendeskPaymentConfigResult.left)) | ||
) | ||
); | ||
} | ||
} catch (e) { | ||
yield* put(getZendeskPaymentConfig.failure(getNetworkError(e))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.