From ae6e2258168e44050a284683b059ba818b8c6a91 Mon Sep 17 00:00:00 2001 From: Emanuele Dall'Ara <71103219+LeleDallas@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:02:38 +0100 Subject: [PATCH] feat: [IOBP-964] Add zendesk payment subcategories (#446) * feat: zendesk payment subcategory * refactor: update folder structure, receipts in json * chore: io-service-metadata v1.0.50 * chore: define correct zendesk payload definition --- .../payment/zendeskOutcomeMapping.json | 25 +++++++++ assets/assistanceTools/zendesk.json | 53 +++++++++++++++++++ package.json | 2 +- src/routers/services_metadata.ts | 20 +++++-- 4 files changed, 96 insertions(+), 4 deletions(-) create mode 100644 assets/assistanceTools/payment/zendeskOutcomeMapping.json diff --git a/assets/assistanceTools/payment/zendeskOutcomeMapping.json b/assets/assistanceTools/payment/zendeskOutcomeMapping.json new file mode 100644 index 00000000..c31526d7 --- /dev/null +++ b/assets/assistanceTools/payment/zendeskOutcomeMapping.json @@ -0,0 +1,25 @@ +{ + "payments": { + "subcategoryId": "29473336574609", + "subcategories": { + "pagamenti_pagopa_in_corso": [ + "PAYMENT_ONGOING" + ], + "pagamenti_pagopa_blocco": [], + "pagamenti_pagopa_info_stato": [], + "pagamenti_pagopa_altro_problema": [] + + } + }, + "receipts": { + "subcategoryId": "30635967748497", + "subcategories": { + "ricevute_pagopa_info": [], + "ricevute_pagopa_non_arrivata": [], + "ricevute_pagopa_arrivata_sconosciuta": [], + "ricevute_pagopa_errore_nei_dati": [], + "ricevute_pagopa_non_riesco_a_scaricare": [], + "ricevute_pagopa_altro_problema": [] + } + } +} \ No newline at end of file diff --git a/assets/assistanceTools/zendesk.json b/assets/assistanceTools/zendesk.json index 20e91ded..ef1fa290 100644 --- a/assets/assistanceTools/zendesk.json +++ b/assets/assistanceTools/zendesk.json @@ -107,6 +107,59 @@ "it-IT": "Pagamento pagoPA", "en-EN": "pagoPA payment", "de-DE": "pagoPA Zahlung" + }, + "zendeskSubCategories": { + "id": "29473336574609", + "subCategories": [ + { + "value": "pagamenti_pagopa_in_corso", + "description": { + "it-IT": "Il mio pagamento è in corso da troppo tempo", + "en-EN": "Il mio pagamento è in corso da troppo tempo", + "de-DE": "Il mio pagamento è in corso da troppo tempo" + } + }, + { + "value": "pagamenti_pagopa_errore", + "description": { + "it-IT": "Mi è comparso un errore durante un pagamento", + "en-EN": "Mi è comparso un errore durante un pagamento", + "de-DE": "Mi è comparso un errore durante un pagamento" + } + }, + { + "value": "pagamenti_pagopa_blocco", + "description": { + "it-IT": "L'app si è bloccata o riavviata durante un pagamento", + "en-EN": "L'app si è bloccata o riavviata durante un pagamento", + "de-DE": "L'app si è bloccata o riavviata durante un pagamento" + } + }, + { + "value": "pagamenti_pagopa_aggiunta_metodo", + "description": { + "it-IT": "Non riesco ad aggiungere un metodo di pagamento al Portafoglio", + "en-EN": "Non riesco ad aggiungere un metodo di pagamento al Portafoglio", + "de-DE": "Non riesco ad aggiungere un metodo di pagamento al Portafoglio" + } + }, + { + "value": "pagamenti_ pagopa_info_stato", + "description": { + "it-IT": "Vorrei informazioni sullo stato di un pagamento", + "en-EN": "Vorrei informazioni sullo stato di un pagamento", + "de-DE": "Vorrei informazioni sullo stato di un pagamento" + } + }, + { + "value": "pagamenti_pagopa_altro_problema", + "description": { + "it-IT": "Ho un altro problema", + "en-EN": "Ho un altro problema", + "de-DE": "Ho un altro problema" + } + } + ] } }, { diff --git a/package.json b/package.json index 8f6a774a..41cb7959 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "api_cgn": "https://raw.githubusercontent.com/pagopa/io-backend/v16.4.0-RELEASE/api_cgn.yaml", "api_cgn_merchants": "https://raw.githubusercontent.com/pagopa/io-backend/v16.4.0-RELEASE/api_cgn_operator_search.yaml", "api_cgn_geo": "https://raw.githubusercontent.com/pagopa/io-backend/here_geoapi_integration/api_geo.yaml", - "content_specs": "https://raw.githubusercontent.com/pagopa/io-services-metadata/1.0.49/definitions.yml", + "content_specs": "https://raw.githubusercontent.com/pagopa/io-services-metadata/1.0.50/definitions.yml", "api_pagopa_walletv2": "https://raw.githubusercontent.com/pagopa/io-services-metadata/1.0.44/bonus/specs/bpd/pm/walletv2.json", "api_pagopa": "https://raw.githubusercontent.com/pagopa/io-app/master/assets/paymentManager/spec.json", "pagopa_cobadge_configuration": "https://raw.githubusercontent.com/pagopa/io-services-metadata/1.0.45/pagopa/cobadge/abi_definitions.yml", diff --git a/src/routers/services_metadata.ts b/src/routers/services_metadata.ts index b5174583..7b6ad1c9 100644 --- a/src/routers/services_metadata.ts +++ b/src/routers/services_metadata.ts @@ -6,15 +6,19 @@ import { Router } from "express"; import * as E from "fp-ts/lib/Either"; import * as B from "fp-ts/lib/boolean"; import { pipe } from "fp-ts/lib/function"; +import { ServiceId } from "../../generated/definitions/backend/ServiceId"; import { SpidIdps } from "../../generated/definitions/content/SpidIdps"; import { VersionInfo } from "../../generated/definitions/content/VersionInfo"; import { Zendesk } from "../../generated/definitions/content/Zendesk"; +import { ZendeskSubcategoriesErrors } from "../../generated/definitions/content/ZendeskSubcategoriesErrors"; import { CoBadgeServices } from "../../generated/definitions/pagopa/cobadge/configuration/CoBadgeServices"; import { PrivativeServices } from "../../generated/definitions/pagopa/privative/configuration/PrivativeServices"; import { assetsFolder, staticContentRootPath } from "../config"; +import { pnServiceId } from "../features/pn/services/services"; import { backendStatus } from "../payloads/backend"; import { municipality } from "../payloads/municipality"; import { addHandler } from "../payloads/response"; +import { cgnServiceId } from "../payloads/services/special/cgn/factoryCGNService"; import { fileExists, isPngOrJpegExtension, @@ -25,9 +29,6 @@ import { } from "../utils/file"; import { serverUrl } from "../utils/server"; import { validatePayload } from "../utils/validator"; -import { ServiceId } from "../../generated/definitions/backend/ServiceId"; -import { pnServiceId } from "../features/pn/services/services"; -import { cgnServiceId } from "../payloads/services/special/cgn/factoryCGNService"; import ServicesDB from "./../persistence/services"; export const servicesMetadataRouter = Router(); @@ -292,6 +293,19 @@ addHandler( } ); +addHandler( + servicesMetadataRouter, + "get", + addRoutePrefix("/assistanceTools/payment/zendeskOutcomeMapping.json"), + (_, res) => { + const content = readFileAsJSON( + assetsFolder + "/assistanceTools/payment/zendeskOutcomeMapping.json" + ); + const zendeskPayload = validatePayload(ZendeskSubcategoriesErrors, content); + res.json(zendeskPayload); + } +); + const getOrLoadAndInitializeLogoRelativePath = ( fileNameWithExtension: string, map: Map,