Skip to content

Commit

Permalink
feat: [IOBP-964] Add zendesk payment subcategories (#446)
Browse files Browse the repository at this point in the history
* feat: zendesk payment subcategory

* refactor: update folder structure, receipts in json

* chore: io-service-metadata v1.0.50

* chore: define correct zendesk payload definition
  • Loading branch information
LeleDallas authored Dec 10, 2024
1 parent c7d8c71 commit ae6e225
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 4 deletions.
25 changes: 25 additions & 0 deletions assets/assistanceTools/payment/zendeskOutcomeMapping.json
Original file line number Diff line number Diff line change
@@ -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": []
}
}
}
53 changes: 53 additions & 0 deletions assets/assistanceTools/zendesk.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
]
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
20 changes: 17 additions & 3 deletions src/routers/services_metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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();
Expand Down Expand Up @@ -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<string, string>,
Expand Down

0 comments on commit ae6e225

Please sign in to comment.